/**
 * @file
 * Basic Tabs Component
 * 
 * A modern, responsive horizontal tab navigation component.
 * Uses Tailwind token colors (accent, accent-darker, accent-lighter, etc.)
 * 
 * USAGE:
 * ------
 * <div class="basic-tabs">
 *   <div class="basic-tabs-nav">
 *     <button class="basic-tab active" data-tab="tab1">Tab Label</button>
 *     <button class="basic-tab" data-tab="tab2">Tab Label</button>
 *   </div>
 *   <div class="basic-tabs-content">
 *     <div class="basic-tab-panel active" id="tab1">Content...</div>
 *     <div class="basic-tab-panel" id="tab2">Content...</div>
 *   </div>
 * </div>
 * 
 * GRADIENT BACKGROUNDS (add any gradient class from gradients.css to .basic-tabs-nav):
 * --------------------------------------------------------------------------------------
 * All gradients from gradients.css work automatically:
 *   <div class="basic-tabs-nav gradient-smaragd-aquamarin">
 *   <div class="basic-tabs-nav gradient-aprikose-preussen">
 *   <div class="basic-tabs-nav gradient-himmel-kornblume">
 *   ... and any future gradients added to gradients.css
 * 
 * OVERLAY OPTIONS (same as header, add to .basic-tabs-nav with gradient):
 * ------------------------------------------------------------------------
 *   - basic-tabs-overlay-white        → uniform white overlay (40% opacity)
 *   - basic-tabs-overlay-white-center → white center vignette
 *   - basic-tabs-overlay-black        → uniform black overlay (40% opacity)
 *   - basic-tabs-overlay-center       → dark center vignette
 * 
 * STYLE OPTIONS (add to .basic-tabs):
 * ------------------------------------
 * - (default)             → pill style with gradient nav background
 * - basic-tabs-card       → card style with shadows
 * - basic-tabs-minimal    → minimal clean style
 */

/* ==========================================================================
   BASIC TABS - Container
   ========================================================================== */

.basic-tabs {
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   BASIC TABS - Navigation Bar (Default: Light Background)
   ========================================================================== */

.basic-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: none;
    position: relative;
    /* Subtle fade in up animation */
    animation: basicTabsAppear 0.5s ease-out forwards;
}

@keyframes basicTabsAppear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs stretch to fill available space */
.basic-tabs-nav .basic-tab {
    flex: 1 1 auto;
    min-width: 120px;
    text-align: center;
}

/* ==========================================================================
   BASIC TABS - Individual Tab Button (Pill Style)
   Uses Tailwind token colors
   ========================================================================== */

.basic-tab {
    position: relative;
    padding: 0.625rem 1rem;
    font-family: Figtree, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    color: #1F2937;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

.basic-tab:hover {
    color: #ffffff;
    background: #14b8a6;
    border-color: #14b8a6;
}

.basic-tab:active {
    background: #2dd4bf;
    border-color: #2dd4bf;
}

.basic-tab:focus-visible {
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.4);
}

/* Active state */
.basic-tab.active {
    color: #ffffff;
    background: #2dd4bf;
    border-color: #2dd4bf;
    box-shadow: 
        0 0 0 2px #5eead4,
        0 4px 12px rgba(45, 212, 191, 0.3);
}

.basic-tab.active:hover {
    background: #14b8a6;
    border-color: #14b8a6;
}

/* ==========================================================================
   GRADIENT NAV BACKGROUND
   Works with ANY gradient class from gradients.css (current and future)
   ========================================================================== */

/* Detect gradient by checking for gradient- prefix in class */
.basic-tabs-nav[class*="gradient-"] {
    border: none;
}

/* Inactive tabs on gradient: transparent with white border */
.basic-tabs-nav[class*="gradient-"] .basic-tab {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Hover: semi-transparent white fill with dark text (same as active) */
.basic-tabs-nav[class*="gradient-"] .basic-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.9);
    color: #1F2937;
    text-shadow: none;
    transform: translateY(-1px);
}

/* Active: solid white with dark text */
.basic-tabs-nav[class*="gradient-"] .basic-tab.active {
    background: #ffffff;
    border: 2px solid #ffffff;
    color: #1F2937;
    text-shadow: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.basic-tabs-nav[class*="gradient-"] .basic-tab.active:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

/* Dark text variant for light gradients */
.basic-tabs-nav[class*="gradient-"].basic-tabs-text-dark .basic-tab {
    color: #1F2937;
    text-shadow: none;
    border-color: rgba(31, 41, 55, 0.3);
}

.basic-tabs-nav[class*="gradient-"].basic-tabs-text-dark .basic-tab:hover {
    color: #1F2937;
    border-color: rgba(31, 41, 55, 0.6);
    background: rgba(255, 255, 255, 0.5);
}

.basic-tabs-nav[class*="gradient-"].basic-tabs-text-dark .basic-tab.active {
    color: #1F2937;
    border-color: #1F2937;
}

/* ==========================================================================
   NAV OVERLAY OPTIONS (matching header overlay classes exactly)
   ========================================================================== */

/* White transparent overlay - uniform (matches header-bg-overlay-white) */
.basic-tabs-nav.basic-tabs-overlay-white::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* Center overlay WHITE - white in the middle (matches header-bg-overlay-center-white) */
.basic-tabs-nav.basic-tabs-overlay-white-center::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 60% at center,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.2) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* Black transparent overlay - uniform (matches header-bg-overlay-black) */
.basic-tabs-nav.basic-tabs-overlay-black::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* Center overlay - dark in the middle (matches header-bg-overlay-center) */
.basic-tabs-nav.basic-tabs-overlay-center::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 60% at center,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.4) 30%,
        rgba(0, 0, 0, 0.2) 60%,
        rgba(0, 0, 0, 0) 100%
    );
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   BASIC TABS - Content Panels
   ========================================================================== */

.basic-tabs-content {
    position: relative;
}

.basic-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.basic-tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   STYLE VARIANT: Card Style
   ========================================================================== */

.basic-tabs.basic-tabs-card .basic-tabs-nav {
    background: transparent;
    border: none;
    padding: 0;
    gap: 0.75rem;
}

.basic-tabs.basic-tabs-card .basic-tab {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
}

.basic-tabs.basic-tabs-card .basic-tab:hover {
    color: #1F2937;
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.basic-tabs.basic-tabs-card .basic-tab.active {
    color: #ffffff;
    background: #2dd4bf;
    border-color: #2dd4bf;
    box-shadow: 
        0 6px 20px rgba(45, 212, 191, 0.35),
        0 3px 8px rgba(45, 212, 191, 0.2);
    transform: translateY(-3px);
}

/* ==========================================================================
   STYLE VARIANT: Minimal
   ========================================================================== */

.basic-tabs.basic-tabs-minimal .basic-tabs-nav {
    background: transparent;
    border: none;
    padding: 0;
    gap: 0.25rem;
}

.basic-tabs.basic-tabs-minimal .basic-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 400;
}

.basic-tabs.basic-tabs-minimal .basic-tab:hover {
    background: rgba(45, 212, 191, 0.1);
    color: #14b8a6;
}

.basic-tabs.basic-tabs-minimal .basic-tab.active {
    font-weight: 600;
    background: rgba(45, 212, 191, 0.15);
    color: #0d9488;
    box-shadow: none;
}

/* ==========================================================================
   RESPONSIVE - Tablet
   ========================================================================== */

@media (max-width: 1024px) {
    .basic-tabs-nav {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .basic-tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.9375rem;
    }
    
    .basic-tabs.basic-tabs-card .basic-tab {
        padding: 0.625rem 1rem;
    }
}

/* ==========================================================================
   RESPONSIVE - Mobile
   ========================================================================== */

@media (max-width: 640px) {
    .basic-tabs-nav {
        gap: 0.5rem;
        padding: 0.5rem;
        border-radius: 8px;
        justify-content: center;
    }
    
    .basic-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        border-radius: 6px;
        min-width: 0;
    }
    
    /* Responsive overlay for mobile */
    .basic-tabs-nav.basic-tabs-overlay-white-center::before {
        background: radial-gradient(
            ellipse 90% 70% at center,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.4) 35%,
            rgba(255, 255, 255, 0.2) 65%,
            rgba(255, 255, 255, 0) 100%
        );
    }
    
    .basic-tabs-nav.basic-tabs-overlay-center::before {
        background: radial-gradient(
            ellipse 90% 70% at center,
            rgba(0, 0, 0, 0.5) 0%,
            rgba(0, 0, 0, 0.4) 35%,
            rgba(0, 0, 0, 0.2) 65%,
            rgba(0, 0, 0, 0) 100%
        );
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes basicTabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.basic-tab-panel.active {
    animation: basicTabFadeIn 0.3s ease forwards;
}

/* Tab button press effect */
.basic-tab:active {
    transform: scale(0.98);
}

.basic-tabs.basic-tabs-card .basic-tab:active {
    transform: translateY(0) scale(0.98);
}

/* ==========================================================================
   ICON SUPPORT
   ========================================================================== */

.basic-tab-icon {
    display: inline-flex;
    margin-right: 0.5rem;
    font-size: 1.1em;
    vertical-align: middle;
}

/* ==========================================================================
   BADGE/COUNT SUPPORT
   ========================================================================== */

.basic-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #0d9488;
    background: rgba(45, 212, 191, 0.2);
    border-radius: 999px;
}

.basic-tab.active .basic-tab-badge {
    color: #2dd4bf;
    background: rgba(255, 255, 255, 0.9);
}

/* On gradient backgrounds */
.basic-tabs-nav[class*="gradient-"] .basic-tab .basic-tab-badge {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
}

.basic-tabs-nav[class*="gradient-"] .basic-tab.active .basic-tab-badge {
    color: #0d9488;
    background: rgba(45, 212, 191, 0.2);
}
