/* ============================================================================
   GLOBAL TAB SYSTEM
   ============================================================================ 
   
   Unified tab/navigation system for all tab interfaces in Dynbrew.
   
   Design principles:
   - Icon to left, text to right (consistent across all tabs)
   - Inactive tabs: text truncates with ellipsis if needed
   - Active tab: shows full text, NO background color
   - Active indicator: colored border-bottom only
   
   Usage:
   - Base: .tabs-container + .tab-item (with .tab-icon + .tab-label)
   - Modifiers:
     - .tabs-compact     : More compact padding
     - .tabs-pills       : Rounded pill style with background
     - .tabs-minimal     : Very subtle styling
     - .tabs-wizard      : Special wizard style
   
   Example:
      <nav class="tabs-container">
        <a href="#" class="tab-item active">
          <span class="tab-icon">🍺</span>
          <span class="tab-label">Styles</span>
        </a>
      </nav>
*/

/* ============================================================================
   BASE TAB STYLES
   ============================================================================ */

.tabs-container {
    display: flex;
    gap: 0;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.tabs-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-container::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.tabs-container::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Tab Item - Icon to left, text to right (universal) */
.tab-item {
    flex: 0 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    color: #555;
    text-decoration: none;
    min-width: auto;
    max-width: 200px;
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.tab-item:hover {
    color: #667eea;
}

.tab-item.active {
    border-bottom-color: #667eea;
    color: #667eea;
    background: transparent;
    max-width: none;
}

.tab-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.tab-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tab-label {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Active tab shows full text */
.tab-item.active .tab-label {
    overflow: visible;
    white-space: normal;
}

/* ============================================================================
   MODIFIER: COMPACT
   ============================================================================ */

.tabs-container.tabs-compact {
    overflow-x: hidden;
}

.tabs-container.tabs-compact .tab-item {
    padding: 0.625rem 1rem;
    max-width: 150px;
    flex: 1 1 auto;
    min-width: 0;
}

.tabs-container.tabs-compact .tab-item.active {
    flex: 0 0 auto;
    max-width: none;
}

.tabs-container.tabs-compact .tab-icon {
    font-size: 1.1rem;
}

.tabs-container.tabs-compact .tab-label {
    font-size: 0.85rem;
}

/* ============================================================================
   MODIFIER: PILLS (Rounded with background - exception to no-bg rule)
   ============================================================================ */

.tabs-container.tabs-pills {
    gap: 0.5rem;
    background: transparent;
    border-bottom: none;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}

.tabs-container.tabs-pills .tab-item {
    border-radius: 8px;
    border-bottom: none;
    padding: 0.625rem 1rem;
    max-width: 180px;
}

.tabs-container.tabs-pills .tab-item:hover {
    background: #f8f9fa;
}

.tabs-container.tabs-pills .tab-item.active {
    background: #3498db;
    color: white;
    border-bottom: none;
}

/* ============================================================================
   MODIFIER: MINIMAL (Very subtle styling)
   ============================================================================ */

.tabs-container.tabs-minimal {
    background: transparent;
    border-bottom: 1px solid #e0e0e0;
    gap: 0.5rem;
    padding: 0;
}

.tabs-container.tabs-minimal .tab-item {
    padding: 0.75rem 1rem;
    border-bottom-width: 2px;
    max-width: 180px;
}

.tabs-container.tabs-minimal .tab-item:hover {
    color: #3498db;
}

.tabs-container.tabs-minimal .tab-item.active {
    border-bottom-color: #3498db;
    color: #3498db;
}

/* ============================================================================
   MODIFIER: WIZARD (For recipe wizard)
   ============================================================================ */

.tabs-container.tabs-wizard {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 1rem 0;
    position: sticky;
    top: 60px;
    z-index: 100;
    overflow-x: hidden;
}

.tabs-container.tabs-wizard .tab-item {
    padding: 0.75rem 0.5rem;
    max-width: 150px;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.5rem;
}

.tabs-container.tabs-wizard .tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tabs-container.tabs-wizard .tab-item .tab-icon {
    font-size: 1.5rem;
}

.tabs-container.tabs-wizard .tab-item:hover {
    background: #f8f9fa;
}

.tabs-container.tabs-wizard .tab-item.active {
    border-bottom-color: #667eea;
    color: #667eea;
    max-width: none;
    padding: 0.75rem 1rem;
    flex: 0 0 auto;
}

.tabs-container.tabs-wizard .tab-item.active .tab-label {
    overflow: visible;
    white-space: nowrap;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .tab-item {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
        max-width: 150px;
    }

    .tab-icon {
        font-size: 1.1rem;
    }

    .tab-label {
        font-size: 0.8rem;
    }

    .tab-item.active {
        max-width: none;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Hide scrollbar but keep functionality */
.tabs-container.tabs-no-scrollbar {
    scrollbar-width: none;
}

.tabs-container.tabs-no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Center tabs */
.tabs-container.tabs-center {
    justify-content: center;
}

/* Allow wrapping */
.tabs-container.tabs-wrap {
    flex-wrap: wrap;
}

/* Full width tabs */
.tabs-container.tabs-full-width .tab-item {
    flex: 1 1 0;
    min-width: 0;
}