/* ===== ENHANCED PACKAGE TABS DESIGN ===== */

/* Container for the tab system */
.category-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem;
    background: var(--neutral-100);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--neutral-200);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}

/* Sliding background indicator */
.category-tabs::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    width: calc(33.333% - 0.33rem);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    z-index: 1;
}

/* Move indicator based on active tab */
.category-tabs[data-active="skd"]::before {
    transform: translateX(0%);
}

.category-tabs[data-active="skb"]::before {
    transform: translateX(100%);
}

.category-tabs[data-active="pppk"]::before {
    transform: translateX(200%);
}

/* Enhanced tab buttons */
.tab-button {
    background: transparent;
    color: var(--neutral-600);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 60px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Active state */
.tab-button.active {
    color: white;
    transform: translateY(-1px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hover effects for non-active buttons */
.tab-button:not(.active):hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Icons for each tab */
.tab-button::before {
    font-size: 1.2rem;
    margin-right: 0.3rem;
}

.tab-button[data-tab="skd"]::before {
    content: '📚';
}

.tab-button[data-tab="skb"]::before {
    content: '🎯';
}

.tab-button[data-tab="pppk"]::before {
    content: '👨‍🏫';
}

/* Pulse animation for active tab */
.tab-button.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    animation: tabPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes tabPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Enhanced visual feedback */
.tab-button:active {
    transform: translateY(0);
}

/* Badge/indicator for tab content count */
.tab-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    animation: badgeBounce 2s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .category-tabs {
        margin-bottom: 2rem;
        padding: 0.3rem;
        border-radius: 16px;
        gap: 0.25rem;
        max-width: 350px;
    }

    .category-tabs::before {
        top: 0.3rem;
        bottom: 0.3rem;
        left: 0.3rem;
        border-radius: 12px;
        width: calc(33.333% - 0.2rem);
    }

    .tab-button {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        border-radius: 12px;
        min-height: 50px;
        flex-direction: column;
        gap: 0.2rem;
    }

    .tab-button::before {
        font-size: 1rem;
        margin-right: 0;
        margin-bottom: 0.1rem;
    }

    /* Stack layout for very small screens */
    @media (max-width: 480px) {
        .category-tabs {
            flex-direction: column;
            max-width: 280px;
            gap: 0.5rem;
            padding: 0.5rem;
        }

        .category-tabs::before {
            display: none; /* Hide sliding indicator on stacked layout */
        }

        .tab-button {
            flex-direction: row;
            justify-content: center;
            border: 2px solid var(--neutral-200);
            background: white;
            border-radius: 12px;
        }

        .tab-button.active {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            border-color: var(--primary);
            color: white;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        .tab-button:not(.active):hover {
            border-color: var(--primary);
            background: var(--primary-light);
        }
    }
}

/* Loading state for tabs */
.tab-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.tab-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: tabSpin 1s linear infinite;
}

@keyframes tabSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Premium styling for special tabs */
.tab-button.premium {
    position: relative;
    overflow: hidden;
}

.tab-button.premium::before {
    content: '👑';
}

.tab-button.premium.active {
    background: linear-gradient(135deg, var(--accent), #f97316);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

/* Glassmorphism effect variant */
.category-tabs.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.category-tabs.glass::before {
    background: rgba(59, 130, 246, 0.9);
    backdrop-filter: blur(10px);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .category-tabs {
        background: var(--neutral-800);
        border-color: var(--neutral-700);
    }

    .tab-button {
        color: var(--neutral-300);
    }

    .tab-button:not(.active):hover {
        background: rgba(59, 130, 246, 0.2);
        color: var(--primary-light);
    }
}

/* Accessibility improvements */
.tab-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.tab-button:focus:not(:focus-visible) {
    box-shadow: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .category-tabs {
        border: 3px solid var(--neutral-900);
    }

    .tab-button.active {
        border: 2px solid var(--neutral-900);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .category-tabs::before,
    .tab-button,
    .tab-badge {
        transition: none;
        animation: none;
    }
}