/* Tab Utility CSS - Áp dụng toàn cục cho tabs */

/* Custom scrollbar cho tabs */
.tab-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(130, 108, 253, 0.3) transparent;
}

.tab-scroll-container::-webkit-scrollbar {
  height: 3px;
  width: 3px;
}

.tab-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.tab-scroll-container::-webkit-scrollbar-thumb {
  background-color: rgba(130, 108, 253, 0.3);
  border-radius: 3px;
}

/* Tab content transition */
.tab-content-transition {
  transition: all 0.3s ease;
}

/* Tab indicator animation */
@keyframes tabIndicatorSlide {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes tabGlow {
  0% {
    box-shadow: 0 0 5px rgba(130, 108, 253, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(130, 108, 253, 0.5);
  }
  100% {
    box-shadow: 0 0 5px rgba(130, 108, 253, 0.3);
  }
}

.tab-indicator {
  animation: tabIndicatorSlide 0.3s ease-out forwards;
}

/* Mobile-first tab layout */
@media (max-width: 768px) {
  .tabs-mobile-optimized {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0 -0.5rem;
  }

  .tab-mobile-item {
    scroll-snap-align: start;
    flex: 0 0 auto;
    min-width: 60px;
    text-align: center;
  }

  .tab-icon-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    position: relative;
    z-index: 2;
  }

  /* Tab active indicator cho mobile */
  .tab-active-mobile {
    position: relative;
    animation: tabGlow 3s infinite ease-in-out;
  }

  .tab-active-mobile::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--themeHr2, #826cfd);
    border-radius: 50%;
    animation: tabIndicatorSlide 0.3s ease-out forwards;
    box-shadow: 0 0 8px 2px rgba(130, 108, 253, 0.6);
  }
}

/* Tab shadow hover effect */
.tab-hover-shadow:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tab-hover-shadow:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Custom styles for active tab */
.tab-active-highlight {
  position: relative;
  overflow: hidden;
}

.tab-active-highlight::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #826cfd, #6c41ff);
  z-index: 2;
}

/* Ripple effect for tab clicks */
@keyframes tab-ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.tab-ripple {
  position: relative;
  overflow: hidden;
}

.tab-ripple::after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(130, 108, 253, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition:
    transform 0.5s,
    opacity 1s;
}

.tab-ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}
