/* ====================================
   CS2 ACADEMY - ENHANCED DESIGN V2
   Premium Gamer Aesthetic
   ==================================== */

/* ============ ENHANCED VARIABLES ============ */
:root {
    /* Enhanced colors with more depth */
    --bg-primary: #050508;
    --bg-secondary: #0a0a10;
    --bg-tertiary: #0f0f18;
    --bg-card: rgba(15, 15, 25, 0.8);
    --bg-glass: rgba(20, 20, 35, 0.6);

    /* Neon accent colors - more vibrant */
    --neon-cyan: #00d4ff;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
    --neon-green: #22c55e;
    --neon-orange: #f97316;
    --neon-yellow: #eab308;
    --neon-red: #ef4444;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
}

/* ============ GLASSMORPHISM CARDS ============ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ============ ENHANCED ANIMATIONS ============ */
@keyframes neon-flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3),
            0 0 40px rgba(0, 212, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.5),
            0 0 60px rgba(0, 212, 255, 0.2);
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100vh);
    }
}

/* ============ PARTICLE BACKGROUND ============ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-cyan);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 15s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* ============ ENHANCED HERO ============ */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
    animation: gradient-shift 15s ease infinite;
    background-size: 200% 200%;
    pointer-events: none;
}

.hero-image {
    position: absolute;
    bottom: -10%;
    right: -5%;
    width: 50%;
    max-width: 600px;
    opacity: 0.3;
    animation: float-slow 8s ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.3));
}

/* ============ ENHANCED BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.badge-premium {
    background: linear-gradient(135deg, var(--neon-yellow), var(--neon-orange));
    color: var(--bg-primary);
    animation: pulse-glow 2s infinite;
}

.badge-new {
    background: var(--neon-green);
    color: var(--bg-primary);
}

.badge-pro {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    color: white;
}

/* ============ ENHANCED CARDS ============ */
.part-card {
    position: relative;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(20, 20, 35, 0.9) 100%);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.part-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-cyber);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.part-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(0, 212, 255, 0.1) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.part-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.1);
}

.part-card:hover::before {
    transform: scaleX(1);
}

.part-card:hover::after {
    opacity: 1;
}

.part-card-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-bottom: var(--spacing-sm);
    border: 2px solid var(--glass-border);
}

/* ============ VIDEO EMBED ============ */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--glass-border);
    margin: var(--spacing-lg) 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-thumbnail:hover {
    transform: scale(1.02);
}

.video-thumbnail img {
    width: 100%;
    display: block;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--neon-cyan);
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    transition: all 0.3s ease;
}

.video-thumbnail:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.7);
}

/* ============ QUIZ STYLES ============ */
.quiz-container {
    background: var(--bg-card);
    border: 2px solid var(--neon-purple);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
}

.quiz-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neon-purple);
}

.quiz-progress {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.quiz-question {
    margin-bottom: var(--spacing-lg);
}

.quiz-question-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    border-color: var(--neon-purple);
    background: rgba(168, 85, 247, 0.1);
}

.quiz-option.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.quiz-option.correct {
    border-color: var(--neon-green);
    background: rgba(34, 197, 94, 0.2);
}

.quiz-option.incorrect {
    border-color: var(--neon-red);
    background: rgba(239, 68, 68, 0.2);
}

.quiz-option-radio {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quiz-option.selected .quiz-option-radio {
    border-color: var(--neon-cyan);
    background: var(--neon-cyan);
}

.quiz-option.selected .quiz-option-radio::after {
    content: '✓';
    color: var(--bg-primary);
    font-weight: bold;
}

.quiz-feedback {
    display: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}

.quiz-feedback.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--neon-red);
    color: var(--neon-red);
}

.quiz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--neon-purple);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-btn:hover {
    background: var(--neon-pink);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.quiz-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-result {
    text-align: center;
    padding: var(--spacing-xl);
}

.quiz-score {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ BADGE SYSTEM ============ */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.achievement-badge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--glass-border);
    min-width: 120px;
    transition: all 0.3s ease;
}

.achievement-badge.unlocked {
    border-color: var(--neon-yellow);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.3);
}

.achievement-badge.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-badge:hover {
    transform: translateY(-5px);
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
}

.badge-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

.badge-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.badge-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 2rem;
}

/* ============ LEVEL PROGRESS ============ */
.level-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--glass-border);
    margin-bottom: var(--spacing-lg);
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.level-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.level-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-cyber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--bg-primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.level-text h3 {
    margin: 0;
    font-size: 1.25rem;
}

.level-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.level-xp {
    text-align: right;
}

.level-xp-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

.level-xp-needed {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.level-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.level-bar-fill {
    height: 100%;
    background: var(--gradient-cyber);
    border-radius: var(--radius-xl);
    transition: width 0.5s ease;
    position: relative;
}

.level-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

/* ============ STREAK COUNTER ============ */
.streak-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.1));
    border: 1px solid var(--neon-orange);
    border-radius: var(--radius-lg);
}

.streak-icon {
    font-size: 2rem;
    animation: pulse 1s infinite;
}

.streak-info h4 {
    margin: 0;
    color: var(--neon-orange);
}

.streak-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============ INSTRUCTOR CARDS ============ */
.instructor-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.instructor-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-cyber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bg-primary);
}

.instructor-info h4 {
    margin: 0 0 4px;
}

.instructor-role {
    font-size: 0.875rem;
    color: var(--neon-cyan);
}

/* ============ MAP CARDS (for Part 3) ============ */
.map-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.map-card:hover img {
    transform: scale(1.1);
}

.map-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.map-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.map-card-strats {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============ ENHANCED SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
}

/* ============ LOADING ANIMATIONS ============ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* SEARCH BAR STYLES */
.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
    margin: 0 2rem;
}

#global-search {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'16\' height=\'16\' viewBox=\'0 0 24 24\' fill=\'none\' stroke=\'%2394a3b8\' stroke-width=\'2\' stroke-linecap=\'round\' stroke-linejoin=\'round\'%3E%3Ccircle cx=\'11\' cy=\'11\' r=\'8\'%3E%3C/circle%3E%3Cline x1=\'21\' y1=\'21\' x2=\'16.65\' y2=\'16.65\'%3E%3C/line%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: 10px center;
}

#global-search:focus {
    outline: none;
    border-color: var(--neon-cyan);
    background-color: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: block;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(6, 182, 212, 0.1);
}

.search-result-title {
    color: white;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.search-result-module {
    font-size: 0.75rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-no-results {
    padding: 1rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }
}

/* ============ ACCORDION FIX ============ */
.part-content {
    max-height: 8000px;
    /* Increased to accommodate large modules like Part 4 */
    overflow: hidden;
    transition: max-height 0.8s ease-in-out, opacity 0.5s ease;
    opacity: 1;
}

.part-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
}

/* Navbar Login Button Highlight */
.navbar .navbar-nav .nav-link.nav-btn-login {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    /* Ensure no border from link styles */
}

.navbar .navbar-nav .nav-link.nav-btn-login:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
    color: white !important;
    /* Ensure text stays white on hover */
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    /* Maintain background */
}