/* ==========================================================================
   ADITYA FLUTES SCHOOL - INTERACTIVE 3D NAVIGATION & TRANSITIONS CSS
   File: assets/css/course-navigation.css (Enhanced High-Contrast Styling)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FLOATING GLASSMORPHIC NAVIGATION CONTAINER (DESKTOP SIDEBAR)
   -------------------------------------------------------------------------- */
.floating-nav-container {
    position: fixed;
    left: 28px;
    top: 50%;
    transform: translateY(-50%) translateX(-40px);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-nav-container.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

/* Vertical Gold Progress Line Track */
.fn-progress-track {
    position: absolute;
    left: 24px;
    top: 25px;
    bottom: 25px;
    width: 3px;
    background: rgba(212, 175, 55, 0.22);
    border-radius: 3px;
    z-index: 1;
    pointer-events: none;
}

/* Animated Progress Light Fill */
.fn-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 60%, #c8911a 100%);
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.9), 0 0 5px rgba(212, 175, 55, 0.7);
    transition: height 0.15s ease-out;
}

/* List Wrapper */
.fn-balls-list {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --------------------------------------------------------------------------
   2. FLOATING GLOWING SPHERES & AMBIENT ANIMATION
   -------------------------------------------------------------------------- */
.fn-ball-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    outline: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Ambient Gentle Vertical Sway Animation */
.fn-ball-wrapper .fn-ball {
    animation: fnAmbientFloat 4s ease-in-out infinite;
    will-change: transform;
}

.fn-ball-wrapper:nth-child(1) .fn-ball { animation-delay: 0s; }
.fn-ball-wrapper:nth-child(2) .fn-ball { animation-delay: 0.8s; }
.fn-ball-wrapper:nth-child(3) .fn-ball { animation-delay: 1.6s; }
.fn-ball-wrapper:nth-child(4) .fn-ball { animation-delay: 2.4s; }
.fn-ball-wrapper:nth-child(5) .fn-ball { animation-delay: 3.2s; }

@keyframes fnAmbientFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(0.8deg);
    }
    50% {
        transform: translateY(2px) rotate(-0.5deg);
    }
    75% {
        transform: translateY(-2px) rotate(0.5deg);
    }
}

/* Sphere Styling - High Contrast Luminous Pearl Glass */
.fn-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fff7e6 55%, #f3dfb0 100%);
    border: 1.8px solid rgba(200, 145, 26, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(77, 0, 32, 0.22), 
                inset 0 2px 4px #ffffff,
                inset 0 -2px 5px rgba(212, 175, 55, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.35s ease, 
                border-color 0.35s ease,
                background 0.35s ease;
}

/* Vector SVG Icon inside sphere */
.fn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4d0020; /* Deep Royal Maroon for high contrast on light ball */
    transition: transform 0.3s ease, color 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.fn-icon svg {
    width: 22px;
    height: 22px;
}

/* Hover State */
.fn-ball-wrapper:hover .fn-ball,
.fn-ball-wrapper:focus-visible .fn-ball {
    transform: scale(1.14) rotate(4deg) !important;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fff0cc 50%, #ebd085 100%);
    border-color: #d4af37;
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.75), 
                0 12px 28px rgba(77, 0, 32, 0.35),
                inset 0 2px 4px #ffffff;
}

.fn-ball-wrapper:hover .fn-icon,
.fn-ball-wrapper:focus-visible .fn-icon {
    transform: scale(1.18);
    color: #2a0011;
}

/* Active Category Sphere - Rich Royal Maroon with Brilliant Gold Icon */
.fn-ball-wrapper.active .fn-ball {
    width: 52px;
    height: 52px;
    border-color: #ffd700;
    background: radial-gradient(circle at 35% 35%, #5e0027 0%, #3d001a 60%, #24000f 100%);
    box-shadow: 0 0 28px rgba(255, 215, 0, 0.9), 
                0 0 50px rgba(212, 175, 55, 0.4), 
                inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

.fn-ball-wrapper.active .fn-icon {
    color: #ffd700; /* Pure Glowing Gold Icon */
    transform: scale(1.15);
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.95));
}

/* Active Breathing Gold Outer Ring */
.fn-ball-wrapper.active .fn-ball::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.8px solid #ffd700;
    animation: fnBreathingRing 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes fnBreathingRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: scale(1.18);
        opacity: 0.3;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    }
}

/* --------------------------------------------------------------------------
   3. FLOATING NAV TOOLTIP LABELS
   -------------------------------------------------------------------------- */
.fn-label {
    position: absolute;
    left: 64px;
    background: rgba(42, 0, 17, 0.95);
    color: #fff8eb;
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-12px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(212, 175, 55, 0.25);
}

.fn-label::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: rgba(42, 0, 17, 0.95);
    border-left: 1px solid rgba(212, 175, 55, 0.5);
    border-bottom: 1px solid rgba(212, 175, 55, 0.5);
}

.fn-ball-wrapper:hover .fn-label,
.fn-ball-wrapper:focus-visible .fn-label {
    opacity: 1;
    transform: translateX(0);
}

/* Active Label Indicator Glow */
.fn-ball-wrapper.active .fn-label {
    border-color: rgba(255, 215, 0, 0.8);
    color: #ffd700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 215, 0, 0.4);
}

/* --------------------------------------------------------------------------
   4. TOP CATEGORY CARDS 3D TILT INTERACTION
   -------------------------------------------------------------------------- */
.snh-grid {
    perspective: 1000px;
}

.snh-card {
    transform-style: preserve-3d;
    transition: transform 0.18s ease-out, box-shadow 0.35s ease, border-color 0.35s ease;
    will-change: transform;
}

.snh-card .snh-icon-badge {
    transform: translateZ(24px);
    transition: transform 0.2s ease-out;
}

.snh-card .snh-card-info {
    transform: translateZ(14px);
    transition: transform 0.2s ease-out;
}

.snh-card .snh-indicator {
    transform: translateZ(10px);
}

.snh-card .snh-card-glow {
    transform: translateZ(4px);
}

/* --------------------------------------------------------------------------
   5. GPU-ACCELERATED CATEGORY PANE SWITCHING TRANSITIONS
   -------------------------------------------------------------------------- */
.syllabus-category-pane {
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, filter;
}

.syllabus-category-pane.pane-hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(25px);
    filter: blur(8px);
}

.syllabus-category-pane.pane-exiting {
    display: block !important;
    opacity: 0 !important;
    transform: translateY(30px) !important;
    filter: blur(8px) !important;
    pointer-events: none;
}

.syllabus-category-pane.pane-entering {
    display: block !important;
    opacity: 0;
    transform: translateY(-20px);
    filter: blur(8px);
}

.syllabus-category-pane.pane-active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
}

/* --------------------------------------------------------------------------
   6. RESPONSIVE BREAKPOINTS (TABLET & MOBILE DOCK)
   -------------------------------------------------------------------------- */

/* Laptop & Medium Screens */
@media (min-width: 768px) and (max-width: 1024px) {
    .floating-nav-container {
        left: 14px;
    }

    .fn-ball {
        width: 44px;
        height: 44px;
    }

    .fn-icon svg {
        width: 20px;
        height: 20px;
    }

    .fn-label {
        left: 56px;
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* Mobile iOS-Style Bottom Floating Glass Dock */
@media (max-width: 767px) {
    .floating-nav-container {
        left: 50%;
        top: auto;
        bottom: 16px;
        transform: translateX(-50%) translateY(90px);
        flex-direction: row;
        background: rgba(42, 0, 17, 0.92);
        border: 1.5px solid rgba(212, 175, 55, 0.5);
        padding: 8px 14px;
        border-radius: 40px;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 15px rgba(212, 175, 55, 0.25);
    }

    .floating-nav-container.visible {
        transform: translateX(-50%) translateY(0);
    }

    .fn-progress-track {
        display: none;
    }

    .fn-balls-list {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        justify-content: center;
    }

    .fn-ball-wrapper {
        margin: 0;
    }

    .fn-ball {
        width: 42px;
        height: 42px;
    }

    .fn-icon svg {
        width: 19px;
        height: 19px;
    }

    /* Tooltip above balls on mobile */
    .fn-label {
        left: 50%;
        top: -42px;
        bottom: auto;
        transform: translateX(-50%) translateY(6px);
        font-size: 11px;
        padding: 4px 10px;
    }

    .fn-label::before {
        left: 50%;
        top: auto;
        bottom: -5px;
        transform: translateX(-50%) rotate(45deg);
        border-left: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.5);
        border-right: 1px solid rgba(212, 175, 55, 0.5);
        border-top: none;
    }

    .fn-ball-wrapper:hover .fn-label,
    .fn-ball-wrapper:focus-visible .fn-label {
        transform: translateX(-50%) translateY(0);
    }
}

/* --------------------------------------------------------------------------
   7. ACCESSIBILITY - REDUCED MOTION PREFERENCE
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .floating-nav-container,
    .fn-ball-wrapper .fn-ball,
    .snh-card,
    .syllabus-category-pane {
        animation: none !important;
        transition: opacity 0.2s ease !important;
        transform: none !important;
    }
    
    .fn-ball-wrapper.active .fn-ball::before {
        animation: none !important;
    }
}
