/* Critical CSS - prevent FOUC with fade-in */
body {
    font-family: 'Inter', sans-serif;
    color: #E0E0FF;
    background: #0F0F23;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}
body.loaded {
    opacity: 1;
}

/* Enable scrolling */
body, html {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    width: 100%;
}

/* Animated background with floating orbs */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #0F0F23 0%, #1a1a35 100%);
    overflow: hidden;
}

.animated-bg::before,
.animated-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.animated-bg::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4), transparent);
    top: -100px;
    left: -100px;
    animation-delay: -5s;
}

.animated-bg::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.3), transparent);
    bottom: -150px;
    right: -150px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(30px, 50px) scale(1.05); }
}

/* Navigation bar background */
nav {
    background: #0F0F23;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* White nav state */
nav.nav-white {
    background: white;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Nav link color transitions */
nav a {
    transition: color 0.3s ease;
}

nav.nav-white a {
    color: #1a1a1a !important;
}

nav.nav-white a:hover {
    color: #667EEA !important;
}

/* Keep CTA button text white on white nav */
nav.nav-white .bg-gradient-to-r {
    color: white !important;
}

nav.nav-white .bg-gradient-to-r:hover {
    color: white !important;
}

/* Logo container */
nav a {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

nav a img {
    height: 32px !important;
    width: 32px !important;
    margin-right: 8px !important;
    transition: filter 0.3s ease;
}

/* Invert logo when nav is white */
nav.nav-white a img {
    filter: invert(1);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* Hero Section */
    h1, h2 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Navigation - Hide some links on very small screens */
    .nav-link {
        font-size: 0.75rem;
    }

    /* CTA Buttons */
    .px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* USP fade-in animation */
.usp-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.usp-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Sequential animation delays */
.usp-item:nth-child(1).fade-in {
    transition-delay: 0.2s;
}

.usp-item:nth-child(2).fade-in {
    transition-delay: 0.5s;
}

.usp-item:nth-child(3).fade-in {
    transition-delay: 0.8s;
}

/* Sticky "Just do your work" heading */
.sticky-heading {
    position: sticky;
    top: 80px;
    z-index: 5;
    background: white;
    padding-bottom: 2rem;
}

.fadeIn {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Text gradient for headings */
.text-gradient {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero text enhancements */
#mainLanding h1, #mainLanding h2 {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

#mainLanding h1 {
    font-weight: 800;
}

#mainLanding h2 {
    font-weight: 800;
}

/* Carousel button styles */
.carousel-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15)) !important;
    backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.carousel-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3)) !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
    box-shadow:
        0 12px 48px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.08);
}

.carousel-btn:active {
    transform: scale(0.95);
}

/* Subtle shake animation for first card */
@keyframes subtleShake {
    0%, 100% { translate: 0 0; }
    25% { translate: 2px 0; }
    75% { translate: -2px 0; }
}

.shake-hint {
    animation: subtleShake 2s ease-in-out 3;
}

/* Prevent mobile tap highlight on buttons */
button {
    -webkit-tap-highlight-color: transparent;
}

/* Navigation link styles */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile navigation - hide on small screens */
@media (max-width: 1024px) {
    .nav-link {
        display: none;
    }
}

/* ========== Hero Section Responsive Styles ========== */
@media (max-width: 768px) {
    #mainLanding {
        padding-top: 120px !important;
        padding-bottom: 130px !important;
        gap: 24px !important;
    }
    #mainLanding > div:first-child {
        margin-top: 0 !important;
    }
    #mainLanding h1 {
        font-size: clamp(1.575rem, 7vw, 2.35125rem) !important;
        margin-bottom: 0 !important;
    }
    #mainLanding h2 {
        font-size: 1.71rem !important;
        margin-top: 4px !important;
    }
    #interfaceCarousel {
        height: 286px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .carousel-nav {
        bottom: -70px !important;
        position: absolute !important;
    }
    .carousel-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 18px !important;
    }
    /* Make UI cards 10% larger on mobile */
    .ui-card {
        width: 209px !important;
        height: 286px !important;
    }
    .ui-card h3 {
        font-size: 17px !important;
    }
    .ui-card p {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    .ui-card button {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    /* Reduce preview container on mobile */
    .ui-card > div > div:first-of-type {
        height: 110px !important;
        margin-bottom: 10px !important;
    }
}

/* PC-specific adjustments */
@media (min-width: 769px) {
    #mainLanding {
        gap: 48px !important;
        padding-top: 140px !important;
        padding-bottom: 100px !important;
    }

    #mainLanding h1 {
        font-size: clamp(2.7rem, 5.5vw, 4.95rem) !important;
    }

    #mainLanding h2 {
        font-size: 3.6rem !important;
    }

    /* Move carousel lower on desktop, keep text where it is */
    #interfaceCarousel {
        margin-top: 24px !important;
    }

    /* Position carousel buttons on sides for desktop */
    .carousel-nav {
        position: absolute !important;
        top: 50% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        display: flex !important;
        justify-content: space-between !important;
        width: calc(100% + 100px) !important;
        margin-left: -50px !important;
        gap: 0 !important;
        pointer-events: none !important;
    }

    .carousel-btn {
        pointer-events: auto !important;
    }
}

/* ========== Dashboard Preview Responsive Styles ========== */
@media (max-width: 768px) {
    #dashboard-preview-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    #dashboard-preview-section h2 {
        font-size: 24px !important;
        margin-bottom: 12px !important;
    }

    #dashboard-preview-section .dashboard-preview-container > div:first-child {
        margin-bottom: 16px !important;
    }

    #dashboard-preview-section .dashboard-preview-container > div:first-child > div {
        gap: 12px !important;
    }

    #dashboard-preview-section .dashboard-preview-container > div:first-child svg,
    #dashboard-preview-section .dashboard-preview-container > div:first-child img {
        width: 24px !important;
        height: 24px !important;
    }

    .dashboard-preview-img {
        border-radius: 8px !important;
        border: 1px solid rgba(99, 102, 241, 0.15) !important;
        box-shadow:
            0 0 0 0.5px rgba(99, 102, 241, 0.08),
            0 10px 30px -5px rgba(99, 102, 241, 0.2),
            0 5px 20px -5px rgba(147, 51, 234, 0.15),
            0 0 40px -10px rgba(236, 72, 153, 0.1) !important;
    }

    .dashboard-sparkle {
        opacity: 0.6;
        filter: blur(40px) !important;
        top: 60px !important;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    #dashboard-preview-section h2 {
        font-size: 28px !important;
    }

    #dashboard-preview-section .dashboard-preview-container > div:first-child svg,
    #dashboard-preview-section .dashboard-preview-container > div:first-child img {
        width: 26px !important;
        height: 26px !important;
    }

    .dashboard-preview-img {
        border-radius: 12px !important;
        max-width: 900px !important;
    }

    .dashboard-sparkle {
        filter: blur(50px) !important;
        top: 70px !important;
    }
}

/* Desktop enhancement */
@media (min-width: 1025px) {
    .dashboard-preview-img {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .dashboard-preview-container:hover .dashboard-preview-img {
        transform: translateY(-4px);
        box-shadow:
            0 0 0 1px rgba(99, 102, 241, 0.15),
            0 30px 80px -15px rgba(99, 102, 241, 0.4),
            0 15px 50px -10px rgba(147, 51, 234, 0.25),
            0 0 100px -20px rgba(236, 72, 153, 0.2) !important;
    }
}
