@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@600;800&display=swap');

/* --- THEME SYSTEM --- */
:root {
    --primary-gradient: linear-gradient(135deg, #0071BB, #f4f27f);
    --accent-color: #facc15; /* Yellow-400 */
    --accent-text: #1e3a8a;   /* Blue-900 */
}

body.theme-cny {
    --primary-gradient: linear-gradient(135deg, #b91c1c, #fde047);
    --accent-color: #fbbf24;
    --accent-text: #7f1d1d;
}

body.theme-raya {
    --primary-gradient: linear-gradient(135deg, #065f46, #fbbf24);
    --accent-color: #fbbf24;
    --accent-text: #064e3b;
}

/* Deepavali: Purple to Orange (Oil Lamp vibes) */
body.theme-deepavali {
    --primary-gradient: linear-gradient(135deg, #4c1d95, #f97316);
    --accent-color: #fbbf24;
    --accent-text: #4c1d95;
}

/* Christmas: Deep Red to Forest Green */
body.theme-christmas {
    --primary-gradient: linear-gradient(135deg, #b91c1c, #065f46);
    --accent-color: #f7a6a6;
    --accent-text: #b91c1c;
}

/* Eid al-Adha: Emerald to Sky Blue (Sacrifice/Purity vibes) */
body.theme-adha {
    --primary-gradient: linear-gradient(135deg, #064e3b, #0ea5e9);
    --accent-color: #facc15;
    --accent-text: #064e3b;
}

body {
    background: var(--primary-gradient);
    transition: background 1s ease;
    background-attachment: fixed;
}

/* Base settings for the corner elements */
body::before, body::after {
    position: fixed;
    z-index: 60;
    pointer-events: none;
    font-size: 100px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
    transition: all 1s ease-in-out;
    display: none;
}

/* =========================
   🌙 RAYA DECOR
========================= */
body.theme-raya::before {
    content: url("../deco/2.png"); 
    display: block;
    top: -10px;
    left: 0px;
    transform: rotate(-15deg);
    animation: swing 3s ease-in-out infinite;
}
body.theme-raya::after {
    content: url("../deco/1.png");
    display: block;
    top: -10px;
    right: 0px;
    transform: scaleX(-1) rotate(15deg);
    animation: swing 3s ease-in-out infinite;
}

/* =========================
   🧧 CNY DECOR
========================= */
body.theme-cny::before {
    content: url("../deco/cny1.png");
    display: block;
    top: 90px;
    left: 20px;
    animation: swing 3s ease-in-out infinite;
}
body.theme-cny::after {
    content: url("../deco/cny2.png");
    display: block;
    top: 90px;
    right: 20px;
    animation: swing 3.5s ease-in-out infinite;
}

/* =========================
   🪔 DEEPAVALI DECOR
========================= */
body.theme-deepavali::before {
    content: url("../deco/d2.png");
    display: block;
    top: -20px;
    left: -40px;
    animation: swing 3s ease-in-out infinite;
}
body.theme-deepavali::after {
    content: url("../deco/d1.png");
    display: block;
    top: -20px;
    right: -40px;
    animation: swing 3.5s ease-in-out infinite;
}

/* =========================
   🎄 CHRISTMAS DECOR
========================= */
body.theme-christmas::before {
    content: "";
    display: block;
    width: 150px;      
    height: 100vh;
    background-image: url("../deco/ch1.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: -100px;
    animation: slideInLeft 1s ease-out forwards;
}
body.theme-christmas::after {
    content: "";
    display: block;
    width: 150px;      
    height: 100vh;
    background-image: url("../deco/ch2.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: -100px;
    animation: slideInRight 1s ease-out forwards;
}
/* =========================
   🐑 EID ADHA DECOR
========================= */
body.theme-adha::before {
    content: url("../deco/adha2.png");
    display: block;
    top: -20px;
    left: -10px;
    animation: swing 4s ease-in-out infinite;
}
body.theme-adha::after {
    content: url("../deco/adha.png");
    display: block;
    top: -20px;
    right: -10px;
    animation: swing 3s ease-in-out infinite;
}

/* =========================
   📱 MOBILE RESPONSIVE
========================= */
@media (max-width: 768px) {

    body.theme-raya::before{
        left: 5px;
    }
    body.theme-cny::before{
        left: -15px;
        top: 100px;
    }
    body.theme-deepavali::before{
        left: -50px;
    }
    body.theme-christmas::before{
        width: 80px;
        height: 60vh;  
    }
    body.theme-adha::before{
        left: -20px;
    }

    body.theme-raya::after{
        right: 5px;
    }
    body.theme-cny::after{
        right: -15px;
        top: 100px;
    }
    body.theme-deepavali::after{
        right: -50px;
    }
    body.theme-christmas::after{
        width: 80px;
        height: 60vh;  
    }
    body.theme-adha::after{
        right: -20px;
    }

}

/* =========================
   📱 EXTRA SMALL DEVICES
========================= */
@media (max-width: 480px) {
    body::before, body::after {
        font-size: 40px;
    }
}

@keyframes slideInLeft {
    from {
        left: -150px;
        opacity: 0;
    }
    to {
        left: -5px;
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        right: -150px;
        opacity: 0;
    }
    to {
        right: 0;
        opacity: 1;
    }
}


/* Animation to make lanterns look realistic */
@keyframes swing {
    0%, 100% { transform: rotate(-5deg); transform-origin: top; }
    50% { transform: rotate(5deg); transform-origin: top; }
}

#fancy-text {
    font-family: 'Great Vibes', cursive;
    font-size: 80px;

    fill: none;
    stroke-width: 2;

    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;

    animation:
        drawText 2.5s ease forwards,
        glowPulse 2s ease-in-out infinite alternate,
        waveFloat 3s ease-in-out infinite;

    transform-origin: center;
}

#fancy-text.fade-out {
    animation:
        fadeOutText 5s ease forwards;
}

/* DRAW */
@keyframes drawText {
    to { stroke-dashoffset: 0; }
}

/* STRONG GLOW (neon style) */
@keyframes glowPulse {
    0% {
        filter:
            drop-shadow(0 0 5px rgba(255,255,255,0.3))
            drop-shadow(0 0 10px rgba(255,255,255,0.4));
    }
    100% {
        filter:
            drop-shadow(0 0 10px rgba(255,255,255,0.6))
            drop-shadow(0 0 20px rgba(255,255,255,0.8))
            drop-shadow(0 0 40px rgba(255,255,255,1));
    }
}

/* WAVE FLOAT (smooth up-down motion) */
@keyframes waveFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

@keyframes letterWave {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes fadeOutText {
    0% {
        opacity: 1;
        transform: translateY(0px) scale(1);
        filter:
            drop-shadow(0 0 10px rgba(255,255,255,0.6))
            drop-shadow(0 0 20px rgba(255,255,255,0.8))
            drop-shadow(0 0 40px rgba(255,255,255,1));
    }

    50% {
        opacity: 0.7;
        transform: translateY(10px) scale(0.95);
        filter:
            drop-shadow(0 0 5px rgba(255,215,0,0.5))
            drop-shadow(0 0 10px rgba(255,180,0,0.6));
    }

    100% {
        opacity: 0;
        transform: translateY(30px) scale(0.85);
        filter: blur(4px);
    }
}

/* COLOR THEMES */
.cny-text {
    stroke: url(#cnyGradient);
}

.raya-text {
    stroke: url(#rayaGradient);
}

.deepavali-text {
    stroke: url(#deepavaliGradient);
}

.christmas-text {
    stroke: url(#christmasGradient);
}

.adha-text {
    stroke: url(#adhaGradient);
}

/* Apply variables to existing components */
.text-yellow-400 { color: var(--accent-color) !important; }
.bg-yellow-400 { background-color: var(--accent-color) !important; }
.tab-active { 
    background: var(--accent-color) !important; 
    color: var(--accent-text) !important; 
}

/* Theme Toggle Container (Hidden by default) */
#dev-theme-switcher {
    display: none;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    width: max-content;
}

/* FIX blur seam issue */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border: 1px solid rgba(255, 255, 255, 0.2);

    /* CRITICAL FIXES */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    isolation: isolate; /* <-- IMPORTANT */
}

/* smoother animation (no translateY stacking issue) */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.system-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.system-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.25);
}

.arrow-icon {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.system-card:hover .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

.tab-active {
    background: #facc15 !important;
    color: #1e3a8a !important;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4);
}

.blur-overlay {
    backdrop-filter: blur(20px);
    background: rgba(30, 58, 138, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { 
    animation: fadeIn 0.6s ease-out forwards; 
    will-change: transform, opacity;
}

.dev-glass-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 20px;
    margin-top: 0;
    position: relative;
    z-index: 100;
}

.dev-glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}
