/* Glassmorphism */
.mobile-menu-summary::-webkit-details-marker {
    display: none;
}

.mobile-menu-summary::marker {
    content: "";
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Flashlight Effect */
.flashlight-card {
    position: relative;
    overflow: hidden;
    --mouse-x: -500px;
    --mouse-y: -500px;
    border-radius: 0.75rem;
    /* Matches rounded-xl */
}

/* Background Highlight */
.flashlight-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(13, 87, 217, 0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.flashlight-card:hover::before {
    opacity: 1;
}

/* Border Highlight */
.flashlight-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1px;
    /* Border width */
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(13, 87, 217, 0.4), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.flashlight-card:hover::after {
    opacity: 1;
}

/* Marquee Animation */
.mask-gradient {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.animate-marquee {
    display: flex;
    width: fit-content;
    animation: marquee 40s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Moves by half its width (the duplicate set starts) */
    }
}

/* Vertical Text Slide Animation (Letter by Letter) */
.animate-text {
    display: inline-flex;
    flex-wrap: wrap;
    overflow: hidden;
    /* Clip text outside */
}

.char-slide {
    display: inline-block;
    opacity: 0;
    transform: translateY(-100%);
    /* Start from above */
}

.animate-text.is-visible .char-slide {
    animation: slideDownChar 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownChar {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Carousel Fade - Handle via Tailwind classes in JS now */
/* .slide rules removed to prevent conflicts */

/* Scroll Animations */
/* Old Scroll Animations removed to prevent conflict with Keyframes below */

/* Background Clip Animation (Column Reveal) */
.bg-clip-anim-container {
    position: absolute;
    inset: 0;
    display: flex;
    z-index: -1;
    pointer-events: none;
}

.bg-clip-col {
    flex: 1;
    background: inherit;
    /* Should inherit or be set */
    height: 100%;
    transform: translateY(100%);
    animation: colSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes colSlideUp {
    to {
        transform: translateY(0);
    }
}

/* Border Beam Animation */
/* Derived from common border beam implementations */
.border-beam-btn {
    position: relative;
    overflow: hidden;
}

.border-beam-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(90deg, #135bec, transparent, #135bec) border-box;
    /* Customize colors */
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    background-size: 200% 100%;
    animation: borderBeam 3s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.border-beam-btn:hover::after {
    opacity: 1;
}

@keyframes borderBeam {
    0% {
        background-position: 100% 0;
    }

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

/* Alternative Border Beam (Moving light on border) */
.beam-border {
    position: relative;
    overflow: hidden;
    z-index: 0;
}

.beam-border::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent 0 340deg, #fff 360deg);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotateBeam 4s linear infinite;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s;
}

.beam-border:hover::before {
    opacity: 1;
}

.beam-border::after {
    content: "";
    position: absolute;
    inset: 1px;
    background: inherit;
    /* Same as button background */
    border-radius: inherit;
    z-index: -1;
}

@keyframes rotateBeam {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Celebration Share Card */
#share-card {
    background: linear-gradient(135deg, #0D57D9 0%, #3b82f6 100%);
}

#celebration-modal .glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

.dark #celebration-modal .glass-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Enhanced Entrance Animation */
@keyframes fade-slide-blur-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.animate-on-view {
    opacity: 0;
    /* Hidden initially */
    animation: fade-slide-blur-in 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Modal Scale In */
@keyframes modal-scale-in {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-enter {
    animation: modal-scale-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Metal Texture Overlay */
.metal-texture {
    position: relative;
    overflow: hidden;
}

.metal-texture::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 2px),
        repeating-linear-gradient(-45deg, transparent, transparent 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 2px);
    background-size: 4px 4px;
    pointer-events: none;
    z-index: 1;
    /* Lower z-index to sit behind interactive content */
}

/* Enhanced Gradient Text */
.text-gradient-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 50%, #FFD700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Removed text-shadow to prevent blurriness */
}

/* Enhanced Gradient Button */
.btn-gradient {
    background: linear-gradient(90deg, #135bec 0%, #3b82f6 50%, #135bec 100%);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
    border: none;
}

@keyframes gradientMove {
    0% {
        background-position: 100% 0;
    }

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

/* Reference Design Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Text Animation Utility */
.reveal-text {
    position: relative;
    overflow: hidden;
    display: inline-block;
    line-height: 1.2;
    visibility: hidden;
    /* Prevent flash before JS runs */
}

.char-clip {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    animation: verticalClipSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes verticalClipSlideDown {
    0% {
        opacity: 0;
        transform: translateY(100%);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        clip-path: polygon(0 0, 100% 0, 100% 150%, 0 150%);
    }
}

/* Border Beam Animation */
.border-beam::after {
    content: "";
    position: absolute;
    inset: -1px;
    /* 1px border width */
    background: conic-gradient(from 0deg, transparent 0 340deg, #fff 360deg);
    z-index: -1;
    border-radius: inherit;
    animation: border-beam-rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.border-beam:hover::after {
    opacity: 1;
}

@keyframes border-beam-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Scroll Animation (Fade-Slide-Blur) */
/* Enhanced Scroll Animation (Fade-Slide-Blur) */
.animate-on-scroll {
    /* User request: "Don't use opacity 0", "Use 'both' instead of 'forwards'" */
    animation: fadeSlideBlurIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both paused;
}

.animate-on-scroll.is-visible {
    animation-play-state: running;
}

@keyframes fadeSlideBlurIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Floating Animation */
@keyframes float {
    0% {
        transform: translateY(0px) translate(0px);
    }

    33% {
        transform: translateY(-30px) translateX(10px);
    }

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

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

.animate-float {
    animation: float 20s ease-in-out infinite;
}

/* Particle Effect Button */
.btn-particle-effect {
    position: relative;
    background: radial-gradient(circle at center, #3b82f6 0%, #0D57D9 100%);
    overflow: hidden;
    z-index: 1;
}

.btn-particle-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.3) 2px, transparent 3px),
        radial-gradient(circle at 60% 60%, rgba(255, 255, 255, 0.1) 2px, transparent 3px),
        radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.2) 1.5px, transparent 2.5px),
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.3) 1px, transparent 2px);
    background-size: 100px 100px;
    animation: particlesFloating 8s linear infinite;
    opacity: 0.6;
    pointer-events: none;
    z-index: -1;
}

@keyframes particlesFloating {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-50px) rotate(20deg);
    }
}

/* Enhanced Hover for Button */
.btn-particle-effect:hover {
    box-shadow: 0 0 20px rgba(13, 87, 217, 0.6);
}

.btn-particle-effect:active {
    transform: scale(0.95);
}

/* Pixel Fragmentation Effect */
.hover-pixel {
    cursor: pointer;
}

.pixel-shard {
    position: absolute;
    width: 4px;
    /* Pixel Size */
    height: 4px;
    background: white;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}
