/* ============================================
   THOTH.AI - Advanced Background Animation
   Hieroglyphs & Coptic Script Floating Effect
   ============================================ */

/* === CUSTOM FONTS === */
@font-face {
    font-family: 'Antinoou';
    src: url('../fonts/antinoou-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'EgyptianHiero';
    src: url('../fonts/EgyptianHiero4.03.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === ENHANCED BACKGROUND === */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at top left, rgba(14, 116, 144, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at top right, rgba(109, 40, 217, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, rgba(180, 83, 9, 0.12) 0%, transparent 60%),
        linear-gradient(135deg, #E0F2FE 0%, #FEF3C7 50%, #F3E8FF 100%);
    overflow: hidden;
    transition: background 0.3s ease;
}

:root[data-theme="dark"] .bg-animation {
    background: 
        radial-gradient(ellipse at top left, rgba(34, 211, 238, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at top right, rgba(167, 139, 250, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, rgba(252, 211, 77, 0.12) 0%, transparent 60%),
        #0A1628;
}

/* Particle Canvas - Enhanced */
#particleCanvas {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}\n\n:root[data-theme=\"dark\"] #particleCanvas {
    opacity: 0.7;
}

/* === HIEROGLYPH & COPTIC CONTAINER === */
.hieroglyph-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Hieroglyphs - Using EgyptianHiero Font */
.hieroglyph {
    position: absolute;
    font-family: 'EgyptianHiero', serif;
    font-size: 72px;
    color: #0369A1;
    opacity: 0;
    pointer-events: none;
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(3, 105, 161, 1),
        0 0 40px rgba(3, 105, 161, 0.8),
        0 0 60px rgba(3, 105, 161, 0.5);
    animation: floatHieroglyph 38s infinite ease-in-out;
    font-weight: 900;
    filter: drop-shadow(0 0 12px rgba(3, 105, 161, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

:root[data-theme="dark"] .hieroglyph {
    color: #22D3EE;
    text-shadow: 
        0 0 5px rgba(0, 0, 0, 1),
        0 0 25px rgba(34, 211, 238, 1),
        0 0 50px rgba(34, 211, 238, 0.9),
        0 0 75px rgba(34, 211, 238, 0.6);
    filter: drop-shadow(0 0 15px rgba(34, 211, 238, 1));
}



/* Coptic Characters - Using Antinoou Font */
.coptic-char {
    position: absolute;
    font-family: 'Antinoou', serif;
    font-size: 66px;
    color: #DC2626;
    opacity: 0;
    pointer-events: none;
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(220, 38, 38, 1),
        0 0 40px rgba(220, 38, 38, 0.8),
        0 0 60px rgba(220, 38, 38, 0.5);
    animation: floatCoptic 30s infinite ease-in-out;
    font-weight: 900;
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

:root[data-theme="dark"] .coptic-char {
    color: #FBBF24;
    text-shadow: 
        0 0 5px rgba(0, 0, 0, 1),
        0 0 25px rgba(251, 191, 36, 1),
        0 0 50px rgba(251, 191, 36, 0.9),
        0 0 75px rgba(251, 191, 36, 0.6);
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 1));
}



/* === FLOATING ANIMATIONS === */
@keyframes floatHieroglyph {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-30vh) translateX(30px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatCoptic {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.9;
    }
    85% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-30vh) translateX(-30px) rotate(-360deg);
        opacity: 0;
    }
}

/* === SPECIAL VARIANTS === */
.hieroglyph.variant-1 {
    animation: floatHieroglyphVariant1 45s infinite ease-in-out;
    font-size: 76px;
}

:root .hieroglyph.variant-1 {
    color: #059669;
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 25px rgba(5, 150, 105, 1),
        0 0 50px rgba(5, 150, 105, 0.9),
        0 0 75px rgba(5, 150, 105, 0.6);
    filter: drop-shadow(0 0 15px rgba(5, 150, 105, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

:root[data-theme="dark"] .hieroglyph.variant-1 {
    color: #00FFC6;
    text-shadow: 
        0 0 3px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(0, 255, 198, 1),
        0 0 50px rgba(0, 255, 198, 0.9),
        0 0 75px rgba(0, 255, 198, 0.6);
    filter: drop-shadow(0 0 12px rgba(0, 255, 198, 1));
}



.hieroglyph.variant-2 {
    animation: floatHieroglyphVariant2 33s infinite ease-in-out;
    font-size: 74px;
}

:root .hieroglyph.variant-2 {
    color: #7C3AED;
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 25px rgba(124, 58, 237, 1),
        0 0 50px rgba(124, 58, 237, 0.9),
        0 0 75px rgba(124, 58, 237, 0.6);
    filter: drop-shadow(0 0 15px rgba(124, 58, 237, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

:root[data-theme="dark"] .hieroglyph.variant-2 {
    color: #5DFDCB;
    text-shadow: 
        0 0 3px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(93, 253, 203, 1),
        0 0 50px rgba(93, 253, 203, 0.9),
        0 0 75px rgba(93, 253, 203, 0.6);
    filter: drop-shadow(0 0 12px rgba(93, 253, 203, 1));
}



.coptic-char.variant-1 {
    animation: floatCopticVariant1 27s infinite ease-in-out;
    font-size: 70px;
}

:root .coptic-char.variant-1 {
    color: #D97706;
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 25px rgba(217, 119, 6, 1),
        0 0 50px rgba(217, 119, 6, 0.9),
        0 0 75px rgba(217, 119, 6, 0.6);
    filter: drop-shadow(0 0 15px rgba(217, 119, 6, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

:root[data-theme="dark"] .coptic-char.variant-1 {
    color: #FF8C00;
    text-shadow: 
        0 0 3px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(255, 140, 0, 1),
        0 0 50px rgba(255, 140, 0, 0.9),
        0 0 75px rgba(255, 140, 0, 0.6);
    filter: drop-shadow(0 0 12px rgba(255, 140, 0, 1));
}



.coptic-char.variant-2 {
    animation: floatCopticVariant2 36s infinite ease-in-out;
    font-size: 68px;
}

:root .coptic-char.variant-2 {
    color: #DB2777;
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 25px rgba(219, 39, 119, 1),
        0 0 50px rgba(219, 39, 119, 0.9),
        0 0 75px rgba(219, 39, 119, 0.6);
    filter: drop-shadow(0 0 15px rgba(219, 39, 119, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

:root[data-theme="dark"] .coptic-char.variant-2 {
    color: #FF1493;
    text-shadow: 
        0 0 3px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(255, 20, 147, 1),
        0 0 50px rgba(255, 20, 147, 0.9),
        0 0 75px rgba(255, 20, 147, 0.6);
    filter: drop-shadow(0 0 12px rgba(255, 20, 147, 1));
}



@keyframes floatHieroglyphVariant1 {
    0% {
        transform: translateY(110vh) translateX(50px) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.9;
    }
    85% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-30vh) translateX(-40px) rotate(450deg);
        opacity: 0;
    }
}

@keyframes floatHieroglyphVariant2 {
    0% {
        transform: translateY(110vh) translateX(-40px) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-30vh) translateX(50px) rotate(-420deg);
        opacity: 0;
    }
}

@keyframes floatCopticVariant1 {
    0% {
        transform: translateY(110vh) translateX(-50px) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.9;
    }
    85% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-30vh) translateX(40px) rotate(390deg);
        opacity: 0;
    }
}

@keyframes floatCopticVariant2 {
    0% {
        transform: translateY(110vh) translateX(40px) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-30vh) translateX(-50px) rotate(-480deg);
        opacity: 0;
    }
}

/* === SPIRAL ANIMATION === */
.hieroglyph.spiral {
    animation: spiralFloat 53s infinite ease-in-out;
}

.coptic-char.spiral {
    animation: spiralFloatCoptic 42s infinite ease-in-out;
}

@keyframes spiralFloat {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(60vh) translateX(60px) rotate(120deg);
    }
    50% {
        transform: translateY(30vh) translateX(-60px) rotate(240deg);
    }
    75% {
        transform: translateY(0vh) translateX(60px) rotate(360deg);
    }
    85% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-30vh) translateX(-30px) rotate(480deg);
        opacity: 0;
    }
}

@keyframes spiralFloatCoptic {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.85;
    }
    25% {
        transform: translateY(65vh) translateX(-50px) rotate(-100deg);
    }
    50% {
        transform: translateY(35vh) translateX(50px) rotate(-200deg);
    }
    75% {
        transform: translateY(5vh) translateX(-50px) rotate(-300deg);
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-30vh) translateX(30px) rotate(-420deg);
        opacity: 0;
    }
}

/* === WAVE ANIMATION === */
.hieroglyph.wave {
    animation: waveFloat 39s infinite ease-in-out;
}

.coptic-char.wave {
    animation: waveFloatCoptic 35s infinite ease-in-out;
}

@keyframes waveFloat {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(70vh) translateX(80px) rotate(90deg);
    }
    50% {
        transform: translateY(40vh) translateX(-80px) rotate(180deg);
    }
    75% {
        transform: translateY(10vh) translateX(80px) rotate(270deg);
    }
    85% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-30vh) translateX(-40px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes waveFloatCoptic {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    2% {
        opacity: 0.85;
    }
    25% {
        transform: translateY(72vh) translateX(-70px) rotate(-80deg);
    }
    50% {
        transform: translateY(42vh) translateX(70px) rotate(-160deg);
    }
    75% {
        transform: translateY(12vh) translateX(-70px) rotate(-240deg);
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-30vh) translateX(40px) rotate(-360deg);
        opacity: 0;
    }
}

/* === GRADIENT OVERLAY === */
.bg-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            circle at 20% 80%,
            rgba(0, 217, 255, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 184, 0, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 50% 50%,
            rgba(168, 85, 247, 0.05) 0%,
            transparent 70%
        );
    pointer-events: none;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* === RANDOM GLOW & SCALE ANIMATIONS === */
/* Super glow for special character - much bigger and brighter */
@keyframes superGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px currentColor) drop-shadow(0 0 5px rgba(255, 255, 255, 1));
        z-index: 100;
    }
    50% {
        transform: scale(2.2);
        filter: drop-shadow(0 0 80px currentColor) 
                drop-shadow(0 0 120px currentColor) 
                drop-shadow(0 0 160px currentColor)
                drop-shadow(0 0 30px rgba(255, 255, 255, 1));
        z-index: 100;
    }
}

@keyframes superGlowDark {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px currentColor);
        z-index: 100;
    }
    50% {
        transform: scale(2.2);
        filter: drop-shadow(0 0 90px currentColor) 
                drop-shadow(0 0 150px currentColor) 
                drop-shadow(0 0 200px currentColor);
        z-index: 100;
    }
}

@keyframes randomGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px currentColor) drop-shadow(0 0 3px rgba(255, 255, 255, 1));
    }
    50% {
        transform: scale(1.4);
        filter: drop-shadow(0 0 35px currentColor) 
                drop-shadow(0 0 70px currentColor) 
                drop-shadow(0 0 15px rgba(255, 255, 255, 1));
    }
}

@keyframes randomGlowDark {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px currentColor);
    }
    50% {
        transform: scale(1.4);
        filter: drop-shadow(0 0 40px currentColor) 
                drop-shadow(0 0 80px currentColor);
    }
}

/* Special super glow for one character */
.hieroglyph.super-glow, .coptic-char.super-glow {
    animation: floatHieroglyph 38s infinite ease-in-out, superGlow 7s infinite ease-in-out;
    animation-delay: 0s, 1s;
    position: relative;
    z-index: 100;
}

:root[data-theme="dark"] .hieroglyph.super-glow,
:root[data-theme="dark"] .coptic-char.super-glow {
    animation: floatHieroglyph 38s infinite ease-in-out, superGlowDark 7s infinite ease-in-out;
    animation-delay: 0s, 1s;
}

/* Apply random glow animations with different delays */
.hieroglyph.glow-1, .coptic-char.glow-1 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlow 4s infinite ease-in-out;
    animation-delay: 0s, 0.5s;
}

.hieroglyph.glow-2, .coptic-char.glow-2 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlow 5s infinite ease-in-out;
    animation-delay: 0s, 2s;
}

.hieroglyph.glow-3, .coptic-char.glow-3 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlow 4.5s infinite ease-in-out;
    animation-delay: 0s, 3.5s;
}

.hieroglyph.glow-4, .coptic-char.glow-4 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlow 6s infinite ease-in-out;
    animation-delay: 0s, 1s;
}

.hieroglyph.glow-5, .coptic-char.glow-5 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlow 5.5s infinite ease-in-out;
    animation-delay: 0s, 4s;
}

/* Dark mode versions */
:root[data-theme="dark"] .hieroglyph.glow-1,
:root[data-theme="dark"] .coptic-char.glow-1 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlowDark 4s infinite ease-in-out;
    animation-delay: 0s, 0.5s;
}

:root[data-theme="dark"] .hieroglyph.glow-2,
:root[data-theme="dark"] .coptic-char.glow-2 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlowDark 5s infinite ease-in-out;
    animation-delay: 0s, 2s;
}

:root[data-theme="dark"] .hieroglyph.glow-3,
:root[data-theme="dark"] .coptic-char.glow-3 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlowDark 4.5s infinite ease-in-out;
    animation-delay: 0s, 3.5s;
}

:root[data-theme="dark"] .hieroglyph.glow-4,
:root[data-theme="dark"] .coptic-char.glow-4 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlowDark 6s infinite ease-in-out;
    animation-delay: 0s, 1s;
}

:root[data-theme="dark"] .hieroglyph.glow-5,
:root[data-theme="dark"] .coptic-char.glow-5 {
    animation: floatHieroglyph 38s infinite ease-in-out, randomGlowDark 5.5s infinite ease-in-out;
    animation-delay: 0s, 4s;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hieroglyph {
        font-size: 36px;
    }
    
    .coptic-char {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .hieroglyph {
        font-size: 28px;
    }
    
    .coptic-char {
        font-size: 24px;
    }
}