/**
 * Landing Page Enhancements
 * Informative CSS styling with improved UX and visual hierarchy
 */

/* ===== Logo, Typography & Navigation (from critical.css) ===== */
.gradient-text {
    font-family: 'Saira Stencil One', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1f2937;
    font-weight: 400;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #059669;
    border-radius: 8px;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
}
.logo-icon::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M10 14l-1.5 1.5a2.8 2.8 0 0 1-4-4L8 8a2.8 2.8 0 0 1 4 0'/%3E%3Cpath d='M14 10l1.5-1.5a2.8 2.8 0 0 1 4 4L16 16a2.8 2.8 0 0 1-4 0'/%3E%3Cline x1='10' y1='14' x2='14' y2='10'/%3E%3C/svg%3E") no-repeat center/contain;
}
.logo-icon::after { display: none; }
.logo-container {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}
.logo-container:hover { transform: translateY(-2px); }
.logo-container:hover .logo-icon { animation: pulse-icon 0.6s ease; }
@keyframes pulse-icon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.signup-button { background-color: #10B981; }
.signup-button:hover { background-color: #059669; }

.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #4f46e5, #7c3aed);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 80%; }

/* ===== Global Layout Fixes ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Main content spacing */
main {
    min-height: calc(100vh - 200px);
    position: relative;
}

/* Section spacing */
section {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    section {
        margin-bottom: 4rem;
    }
}

@media (min-width: 1024px) {
    section {
        margin-bottom: 5rem;
    }
}

/* Remove bottom margin on last section to prevent gap before footer */
main > section:last-of-type {
    margin-bottom: 0;
}

/* Improved heading hierarchy */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ===== Visual Enhancements ===== */

/* Subtle gradient overlays for depth */
.hero-gradient-overlay {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
}

/* Card hover effects */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Animated icons */
.icon-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== Call-to-Action Enhancements ===== */

/* Button shine effect */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-shine:hover::before {
    left: 100%;
}

/* Pulsing CTA button */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.btn-pulse {
    animation: pulse-ring 2s infinite;
}

/* ===== Trust Indicators ===== */

.trust-badge {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.trust-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Progress Indicators ===== */

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== Tooltips ===== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ===== Stats Counter Animation ===== */

.stat-number {
    font-variant-numeric: tabular-nums;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-animate {
    animation: countUp 0.8s ease-out;
}

/* ===== Section Dividers ===== */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 4rem 0;
}

/* ===== Image Optimization ===== */

img {
    max-width: 100%;
    height: auto;
}

/* Lazy loaded images fade in */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ===== Accessibility Enhancements ===== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4F46E5;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== Form Enhancements ===== */

/* Improved input focus states */
input:focus,
textarea:focus,
select:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Input validation states */
input.valid {
    border-color: #10B981;
}

input.invalid {
    border-color: #EF4444;
}

/* ===== Scroll Progress Indicator ===== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5, #7C3AED);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ===== Mobile Optimizations ===== */

@media (max-width: 768px) {
    /* Improved touch targets */
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better spacing on mobile */
    .mobile-spacing {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ===== Print Styles ===== */

@media print {
    /* Hide non-essential elements when printing */
    nav,
    footer,
    .no-print,
    #backToTop {
        display: none !important;
    }

    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* ===== Performance Optimizations ===== */

/* GPU acceleration for animations */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Dark Mode Support ===== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --text-primary: #e0e0e0;
        --border-color: #333;
    }

    /* Elements that should adapt to dark mode */
    .auto-dark-mode {
        background-color: var(--bg-primary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
}

/* ===== Utility Classes ===== */

/* Text gradients */
.text-gradient {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Smooth gradient backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Animated gradient */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}
