/* ============================================
   نوّيست Animated Logo Styles
   Premium animated logo with glow, shimmer, and sparkle effects
   ============================================ */

/* Import Nabla Font for Special Effect */
@import url("https://fonts.googleapis.com/css2?family=Nabla:EDPT,EHLT@30..200,24&display=swap");

/* Custom Logo Font - Kept as fallback or for other elements */
@font-face {
    font-family: 'Upheaval';
    src: url('fonts/upheavtt.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Palette for Nabla */
@font-palette-values --Nabla {
    font-family: Nabla;
    base-palette: 2;
}

/* Main Logo Container */
.animated-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoFloat 4s ease-in-out infinite;
    /* Reduce drop shadow intensity for this colorful font */
    filter: drop-shadow(0 0 15px rgba(163, 40, 88, 0.2));
}

/* ... existing demo-badge styles ... */

/* Main Logo Text - Restored with Animation */
.logo-text {
    position: relative;
    font-family: 'Upheaval', 'Cairo', sans-serif;
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 2;
    text-shadow: none;

    /* Restore Filter */
    filter:
        drop-shadow(0 0 2px rgba(255, 107, 157, 0.8)) drop-shadow(0 0 10px rgba(163, 40, 88, 0.6)) drop-shadow(0 0 20px rgba(94, 49, 91, 0.4)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));

    white-space: nowrap;

    /* CRITICAL: Fix for RTL flipping */
    direction: ltr !important;
    display: inline-block;
    /* Helps with direction sometimes */
}

/* Individual Spans for Animation */
/* Individual Spans - Main Text (The Core) */
.logo-text span {
    position: relative;
    display: inline-block;
    z-index: 10;

    /* Restore Face Gradient on the span itself */
    background: linear-gradient(135deg,
            #ff6b9d 0%,
            #a32858 25%,
            #5e315b 50%,
            #a32858 75%,
            #ff6b9d 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    color: transparent;
    /* Fallback */

    /* Holographic Wave for the core text */
    animation: holoWave 3s ease-in-out alternate infinite, gradientShift 6s ease-in-out infinite;
}

/* 3D Block Layer (Back) - ::before */
/* Cinematic Sheen & Glow Layers */

/* Glow removed per user request - keeping layer empty for structure or future use */
.logo-text span::before {
    content: attr(data-letter);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: none;
    /* Hide the pink glow */
}

/* Sheen Layer (Front Overlay) - ::after */
.logo-text span::after {
    content: attr(data-letter);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    /* On top of everything */

    /* The Sheen Gradient */
    background: linear-gradient(120deg,
            transparent 30%,
            rgba(255, 255, 255, 0.8) 50%,
            transparent 70%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;

    opacity: 0.8;
    animation: sheenPass 3.5s ease-in-out infinite;
    mix-blend-mode: overlay;
    /* Helps it look like light */
    pointer-events: none;
}


/* New Animations */

/* Holographic Wave - Text breathes and brightens */
@keyframes holoWave {

    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: brightness(1) drop-shadow(0 0 0px rgba(0, 0, 0, 0));
    }

    50% {
        transform: translateY(-6px) scale(1.05);
        /* Slight swell */
        filter: brightness(1.3) drop-shadow(0 5px 15px rgba(255, 107, 157, 0.4));
        /* Bloom */
    }
}

/* Staggered Delays - Key for the Sheen Sweep effect! */
.logo-text span:nth-child(1),
.logo-text span:nth-child(1)::before,
.logo-text span:nth-child(1)::after {
    animation-delay: 0.0s;
}

.logo-text span:nth-child(2),
.logo-text span:nth-child(2)::before,
.logo-text span:nth-child(2)::after {
    animation-delay: 0.1s;
}

.logo-text span:nth-child(3),
.logo-text span:nth-child(3)::before,
.logo-text span:nth-child(3)::after {
    animation-delay: 0.2s;
}

.logo-text span:nth-child(4),
.logo-text span:nth-child(4)::before,
.logo-text span:nth-child(4)::after {
    animation-delay: 0.3s;
}

.logo-text span:nth-child(5),
.logo-text span:nth-child(5)::before,
.logo-text span:nth-child(5)::after {
    animation-delay: 0.4s;
}

.logo-text span:nth-child(6),
.logo-text span:nth-child(6)::before,
.logo-text span:nth-child(6)::after {
    animation-delay: 0.5s;
}

/* Gentle Float for core text */
@keyframes coreFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-4px);
    }
}

/* Stable Glow Breathing */
@keyframes stableGlow {
    0% {
        opacity: 0.6;
        filter: blur(2px);
    }

    100% {
        opacity: 1;
        filter: blur(4px);
    }
}

/* The Sheen Sweep */
@keyframes sheenPass {

    0%,
    30% {
        background-position: 200% 0;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    70%,
    100% {
        background-position: -200% 0;
        opacity: 0;
    }
}


/* Shimmer Overlay - Restored */
.logo-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Shimmer Gradient */
    background: linear-gradient(120deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.6) 50%,
            transparent 60%,
            transparent 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;

    font-family: 'Upheaval', 'Cairo', sans-serif;
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 700;
    letter-spacing: 0.05em;

    animation: shimmerSweep 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
    opacity: 0.8;

    white-space: nowrap;
    direction: ltr !important;
    display: inline-block;
}

.logo-shimmer span {
    /* Match core text movement AND scale */
    animation: holoWave 3s ease-in-out alternate infinite;
    position: relative;
    display: inline-block;
}

/* Sync Shimmer Delays */
.logo-shimmer span:nth-child(1) {
    animation-delay: 0.1s;
}

.logo-shimmer span:nth-child(2) {
    animation-delay: 0.2s;
}

.logo-shimmer span:nth-child(3) {
    animation-delay: 0.3s;
}

.logo-shimmer span:nth-child(4) {
    animation-delay: 0.4s;
}

.logo-shimmer span:nth-child(5) {
    animation-delay: 0.5s;
}

.logo-shimmer span:nth-child(6) {
    animation-delay: 0.6s;
}

/* Back Extrudes Down-Right significantly */

/* DEMO Badge - Specific Overrides */
.demo-badge {
    position: absolute !important;
    bottom: -35px !important;
    right: -120px !important;
    left: auto !important;
    background: linear-gradient(135deg, #a32858 0%, #5e315b 100%);
    color: white;
    padding: 0.5em 1.2em;
    font-size: clamp(11px, 1.8vw, 15px);
    font-weight: bold;
    border-radius: 6px;
    transform: rotate(15deg);
    box-shadow:
        0 0 20px rgba(163, 40, 88, 0.6),
        0 0 40px rgba(163, 40, 88, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 20;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    animation: demoPulse 2s ease-in-out infinite;
    font-family: 'Upheaval', sans-serif;
    /* Use custom Upheaval font for badge */
}

/* Background Glow Layer */
.logo-glow {
    position: absolute;
    width: 120%;
    height: 150%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center,
            rgba(163, 40, 88, 0.3) 0%,
            rgba(94, 49, 91, 0.15) 40%,
            transparent 70%);
    filter: blur(20px);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}



/* Sparkle Container */
.logo-sparkles {
    position: absolute;
    width: 130%;
    height: 160%;
    top: -30%;
    left: -15%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* Individual Sparkle */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 107, 157, 0.8) 40%,
            transparent 70%);
    border-radius: 50%;
    animation: sparkleFloat 3s ease-in-out infinite;
    opacity: 0;
}

/* Sparkle Variations */
.sparkle:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 2.5s;
}

.sparkle:nth-child(2) {
    top: 25%;
    right: 8%;
    animation-delay: 0.4s;
    animation-duration: 3s;
    width: 3px;
    height: 3px;
}

.sparkle:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-delay: 0.8s;
    animation-duration: 2.8s;
}

.sparkle:nth-child(4) {
    top: 40%;
    right: 15%;
    animation-delay: 1.2s;
    animation-duration: 3.2s;
    width: 5px;
    height: 5px;
}

.sparkle:nth-child(5) {
    bottom: 30%;
    right: 20%;
    animation-delay: 1.6s;
    animation-duration: 2.6s;
}

.sparkle:nth-child(6) {
    top: 60%;
    left: 5%;
    animation-delay: 2s;
    animation-duration: 3s;
    width: 3px;
    height: 3px;
}

.sparkle:nth-child(7) {
    top: 10%;
    left: 50%;
    animation-delay: 0.6s;
    animation-duration: 2.4s;
}

.sparkle:nth-child(8) {
    bottom: 15%;
    left: 60%;
    animation-delay: 1.4s;
    animation-duration: 2.9s;
    width: 4px;
    height: 4px;
}

/* Star-shaped sparkles */
.sparkle-star {
    position: absolute;
    width: 8px;
    height: 8px;
    animation: sparkleRotate 4s linear infinite;
    opacity: 0;
}

.sparkle-star::before,
.sparkle-star::after {
    content: '';
    position: absolute;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.9) 45%,
            rgba(255, 255, 255, 0.9) 55%,
            transparent 100%);
}

.sparkle-star::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.sparkle-star::after {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.sparkle-star:nth-child(9) {
    top: 5%;
    left: 30%;
    animation-delay: 0.3s;
}

.sparkle-star:nth-child(10) {
    bottom: 10%;
    right: 25%;
    animation-delay: 1.8s;
    width: 10px;
    height: 10px;
}

.sparkle-star:nth-child(11) {
    top: 35%;
    left: 2%;
    animation-delay: 1s;
    width: 6px;
    height: 6px;
}

.sparkle-star:nth-child(12) {
    top: 50%;
    right: 5%;
    animation-delay: 2.2s;
}

/* ============================================
   Keyframe Animations
   ============================================ */

/* Floating Motion */
@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}



/* Glow Pulse */
@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Gradient Shift for text */
@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Shimmer Sweep */
@keyframes shimmerSweep {
    0% {
        background-position: 200% 0;
    }

    50%,
    100% {
        background-position: -200% 0;
    }
}

/* Sparkle Float */
@keyframes sparkleFloat {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }

    10% {
        opacity: 1;
        transform: translateY(-5px) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateY(-15px) scale(0.8);
    }

    90% {
        opacity: 1;
        transform: translateY(-25px) scale(1);
    }
}

/* Sparkle Rotate (for star shapes) */
@keyframes sparkleRotate {

    0%,
    100% {
        opacity: 0;
        transform: rotate(0deg) scale(0.5);
    }

    15% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: rotate(180deg) scale(0.9);
    }

    85% {
        opacity: 1;
        transform: rotate(315deg) scale(1);
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .animated-logo {
        filter: drop-shadow(0 0 20px rgba(163, 40, 88, 0.3));
    }

    .logo-text,
    .logo-shimmer {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .logo-glow {
        width: 140%;
        height: 140%;
        filter: blur(15px);
    }

    .sparkle {
        width: 3px;
        height: 3px;
    }

    .sparkle-star {
        width: 6px;
        height: 6px;
    }

    .demo-badge {
        bottom: -20px !important;
        right: -10px !important;
        left: auto !important;
        font-size: 11px !important;
        padding: 4px 8px !important;
        transform: rotate(5deg);
    }
}

/* Mobile Landscape Constraints */
@media (max-height: 500px) and (orientation: landscape) {

    .logo-text,
    .logo-shimmer {
        font-size: clamp(3rem, 18vh, 5rem);
        /* Increased size significantly */
    }

    .demo-badge {
        bottom: -35px !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) rotate(0deg) !important;
        font-size: 10px !important;
        padding: 3px 8px !important;
        white-space: nowrap;
    }
}


/* Desktop enhancements */
@media (min-width: 1200px) {

    .logo-text,
    .logo-shimmer {
        font-size: 8rem;
    }

    .sparkle:nth-child(4),
    .sparkle-star:nth-child(10) {
        width: 8px;
        height: 8px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .animated-logo,
    .logo-glow,
    .logo-text,
    .logo-shimmer,
    .sparkle,
    .sparkle-star {
        animation: none;
    }

    .logo-text {
        background-position: 0% 50%;
    }

    .sparkle,
    .sparkle-star {
        opacity: 0.6;
    }
}