/* Interactive Tabs Styles - Tailwind v4 Compatible */

/* Tab container with grid wrapping support */
.tabs {
  align-items: center;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 0.5rem;
}

/* Tabs wrapper for orientation support */
.tabs-wrapper {
  position: relative;
  overflow: auto;
}

/* Tab label enhancements */
.tabs .tab-label {
  white-space: nowrap;
  user-select: none;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.tabs .tab-label:hover {
  background-color: hsl(var(--b2) / 0.5);
  z-index: 50;
}

/* Tab text with truncation */
.tab-text {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover expansion for tab text */
.tab-label:hover .tab-text {
  position: absolute;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  background-color: hsl(var(--b2));
  padding: 0.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid hsl(var(--b3));
  min-width: max-content;
  max-width: 300px;
  z-index: 50;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
}

/* Active tab indicator (using Alpine class binding) */
.tabs .tab-label.tab-active {
  font-weight: 600;
  border-color: hsl(var(--bc) / 0.2);
}

/* Tab panels container */
.tab-panels {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.tab-panel {
  width: 100%;
  min-width: 0;
  animation: tabFadeIn 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive tab sizing with Container Queries */
@container (max-width: 480px) {
  .tabs .tab-label {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  .tabs .tab-label .badge {
    display: none;
  }
}

@container (min-width: 481px) and (max-width: 768px) {
  .tabs .tab-label {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }
}

@container (min-width: 769px) {
  .tabs .tab-label {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
  }
}

/* Smooth scrollbar for tab overflow */
.tabs-wrapper::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}
.tabs-wrapper::-webkit-scrollbar-track {
  background: hsl(var(--b2));
  border-radius: 2px;
}
.tabs-wrapper::-webkit-scrollbar-thumb {
  background: hsl(var(--bc) / 0.2);
  border-radius: 2px;
}
.tabs-wrapper::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--bc) / 0.3);
}

/* Vertical orientation specific styles */
.tabs.flex-col {
  grid-template-columns: 1fr !important;
  grid-auto-flow: row;
}

/* Horizontal orientation specific styles */
.tabs.flex-row {
  grid-auto-flow: row;
}
