/* 
   Flyers Charitable Trust - Christmas Edition 2025 
   Theme: Festive Red, Gold & "Frosted Glass"
*/

:root {
    /* Christmas Palette */
    --color-bg-body: #0f172a;
    /* Midnight Blue for Night Sky feel */
    --color-bg-light: #1e293b;
    /* Darker Slate */
    --color-bg-glass: rgba(255, 255, 255, 0.1);
    /* Frosted Glass */

    --color-text-main: #f8fafc;
    /* Snow White */
    --color-text-muted: #cbd5e1;
    /* Off White */
    --color-text-light: #94a3b8;

    --color-primary: #d42426;
    /* Christmas Red */
    --color-primary-dark: #b91c1c;
    /* Darker Red */
    --color-accent: #f59e0b;
    /* Gold/Amber */
    --color-green: #165b33;
    /* Pine Green */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(212, 36, 38, 0.6);
    /* Red Glow */

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(22, 91, 51, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(212, 36, 38, 0.15), transparent 25%);
    scrollbar-width: auto;
    /* Revert to default */
    -ms-overflow-style: auto;
}

body::-webkit-scrollbar {
    display: block;
    /* Revert to default */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 5rem 0;
    position: relative;
    z-index: 10;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(212, 36, 38, 0.4);
}

.text-accent {
    color: var(--color-accent);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.text-muted {
    color: var(--color-text-muted);
}

.bg-light {
    background-color: var(--color-bg-light);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(212, 36, 38, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(212, 36, 38, 0.6);
    text-shadow: 0 0 5px white;
}

.btn-outline {
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    background: transparent;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

.btn-outline:hover {
    background-color: var(--color-accent);
    color: #0f172a;
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.5);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    /* Dark translucent */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    color: var(--color-text-muted);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Hero Section */
.hero {
    padding-top: 10rem;
    padding-bottom: 6rem;
    background: radial-gradient(circle at 50% 10%, #1e293b 0%, #0f172a 80%);
    position: relative;
    overflow: hidden;
    text-align: left;
    /* Default */
}

/* Cards - Frosted Glass & 3D */
.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);

    /* 3D Properties */
    transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-glow), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.card h3,
.card h2,
.card h4 {
    color: white;
}

/* Icons in Cards */
.card i {
    text-shadow: 0 0 15px currentColor;
}

/* Feature Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    align-items: center;
}

/* Footer */
footer {
    background-color: #020617;
    /* Very Dark Blue */
    padding: 4rem 0 2rem;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-link {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--color-text-muted);
    transition: color 0.2s, padding-left 0.2s;
}

.footer-link:hover {
    color: var(--color-accent);
    padding-left: 5px;
    text-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.fade-up {
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(40px);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Snowfall Canvas */
#snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Behind content but in front of background color */
    pointer-events: none;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px white, 0 0 20px var(--color-accent);
    mix-blend-mode: difference;
}

.cursor-follower {
    position: fixed;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background 0.3s;
    /* backdrop-filter: blur(2px); REMOVED for readability */
    mix-blend-mode: difference;
    background: rgba(255, 255, 255, 0.1);
}

.custom-cursor.active {
    width: 4px;
    height: 4px;
}

.cursor-follower.active {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

/* Mobile Navigation */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
    /* Above mobile nav */
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-main);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Toggle Animation */
.hamburger.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.toggle .line2 {
    opacity: 0;
}

.hamburger.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}


/* Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: flex;
        /* Override display: none */
        position: fixed;
        right: 0px;
        top: 0px;
        height: 100vh;
        width: 70%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .nav-links li {
        margin: 1.5rem 0;
        opacity: 0;
        animation: navLinkFade 0.5s ease forwards 0.3s;
    }

    .hamburger {
        display: block;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero {
        text-align: center;
        padding-top: 8rem;
    }

    .hero h1 {
        font-size: 2.2rem !important;
        /* Slightly smaller for better fit */
        padding: 0 10px;
    }

    .hero p {
        font-size: 1rem !important;
        padding: 0 15px;
    }

    .card {
        padding: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .floating-character {
        display: none;
        /* Keep hidden to assume performance/clutter */
    }

    .actions {
        display: none;
        /* Hide 'Donate Now' button in header if tight on space, or move it */
    }
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Floating 3D Characters */
.floating-character {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    animation: floatCharacter 6s ease-in-out infinite;
}

@keyframes floatCharacter {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.char-santa {
    top: 15%;
    right: 5%;
    width: 250px;
    animation-delay: 0s;
}

.char-reindeer {
    bottom: 10px;
    right: 10px;
    width: 150px;
    animation-delay: 1s;
}

.char-gift {
    top: 20%;
    left: 10%;
    width: 180px;
    animation-delay: 2s;
}

.char-snowman {
    bottom: 20px;
    left: 20px;
    width: 140px;
    animation-delay: 1.5s;
}

/* Social Media Brand Colors */
.fa-facebook,
.fa-facebook-f {
    color: #1877F2 !important;
}

.fa-instagram {
    color: #E1306C !important;
}

.fa-twitter {
    color: #1DA1F2 !important;
}

.fa-youtube {
    color: #FF0000 !important;
}

/* Hover effects for social links */
.footer-grid a:hover .fa-facebook,
.footer-grid a:hover .fa-facebook-f {
    text-shadow: 0 0 10px rgba(24, 119, 242, 0.6);
}

.footer-grid a:hover .fa-instagram {
    text-shadow: 0 0 10px rgba(225, 48, 108, 0.6);
}

.footer-grid a:hover .fa-twitter {
    text-shadow: 0 0 10px rgba(29, 161, 242, 0.6);
}

.fa-linkedin {
    color: #0a66c2 !important;
}

.footer-grid a:hover .fa-linkedin {
    text-shadow: 0 0 10px rgba(10, 102, 194, 0.6);
}

/* Santa Swarm (8-Frame Horizontal Strip) */
.santa-swarm-unit {
    position: fixed;
    left: -400px;
    width: 250px;
    height: 150px;
    background-image: url('assets/santa_sprite_sheet_optimized.png');
    /* Assuming the model generated a 2x4 grid since it usually does for 8 frames */
    background-size: 200% 400%;
    z-index: 1;
    /* Low Z-index to be behind navbar but visible */
    pointer-events: none;
    mix-blend-mode: screen;
    /* Hides pure black bg */
    /* filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); REMOVED */
    opacity: 0.9;

    animation:
        flySwarm linear infinite,
        spriteCycle 0.8s steps(1) infinite;
}

@keyframes flySwarm {
    0% {
        transform: translateX(-400px) translateY(0);
    }

    100% {
        transform: translateX(120vw) translateY(20px);
    }
}

/* 2x4 Grid Animation Cycle (Left->Right, Top->Bottom) */
@keyframes spriteCycle {
    0% {
        background-position: 0 0;
    }

    12.5% {
        background-position: 100% 0;
    }

    25% {
        background-position: 0 33.333%;
    }

    37.5% {
        background-position: 100% 33.333%;
    }

    50% {
        background-position: 0 66.666%;
    }

    62.5% {
        background-position: 100% 66.666%;
    }

    75% {
        background-position: 0 100%;
    }

    87.5% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0 0;
    }
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .santa-swarm-unit {
        width: 150px;
        height: 90px;
        animation-duration: 8s;
    }
}

/* Music Toggle Switch */
.music-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.music-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    background: var(--color-accent);
    color: #fff;
}

.music-toggle.playing {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    animation: pulseMusic 2s infinite;
}

@keyframes pulseMusic {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 36, 38, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(212, 36, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 36, 38, 0);
    }
}

/* --- Welcome Gate Overlay --- */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    /* Dark Midnight */
    backdrop-filter: blur(15px);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.welcome-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(212, 36, 38, 0.8);
}

.welcome-content p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

.btn-enter {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(212, 36, 38, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-enter:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 36, 38, 0.8);
}

.welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- Guided Tour Tooltips --- */
.tour-tooltip {
    position: fixed;
    background: white;
    color: var(--color-bg-body);
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    max-width: 250px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.tour-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tour-tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
}

/* Specific Tooltip Positions */
.tooltip-music {
    bottom: 80px;
    left: 20px;
}

.tooltip-music::after {
    bottom: -10px;
    left: 20px;
    border-top: 10px solid white;
}

.tooltip-chatbot {
    bottom: 100px;
    right: 20px;
}

.tooltip-chatbot::after {
    bottom: -10px;
    right: 20px;
    border-top: 10px solid white;
}