/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --secondary-color: #06b6d4;
    --secondary-dark: #0891b2;
    --secondary-light: #22d3ee;
    --accent-coral: #f472b6;
    --accent-amber: #fbbf24;
    --accent-emerald: #34d399;
    --text-dark: #1e1b4b;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --success-color: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.navbar.transparent {
    background: transparent;
    box-shadow: none;
}

.navbar.transparent .logo {
    color: white;
    -webkit-text-fill-color: white;
}

.navbar.transparent .logo:hover {
    color: rgba(255, 255, 255, 0.8);
}

.navbar.transparent .logo i {
    -webkit-text-fill-color: white;
}

.navbar.transparent .nav-links a {
    color: white;
    -webkit-text-fill-color: white;
}

.navbar.transparent .nav-links a:hover,
.navbar.transparent .nav-links a.active {
    color: rgba(255, 255, 255, 0.8);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.8);
}

.navbar.transparent .nav-links a::after {
    background: white;
}

.navbar.transparent .hamburger .line {
    stroke: white;
}

.navbar.transparent .hamburger:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile nav dropdown should always have dark text */
@media (max-width: 768px) {
    .navbar.transparent .nav-links {
        background: var(--bg-white);
    }

    .navbar.transparent .nav-links a {
        color: var(--text-dark);
        -webkit-text-fill-color: var(--text-dark);
    }

    .navbar.transparent .nav-links a:hover,
    .navbar.transparent .nav-links a.active {
        color: var(--primary-color);
        -webkit-text-fill-color: var(--primary-color);
    }
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: scale(1.02);
}

.logo i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    z-index: 1001;
}

.hamburger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger input {
    display: none;
}

.hamburger svg {
    height: 2.2em;
    width: 2.2em;
    transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger .line {
    fill: none;
    stroke: var(--text-dark);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
    transition: stroke-dasharray 500ms cubic-bezier(0.4, 0, 0.2, 1),
        stroke-dashoffset 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger .line-top-bottom {
    stroke-dasharray: 12 63;
}

.hamburger input:checked+svg {
    transform: rotate(-45deg);
}

.hamburger input:checked+svg .line-top-bottom {
    stroke-dasharray: 20 300;
    stroke-dashoffset: -32.42;
}

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg,
            var(--primary-dark) 0%,
            var(--primary-color) 25%,
            var(--secondary-color) 50%,
            var(--accent-emerald) 75%,
            var(--primary-color) 100%);
    background-size: 200% 200%;
    animation: gradient-flow 15s ease infinite;
    color: white;
    padding: 120px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse-bg 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse-bg {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(25%, 25%);
    }
}

.page-hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.page-hero p {
    font-size: 1.15rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

/* Demos Section */
.demos {
    padding: 80px 0;
    background: var(--bg-light);
}

.demos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.demo-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-light);
}

.demo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.demo-screenshot {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    overflow: hidden;
}

.demo-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s ease;
}

.demo-card:hover .demo-screenshot img {
    transform: scale(1.05);
}

.demo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.85), rgba(6, 182, 212, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.demo-card:hover .demo-overlay {
    opacity: 1;
}

.view-btn {
    background: white;
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(10px);
    transition: transform 0.3s;
}

.demo-card:hover .view-btn {
    transform: translateY(0);
}

.demo-info {
    padding: 1.5rem;
}

.demo-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.demo-category {
    color: var(--text-light);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.demo-category i {
    color: var(--primary-color);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg,
            var(--primary-dark) 0%,
            var(--primary-color) 25%,
            var(--secondary-color) 50%,
            var(--accent-emerald) 75%,
            var(--primary-color) 100%);
    background-size: 200% 200%;
    animation: gradient-flow 15s ease infinite;
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse-bg 8s ease-in-out infinite;
    pointer-events: none;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.cta p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-light {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
    box-shadow: var(--shadow-lg);
}

.btn-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--text-dark), var(--primary-dark));
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
}

.btn-light:hover {
    color: white;
    border-color: transparent;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px) scale(1.02);
}

.btn-light:hover::before {
    clip-path: inset(0 0 0 0);
}

.btn-light:active {
    transform: translateY(-2px) scale(1);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
}

.btn-outline-light:hover {
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-5px) scale(1.02);
}

.btn-outline-light:hover::before {
    clip-path: inset(0 0 0 0);
}

.btn-outline-light:active {
    transform: translateY(-2px) scale(1);
}

/* Footer */
.footer {
    background: linear-gradient(180deg, var(--text-dark) 0%, #0c0a1d 100%);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-section ul li i {
    margin-right: 0.5rem;
    color: var(--secondary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 968px) {
    .demos-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
        max-height: 0;
        overflow: hidden;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        max-height: 500px;
    }

    .nav-links li {
        opacity: 0;
        transform: translateX(-20px);
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active li:nth-child(1) {
        transition-delay: 0.05s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.15s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.2s;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        -webkit-text-fill-color: var(--text-dark);
        background: none;
    }

    .nav-links a:hover,
    .nav-links a.active {
        -webkit-text-fill-color: var(--primary-color);
        background: var(--bg-light);
        border-radius: 8px;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    .page-hero p {
        font-size: 1rem;
    }

    .cta h2 {
        font-size: 1.75rem;
    }

    .cta p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .demo-info h3 {
        font-size: 1.25rem;
    }

    .page-hero h1 {
        font-size: 1.6rem;
    }

    .page-hero p {
        font-size: 0.9rem;
    }

    .cta h2 {
        font-size: 1.4rem;
    }

    .cta p {
        font-size: 0.9rem;
    }
}

/* ===== SCROLL ANIMATIONS ===== */

/* Initial hidden state */
.scroll-animate {
    opacity: 0;
}

/* When visible - set final state and play animation */
.scroll-animate.visible {
    opacity: 1;
    animation: scrollFadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-animate.fade-in-up.visible {
    animation-name: scrollFadeInUp;
}

.scroll-animate.fade-in-left.visible {
    animation-name: scrollFadeInLeft;
}

.scroll-animate.fade-in-right.visible {
    animation-name: scrollFadeInRight;
}

.scroll-animate.fade-in-scale.visible {
    animation-name: scrollFadeInScale;
}

/* Staggered animation delays */
.scroll-animate.delay-1.visible {
    animation-delay: 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.scroll-animate.delay-2.visible {
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.scroll-animate.delay-3.visible {
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.scroll-animate.delay-4.visible {
    animation-delay: 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes scrollFadeInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes scrollFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes scrollFadeInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes scrollFadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* After animation completes, remove animation so hover works */
.scroll-animate.animation-done {
    animation: none !important;
    opacity: 1 !important;
}

/* Ensure cards with scroll animation maintain hover transitions */
.demo-card.scroll-animate.animation-done {
    animation: none !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .scroll-animate {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
