/* Cosmos Weather Landing Page - Redesigned Styles */

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0A0A0F;
    color: white;
}

/* ===== Animated Sky Background ===== */
.sky-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg,
            #0f172a 0%,
            #1e3a5f 30%,
            #0d4f6e 50%,
            #1a365d 70%,
            #0f172a 100%);
    overflow: hidden;
}

/* Stars */
.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 160px 120px, white, transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 250px 160px, white, transparent),
        radial-gradient(2px 2px at 300px 90px, rgba(255, 255, 255, 0.5), transparent);
    background-size: 350px 200px;
    animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Bottom fade overlay - creates smooth transition to content areas */
.sky-background::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to bottom, transparent 0%, rgba(10, 10, 15, 0.8) 70%, #0A0A0F 100%);
    pointer-events: none;
}

/* Clouds */
.cloud {
    position: absolute;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.1) 100%);
    border-radius: 100px;
    filter: blur(2px);
}

.cloud-1 {
    width: 200px;
    height: 60px;
    top: 15%;
    left: -200px;
    animation: cloud-drift 30s linear infinite;
}

.cloud-2 {
    width: 150px;
    height: 45px;
    top: 25%;
    left: -150px;
    animation: cloud-drift 25s linear infinite 5s;
    opacity: 0.7;
}

.cloud-3 {
    width: 180px;
    height: 50px;
    top: 35%;
    left: -180px;
    animation: cloud-drift 35s linear infinite 10s;
    opacity: 0.5;
}

@keyframes cloud-drift {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(100vw + 300px));
    }
}

/* Sun/Moon */
.celestial-body {
    position: absolute;
    border-radius: 50%;
}

.sun {
    width: 80px;
    height: 80px;
    top: 20%;
    right: 15%;
    background: radial-gradient(circle, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    box-shadow:
        0 0 60px rgba(251, 191, 36, 0.4),
        0 0 120px rgba(251, 191, 36, 0.2);
    animation: sun-glow 4s ease-in-out infinite alternate;
}

@keyframes sun-glow {
    0% {
        box-shadow: 0 0 60px rgba(251, 191, 36, 0.4), 0 0 120px rgba(251, 191, 36, 0.2);
    }

    100% {
        box-shadow: 0 0 80px rgba(251, 191, 36, 0.5), 0 0 150px rgba(251, 191, 36, 0.3);
    }
}

/* Moon */
.moon {
    width: 70px;
    height: 70px;
    top: 18%;
    right: 18%;
    background: radial-gradient(circle at 30% 30%, #f5f5f5 0%, #e0e0e0 50%, #bdbdbd 100%);
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.3),
        0 0 80px rgba(200, 200, 255, 0.2),
        inset -10px -10px 20px rgba(0, 0, 0, 0.2);
    animation: moon-glow 5s ease-in-out infinite alternate;
}

@keyframes moon-glow {
    0% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.3), 0 0 80px rgba(200, 200, 255, 0.2), inset -10px -10px 20px rgba(0, 0, 0, 0.2);
    }

    100% {
        box-shadow: 0 0 60px rgba(255, 255, 255, 0.4), 0 0 100px rgba(200, 200, 255, 0.3), inset -10px -10px 20px rgba(0, 0, 0, 0.2);
    }
}

/* ===== Sun/Moon Transitions ===== */
/* Dark mode is always on - we just transition celestial bodies */

.sun,
.moon {
    transition: opacity 1s ease;
}

/* Sun/Moon Card Visibility */
.sun-card {
    display: block;
}

.moon-card {
    display: none;
}

.day-mode~main .sun-card,
body.day-mode .sun-card {
    display: block;
}

.day-mode~main .moon-card,
body.day-mode .moon-card {
    display: none;
}

.night-mode~main .sun-card,
body.night-mode .sun-card {
    display: none;
}

.night-mode~main .moon-card,
body.night-mode .moon-card {
    display: block;
}

/* ===== Liquid Cursor ===== */
.liquid-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.8) 0%, rgba(34, 211, 211, 0.4) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    filter: blur(2px);
}

.liquid-cursor.hovering {
    width: 80px;
    height: 80px;
    filter: blur(8px);
}

@media (hover: none) {
    .liquid-cursor {
        display: none;
    }

    body {
        cursor: auto;
    }
}

/* ===== Dashboard Cards ===== */
.dashboard-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(168, 85, 247, 0.2);
}

.dashboard-preview {
    perspective: 1000px;
}

/* Weather Icon in Dashboard */
.weather-icon-large {
    position: relative;
    width: 80px;
    height: 80px;
}

.sun-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    top: 0;
    right: 0;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

.cloud-icon {
    position: absolute;
    width: 60px;
    height: 35px;
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 30px;
    bottom: 5px;
    left: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cloud-icon::before {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background: inherit;
    border-radius: 50%;
    top: -12px;
    left: 10px;
}

.cloud-icon::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: inherit;
    border-radius: 50%;
    top: -8px;
    left: 28px;
}

/* Moon Visual */
.moon-visual {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 50%, #f59e0b 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(252, 211, 77, 0.3);
}

.moon-glow {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(252, 211, 77, 0.2) 0%, transparent 70%);
    animation: moon-pulse 3s ease-in-out infinite alternate;
}

@keyframes moon-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ===== Feature Cards New ===== */
.feature-card-new {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.feature-card-new:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .dashboard-card {
        backdrop-filter: blur(10px);
    }

    .sun {
        width: 60px;
        height: 60px;
        right: 10%;
    }
}

/* ===== Selection & Scrollbar ===== */
::selection {
    background: rgba(168, 85, 247, 0.4);
    color: white;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}

/* Scroll indicator centering fix */
.scroll-indicator {
    left: calc(50% - 3px);
    /* Account for scrollbar width */
}

/* ===== Interactive Title ===== */
.interactive-title {
    display: inline-block;
    cursor: default;
}

.title-word {
    display: inline-block;
    white-space: nowrap;
}

.title-char {
    display: inline-block;
    color: white;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.title-char.active {
    color: #22D3D3;
    text-shadow: 0 0 20px rgba(34, 211, 211, 0.5);
}

/* ===== Download Buttons with Glow Fade ===== */
.download-btn {
    position: relative;
    display: inline-flex;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    color: white;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.download-btn-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

/* Glow overlay */
.download-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-out;
    border-radius: 16px;
}

.download-btn-apple::before {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(124, 58, 237, 0.2));
}

.download-btn-google::before {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(124, 58, 237, 0.2));
}

/* Hover state - glow appears instantly */
.download-btn:hover::before {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

.download-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.download-btn-apple:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 10px 40px -10px rgba(168, 85, 247, 0.4);
}

.download-btn-google:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 10px 40px -10px rgba(168, 85, 247, 0.4);
}

/* Leave state - glow fades slowly */
.download-btn:not(:hover)::before {
    opacity: 0;
    transition: opacity 2s ease-out;
}

.download-btn:not(:hover) {
    transform: translateY(0);
    transition: transform 0.5s ease, border-color 1.5s ease, box-shadow 2s ease-out;
    box-shadow: none;
}

/* ===== Cosmic Vignette Glow ===== */
.cosmic-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(15, 23, 42, 0.4) 100%);
    box-shadow: inset 0 0 150px rgba(88, 28, 135, 0.15),
        inset 0 0 300px rgba(34, 211, 211, 0.05);
}

@media (max-width: 768px) {
    .cosmic-vignette {
        box-shadow: inset 0 0 80px rgba(88, 28, 135, 0.12),
            inset 0 0 150px rgba(34, 211, 211, 0.04);
    }
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for grouped elements */
.reveal-stagger>*:nth-child(1) {
    transition-delay: 0ms;
}

.reveal-stagger>*:nth-child(2) {
    transition-delay: 80ms;
}

.reveal-stagger>*:nth-child(3) {
    transition-delay: 160ms;
}

.reveal-stagger>*:nth-child(4) {
    transition-delay: 240ms;
}

.reveal-stagger>*:nth-child(5) {
    transition-delay: 320ms;
}

.reveal-stagger>*:nth-child(6) {
    transition-delay: 400ms;
}

/* ===== Floating Animations for Celestial Bodies ===== */
@keyframes gentle-float {

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

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

.sun {
    animation: sun-glow 4s ease-in-out infinite alternate, gentle-float 8s ease-in-out infinite;
}

.moon {
    animation: moon-glow 5s ease-in-out infinite alternate, gentle-float 10s ease-in-out infinite;
}

/* ===== Enhanced Section Transitions ===== */
section {
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

section.visible::before {
    opacity: 1;
}

/* ===== Hero Title Character Animation ===== */
.title-char {
    display: inline-block;
    color: white;
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(20px);
}

.title-char.animated {
    opacity: 1;
    transform: translateY(0);
}

.title-char.active {
    color: #22D3D3;
    text-shadow: 0 0 20px rgba(34, 211, 211, 0.5);
    transform: translateY(-3px);
}

/* ===== Subtle Noise/Grain Overlay ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== Smooth Page Load ===== */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0A0A0F;
    color: white;
    opacity: 0;
    animation: page-fade-in 0.6s ease forwards;
}

@keyframes page-fade-in {
    to {
        opacity: 1;
    }
}

/* ===== Feature Card Hover Enhancements ===== */
.feature-card-new {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.feature-card-new::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(168, 85, 247, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card-new:hover::before {
    opacity: 1;
}

.feature-card-new:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(168, 85, 247, 0.15);
}

/* Mobile: Remove hover transforms, use simpler active state */
@media (hover: none) {
    .feature-card-new:hover {
        transform: none;
    }

    .feature-card-new:active {
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(168, 85, 247, 0.3);
    }

    .dashboard-card:hover {
        transform: none;
    }
}

/* ===== Feature Card Presentation (Scroll-Pinned) ===== */
.feature-presentation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

/* Container that holds the presentation - this is what gets pinned */
#features-section {
    position: relative;
    min-height: 100vh;
}

#features-section .max-w-6xl {
    position: relative;
}

.feature-presentation-card {
    position: absolute;
    width: 90%;
    max-width: 600px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.feature-card-showcase {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 30px 80px -20px rgba(168, 85, 247, 0.3),
        0 0 100px rgba(34, 211, 211, 0.1);
}

/* Mobile adjustments for presentation cards */
@media (max-width: 768px) {
    .feature-card-showcase {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .feature-card-showcase h3 {
        font-size: 1.5rem;
    }

    .feature-card-showcase p {
        font-size: 0.95rem;
    }

    .feature-card-showcase .feature-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }

    .feature-card-showcase .feature-icon span {
        font-size: 36px !important;
    }
}

.feature-card-showcase .feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 16px;
}

.feature-card-showcase h3 {
    background: linear-gradient(135deg, #fff 0%, #A855F7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.feature-card-showcase p {
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* When presentation is done, hide it and collapse height */
.feature-presentation.done {
    display: none;
}

/* Hide grid initially on desktop, show after presentation */
#features-grid {
    opacity: 1;
    margin-top: 0;
}

/* Mobile: Skip scroll-pinned presentation, use simpler fly-in animation */
@media (max-width: 768px) {
    .feature-presentation {
        display: none !important;
    }

    #features-grid {
        opacity: 1 !important;
    }

    #features-section {
        min-height: auto;
    }

    /* Fly-in animation states */
    .feature-card-new.fly-left {
        opacity: 0;
        transform: translateX(-60px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }

    .feature-card-new.fly-right {
        opacity: 0;
        transform: translateX(60px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }

    .feature-card-new.fly-left.visible,
    .feature-card-new.fly-right.visible {
        opacity: 1;
        transform: translateX(0);
    }
}