:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #121212;
    --light: #f8f9fa;
    --bg: #0a0a0b;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--text);
}

/* Hero Section */
.hero {
    padding: 10rem 0 5rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.15) 0%, transparent 70%);
    z-index: -1;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    max-width: 110%;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transform: perspective(1000px) rotateY(-5deg);
    transition: var(--transition);
}

.hero-image:hover img {
    transform: perspective(1000px) rotateY(-2deg) scale(1.02);
}

/* Features */
.features {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    transition: var(--transition);
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
}

.card h3 {
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
}

/* Stats */
.stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item h4 {
    font-size: 2rem;
    color: var(--primary);
}

.stat-item span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-image {
    animation: fadeIn 1s ease-out 0.2s both;
}

/* Responsive */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* Responsive */
@media (max-width: 968px) {

    /* Navigation */
    .mobile-menu-btn {
        display: block;
    }

    .nav-links,
    .nav-auth {
        position: fixed;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 11, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 2rem;
        transition: var(--transition);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        z-index: 1000;
    }

    .nav-links {
        top: 0;
        padding-top: 80px;
        /* Espacio para el logo */
        height: auto;
    }

    .nav-auth {
        top: 240px;
        /* Debajo de los links */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border-bottom: 1px solid var(--glass-border);
        padding-top: 0;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        display: flex;
    }

    .nav-auth.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        display: flex;
        top: 240px;
        /* Mantener posición debajo de links */
        position: fixed;
        /* Asegurar que flote igual que nav-links */
    }

    /* Ocultar auth de la barra principal en móvil */
    nav>.nav-auth:not(.active) {
        display: none;
    }

    .nav-auth .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    nav {
        /* Permitir que los elementos salgan del flujo si es necesario */
        position: relative;
    }

    /* Hero */
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem !important;
    }

    .hero {
        padding-top: 8rem;
        height: auto;
        min-height: auto;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-content {
        margin-bottom: 2rem;
        width: 100%;
    }

    .hero-actions {
        justify-content: center;
        display: flex;
    }

    .stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .hero-image img {
        max-width: 80%;
        margin: 0 auto;
        display: block;
        transform: none !important;
    }

    /* Glass Section */
    .flex-container {
        flex-direction: column;
        gap: 3rem !important;
        /* Override inline styles if any */
    }

    .image-container {
        order: -1;
        /* Image first on mobile usually */
        width: 100%;
        text-align: center;
    }

    .feature-image {
        max-width: 80% !important;
    }

    .section-title h2 {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .stats {
        gap: 1rem;
    }
}

/* ========================================
   PWA STYLES
   ======================================== */

/* Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #007BFF 0%, #0056b3 100%);
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: bottom 0.3s ease-out;
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-install-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    color: white;
}

.pwa-install-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.pwa-install-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-btn {
    white-space: nowrap;
    background: white;
    color: #007BFF;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwa-install-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9998;
    transition: top 0.3s ease-out;
}

.offline-indicator.show {
    top: 0;
}

.offline-indicator i {
    font-size: 1.2rem;
}

/* Update Notification */
.update-notification {
    position: fixed;
    bottom: -80px;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9997;
    transition: bottom 0.3s ease-out;
}

.update-notification.show {
    bottom: 2rem;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.update-content i {
    font-size: 1.5rem;
}

.update-content span {
    font-weight: 600;
}

.update-content .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: white;
    color: #10b981;
}

/* Standalone Mode (cuando está instalada) */
body.standalone {
    /* Ajustes específicos para modo standalone */
}

body.standalone header {
    /* Más padding top para compensar la barra de estado en móviles */
    padding-top: env(safe-area-inset-top, 1.5rem);
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Dispositivos táctiles */
    .btn,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Prevenir zoom accidental */
    input,
    select,
    textarea {
        font-size: 16px;
    }
}

/* Responsive PWA Styles */
@media (max-width: 768px) {
    .pwa-install-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .pwa-install-icon {
        width: 40px;
        height: 40px;
    }

    .pwa-install-text {
        flex-basis: 100%;
        order: -1;
        margin-bottom: 0.5rem;
    }

    .pwa-install-btn {
        flex: 1;
    }

    .update-notification {
        right: 1rem;
        left: 1rem;
    }
}