/* ═══════════════════════════════════════════════════════════════
   PHOENIX RISING — EXECUTIVE UX ENHANCEMENTS
   Gold Standard UI/UX Polish Layer

   This file adds premium interactions without touching architecture.
   Include AFTER all other stylesheets.
═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   1. PAGE TRANSITIONS — Smooth fade-in on load
═══════════════════════════════════════════════════════════════ */
body {
    opacity: 0;
    animation: pageReveal 0.6s ease-out 0.1s forwards;
}

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

/* ═══════════════════════════════════════════════════════════════
   2. PARALLAX HERO IMAGES
═══════════════════════════════════════════════════════════════ */
.programme-hero-image {
    transition: transform 0.3s ease-out !important;
    will-change: transform;
}

.parallax-hero {
    overflow: hidden;
    position: relative;
}

.parallax-hero .programme-hero-image {
    transform: scale(1.05);
    object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════════
   3. MICRO-INTERACTIONS — Buttons, Cards, Inputs
═══════════════════════════════════════════════════════════════ */

/* Gold ripple effect on button click */
button, .footer-btn, .btn-primary, .btn-secondary,
.step-complete-btn, .cp-resume-btn, .cp-duration-btn {
    position: relative;
    overflow: hidden;
}

button::after, .footer-btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

button:active::after, .footer-btn:active::after {
    width: 300px; height: 300px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

/* Card lift on hover */
.ava-story-card,
.practice-card,
.scenario-card,
.data-card,
.action-item,
.growth-card,
.level-card,
.principle {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ava-story-card:hover,
.practice-card:hover,
.scenario-card:hover,
.data-card:hover,
.action-item:hover,
.growth-card:hover,
.level-card:hover {
    transform: translateY(-4px) !important;
    box-shadow:
        0 12px 40px rgba(45, 27, 105, 0.12),
        0 4px 16px rgba(212, 175, 55, 0.08) !important;
}

/* Input focus glow */
input:focus,
textarea:focus,
select:focus {
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
    outline: none !important;
    transition: all 0.3s ease !important;
}

/* Success pulse on save buttons */
@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(45, 106, 79, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(45, 106, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 106, 79, 0); }
}

.save-success {
    animation: successPulse 0.8s ease-out !important;
    background: #2D6A4F !important;
    color: white !important;
}

/* ═══════════════════════════════════════════════════════════════
   4. SCROLL-TRIGGERED REVEALS — Staggered timing
═══════════════════════════════════════════════════════════════ */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════════
   5. ANIMATED PHOENIX LOGO — Breathing glow
═══════════════════════════════════════════════════════════════ */
.nav-logo, .footer-logo {
    animation: phoenixBreathe 4s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
}

@keyframes phoenixBreathe {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
        transform: scale(1.03);
    }
}

/* ═══════════════════════════════════════════════════════════════
   6. KINETIC TYPOGRAPHY — Quote word reveal
═══════════════════════════════════════════════════════════════ */
.kinetic-quote .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.kinetic-quote.animate .word {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger each word */
.kinetic-quote .word:nth-child(1) { transition-delay: 0.05s; }
.kinetic-quote .word:nth-child(2) { transition-delay: 0.1s; }
.kinetic-quote .word:nth-child(3) { transition-delay: 0.15s; }
.kinetic-quote .word:nth-child(4) { transition-delay: 0.2s; }
.kinetic-quote .word:nth-child(5) { transition-delay: 0.25s; }
.kinetic-quote .word:nth-child(6) { transition-delay: 0.3s; }
.kinetic-quote .word:nth-child(7) { transition-delay: 0.35s; }
.kinetic-quote .word:nth-child(8) { transition-delay: 0.4s; }
.kinetic-quote .word:nth-child(9) { transition-delay: 0.45s; }
.kinetic-quote .word:nth-child(10) { transition-delay: 0.5s; }
.kinetic-quote .word:nth-child(11) { transition-delay: 0.55s; }
.kinetic-quote .word:nth-child(12) { transition-delay: 0.6s; }
.kinetic-quote .word:nth-child(13) { transition-delay: 0.65s; }
.kinetic-quote .word:nth-child(14) { transition-delay: 0.7s; }
.kinetic-quote .word:nth-child(15) { transition-delay: 0.75s; }

/* ═══════════════════════════════════════════════════════════════
   7. JOURNEY PROGRESS BAR — Top of page
═══════════════════════════════════════════════════════════════ */
.journey-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10001;
    background: rgba(45, 27, 105, 0.1);
    pointer-events: none;
}

.journey-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #512DA8, #D4AF37);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   8. ADINKRA HOVER TOOLTIPS
═══════════════════════════════════════════════════════════════ */
.adinkra-divider {
    position: relative;
    cursor: pointer;
}

.adinkra-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: 8px 14px;
    background: linear-gradient(135deg, #2D1B69, #512DA8);
    color: white;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 16px rgba(45, 27, 105, 0.2);
    z-index: 100;
}

.adinkra-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #512DA8;
}

.adinkra-divider:hover .adinkra-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ═══════════════════════════════════════════════════════════════
   9. DARK MODE
═══════════════════════════════════════════════════════════════ */
.dark-mode-toggle {
    position: fixed;
    top: 70px;
    left: 1rem;
    z-index: 9998;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(248, 246, 250, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.dark-mode-toggle:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(180deg, #0a0612 0%, #1a0f3d 100%) !important;
    background-attachment: fixed !important;
    color: rgba(248, 246, 250, 0.9) !important;
}

body.dark-mode .nav-header {
    background: rgba(10, 6, 18, 0.95) !important;
}

body.dark-mode .content-section,
body.dark-mode .section-intro,
body.dark-mode .section-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3 {
    color: rgba(248, 246, 250, 0.95) !important;
}

body.dark-mode .ava-story-card,
body.dark-mode .practice-card,
body.dark-mode .scenario-card,
body.dark-mode .data-card {
    background: rgba(45, 27, 105, 0.4) !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

body.dark-mode .step-instruction,
body.dark-mode .section-intro,
body.dark-mode p {
    color: rgba(248, 246, 250, 0.8) !important;
}

body.dark-mode .programme-hero-image {
    opacity: 0.85;
    filter: brightness(0.85);
}

body.dark-mode .image-reflection-caption {
    background: rgba(45, 27, 105, 0.6) !important;
    color: rgba(248, 246, 250, 0.85) !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

body.dark-mode .site-footer {
    background: rgba(10, 6, 18, 0.95) !important;
}

body.dark-mode .lesson-hero,
body.dark-mode .graduation-hero {
    background: linear-gradient(180deg, #0a0612 0%, #1a0f3d 100%) !important;
}

body.dark-mode .dark-mode-toggle {
    background: rgba(45, 27, 105, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-mode .adinkra-icon {
    filter: brightness(3) drop-shadow(0 0 6px rgba(212, 175, 55, 0.4)) !important;
}

body.dark-mode .transcript-text,
body.dark-mode .audio-player {
    background: rgba(45, 27, 105, 0.3) !important;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: rgba(45, 27, 105, 0.3) !important;
    color: rgba(248, 246, 250, 0.9) !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

/* ═══════════════════════════════════════════════════════════════
   10. GOLD PARTICLE AMBIENT EFFECT
═══════════════════════════════════════════════════════════════ */
.gold-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gold-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #D4AF37;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat var(--duration, 12s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) translateX(0);
    }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% {
        opacity: 0;
        transform: translateY(-20px) translateX(var(--drift, 30px));
    }
}

/* ═══════════════════════════════════════════════════════════════
   11. SMOOTH SCROLL PROGRESS INDICATOR
═══════════════════════════════════════════════════════════════ */
.scroll-progress {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 2px;
    z-index: 9997;
    margin-right: 4px;
}

.scroll-progress-fill {
    width: 100%;
    background: linear-gradient(180deg, #512DA8, #D4AF37);
    border-radius: 2px;
    transition: height 0.1s linear;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   12. GRADUATION CONFETTI ENHANCEMENT
═══════════════════════════════════════════════════════════════ */
@keyframes confettiRain {
    0% {
        opacity: 1;
        transform: translateY(-10vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(110vh) rotate(720deg);
    }
}

.confetti-piece {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    animation: confettiRain var(--fall-time, 4s) ease-in forwards;
    animation-delay: var(--delay, 0s);
}

/* ═══════════════════════════════════════════════════════════════
   13. PREMIUM LINK UNDERLINE ANIMATION
═══════════════════════════════════════════════════════════════ */
.footer-links a,
.section-intro a {
    position: relative;
    text-decoration: none !important;
}

.footer-links a::after,
.section-intro a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #D4AF37;
    transition: width 0.3s ease;
}

.footer-links a:hover::after,
.section-intro a:hover::after {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   14. ACCESSIBILITY — Respect Reduced Motion
═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    body {
        animation: none !important;
        opacity: 1 !important;
    }

    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .nav-logo, .footer-logo {
        animation: none !important;
    }

    .gold-particle {
        animation: none !important;
        display: none !important;
    }

    .kinetic-quote .word {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    button::after, .footer-btn::after {
        display: none !important;
    }

    .programme-hero-image {
        transition: none !important;
    }

    .confetti-piece {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   15. MOBILE ADJUSTMENTS
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .dark-mode-toggle {
        top: auto;
        bottom: 14rem;
        left: 0.5rem;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .scroll-progress {
        display: none;
    }

    .gold-particles {
        display: none;
    }

    .journey-progress-bar {
        height: 2px;
    }
}
