/* ================================
   CSS VARIABLES & RESET
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #10b981;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* ================================
   BASE STYLES
   ================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-dark);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ================================
   BACKGROUND ANIMATIONS
   ================================ */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="3"/></g></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* ================================
   GLASS MORPHISM UTILITIES
   ================================ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ================================
   HEADER & NAVIGATION
   ================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ================================
   HERO SECTION - FIXED FOR MOBILE
   ================================ */
.hero {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #a855f7 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5)); }
    to { filter: drop-shadow(0 0 40px rgba(6, 182, 212, 0.8)); }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ================================
   BUTTONS
   ================================ */
.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* ================================
   FLOATING SHAPES
   ================================ */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    opacity: 0.1;
    animation: floatShape 15s ease-in-out infinite;
}

.shape-1 {
    top: 20%;
    left: 10%;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    animation-delay: 0s;
}

.shape-2 {
    top: 60%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: 5s;
}

.shape-3 {
    bottom: 20%;
    left: 20%;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: 20px;
    transform: rotate(45deg);
    animation-delay: 10s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(15px) rotate(240deg); }
}

/* ================================
   FEATURES SECTION
   ================================ */
.features {
    padding: 4rem 0;
    position: relative;
}

.features h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    color: white;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 24px;
    transition: all 0.3s ease;
}

.feature-card:hover::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.feature-card p {
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* ================================
   DEMO SECTION
   ================================ */
.demo {
    padding: 8rem 0;
    text-align: center;
}

.demo-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
    color: white;
}

.demo h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
}

.demo-subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

/* ================================
   FORMS
   ================================ */
.demo-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-select {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: var(--bg-dark);
    color: white;
}

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ================================
   FORM MESSAGES
   ================================ */
.form-message {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-message.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ================================
   LOADING STATES
   ================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .submit-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* ================================
   FOOTER
   ================================ */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4rem 0 2rem;
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 600;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-links a:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: translateY(-3px);
}

/* ================================
   MOBILE NAVIGATION
   ================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    z-index: 9999;
    padding: 2rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 12px;
    min-width: 200px;
    text-align: center;
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.mobile-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* ================================
   RESPONSIVE DESIGN - OPTIMIZED FOR MOBILE
   ================================ */

/* Large tablets and small laptops */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .hero h1 {
        font-size: clamp(3.5rem, 7vw, 5rem);
    }
}

/* Tablets - ENHANCED MOBILE EXPERIENCE */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .container {
        padding: 0 1rem;
    }

    .hero {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: clamp(3.5rem, 10vw, 5rem);
        margin-bottom: 2rem;
    }

    .hero-subtitle {
        font-size: clamp(1.3rem, 5vw, 1.6rem);
        margin-bottom: 3rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .btn {
        width: 100%;
        max-width: 350px;
        justify-content: center;
        padding: 1.4rem 2rem;
        font-size: 1.1rem;
        min-height: 56px;
    }

    .features {
        padding: 4rem 0;
    }

    .features h2 {
        font-size: clamp(2rem, 6vw, 3rem);
        margin-bottom: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    .demo {
        padding: 4rem 0;
    }

    .demo h2 {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .demo-container {
        padding: 1.5rem 1rem;
        margin: 0 1rem;
    }

    .demo-form {
        padding: 2rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Large phones - ENHANCED TYPOGRAPHY AND SPACING */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        padding: 2rem 0;
        justify-content: center;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 12vw, 4rem);
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: clamp(1.1rem, 5vw, 1.4rem);
        margin-bottom: 2.5rem;
        padding: 0 0.5rem;
    }

    .btn {
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
        max-width: 320px;
        min-height: 54px;
    }

    .features {
        padding: 3rem 0;
    }

    .features h2 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        margin-bottom: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }

    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .feature-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .demo {
        padding: 3rem 0;
    }

    .demo-container {
        padding: 1rem 0.5rem;
        margin: 0 0.5rem;
    }

    .demo-form {
        padding: 1.5rem 1rem;
    }

    .form-input, .form-select {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .submit-btn {
        padding: 1.1rem;
        font-size: 1rem;
    }

    .footer {
        padding: 3rem 0 2rem;
    }
}

/* Small phones - OPTIMIZED FOR SMALLEST SCREENS */
@media (max-width: 360px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero-content {
        padding: 0 0.5rem;
    }

    .hero {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        padding: 1.5rem 0;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 14vw, 3.5rem);
        margin-bottom: 1.25rem;
    }

    .hero-subtitle {
        font-size: clamp(1rem, 5vw, 1.25rem);
        margin-bottom: 2rem;
    }

    .feature-card {
        margin: 0 0.25rem;
        padding: 1.25rem 0.75rem;
    }

    .demo-container {
        margin: 0 0.25rem;
    }

    .demo-form {
        padding: 1.25rem 0.75rem;
    }

    .btn {
        padding: 1.1rem 1.25rem;
        font-size: 0.95rem;
        min-height: 52px;
    }
}

/* ================================
   MOBILE-SPECIFIC ENHANCEMENTS
   ================================ */

/* Touch-optimized interactions */
@media (max-width: 768px) {
    .btn, .form-input, .form-select, .submit-btn {
        min-height: 48px; /* Accessibility touch target size */
    }

    /* Disable hover effects on touch devices */
    .feature-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* Enhanced touch feedback */
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .feature-card:active {
        transform: scale(0.99);
        transition: transform 0.1s ease;
    }

    /* Mobile-optimized form interactions */
    .form-input:focus, .form-select:focus {
        transform: none;
        border-width: 2px;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    /* Performance optimizations for mobile */
    .floating-shapes {
        display: none; /* Hidden for better performance */
    }

    .bg-animation::before {
        animation: none; /* Disabled for performance */
    }

    /* Mobile typography enhancements */
    .features p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .demo-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
    }
}

/* Landscape orientation optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        padding: 1.5rem 0;
    }

    .features {
        padding: 3rem 0;
    }

    .demo {
        padding: 3rem 0;
    }
}

/* High-resolution display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .glass {
        backdrop-filter: blur(15px); /* Optimized blur for high DPI */
    }
}

/* Ultra-wide mobile screens */
@media (max-width: 768px) and (min-aspect-ratio: 2/1) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
}

/* Improved accessibility for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero h1 {
        animation: none;
    }

    .floating-shapes {
        display: none;
    }

    .bg-animation::before {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}