/* ===============================================
   ESTACASCAN - Landing Page Styles
   Tema oscuro con animación de plantita
   =============================================== */

/* Variables CSS */
:root {
    --color-bg: #0a1929;
    --color-bg-light: #0d2137;
    --color-bg-card: #132f4c;
    --color-surface: #1a3a5c;

    --color-primary: #10b981;
    --color-primary-light: #34d399;
    --color-primary-dark: #059669;

    --color-text: #ffffff;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;

    --color-border: rgba(255, 255, 255, 0.1);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.3);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 500ms ease;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Landing Container */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Background Particles */
.bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    /* width/height se definen en JS para variedad */
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
    will-change: transform; /* Optimización para GPU */
}

/* @keyframes float-particle eliminada, ahora controlado por JS */

/* Main Content */
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 24px;
    z-index: 1;
}

/* Logo Container */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Plant Animation */
.plant-animation {
    width: 140px;
    height: 168px;
    position: relative;
}

.plant-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.3));
}

/* Plant Growing Animation */
.stem-main {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: grow-stem 1.5s ease-out 0.3s forwards;
}

@keyframes grow-stem {
    to {
        stroke-dashoffset: 0;
    }
}

.leaf {
    opacity: 0;
    transform-origin: bottom center;
    transform: scale(0);
}

.leaf-1 {
    animation: grow-leaf 0.6s ease-out 1s forwards;
}

.leaf-2 {
    animation: grow-leaf 0.6s ease-out 1.3s forwards;
}

.leaf-3 {
    animation: grow-leaf 0.6s ease-out 1.6s forwards;
}

.leaf-4 {
    animation: grow-leaf 0.6s ease-out 1.9s forwards;
}

@keyframes grow-leaf {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Subtle leaf sway after growing */
.plant-svg:hover .leaf {
    animation: sway 2s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(3deg);
    }
    75% {
        transform: rotate(-3deg);
    }
}

/* Pot subtle bounce */
.pot, .pot-rim, .pot-soil {
    animation: pot-appear 0.5s ease-out forwards;
}

@keyframes pot-appear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* App Title */
.app-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 2px;
    animation: title-fade-in 0.8s ease-out 0.5s both;
}

.title-estaca {
    color: var(--color-text);
}

.title-scan {
    color: var(--color-primary);
}

@keyframes title-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-subtitle {
    font-size: 16px;
    color: var(--color-text-secondary);
    font-weight: 500;
    animation: title-fade-in 0.8s ease-out 0.7s both;
}

/* Model Status */
.model-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: title-fade-in 0.8s ease-out 1s both;
}

.model-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.model-status.ready .loading-dot {
    animation: none;
    background: var(--color-primary);
}

.model-status.ready .model-loading {
    color: var(--color-primary);
}

.model-progress {
    width: 200px;
    height: 3px;
    background: var(--color-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.model-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.model-status.ready .model-progress {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

/* Start Button */
.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: title-fade-in 0.8s ease-out 1.2s both;
    box-shadow: var(--shadow-glow);
}

.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-start:not(:disabled):hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 40px rgba(16, 185, 129, 0.5);
}

.btn-start:not(:disabled):active {
    transform: translateY(-1px) scale(0.98);
}

.btn-icon {
    transition: transform var(--transition-fast);
}

.btn-start:not(:disabled):hover .btn-icon {
    transform: translateX(4px);
}

/* Landing Hint */
.landing-hint {
    font-size: 14px;
    color: var(--color-text-muted);
    animation: title-fade-in 0.8s ease-out 1.4s both;
}

/* Footer */
.landing-footer {
    position: absolute;
    bottom: 24px;
    font-size: 12px;
    color: var(--color-text-muted);
    animation: title-fade-in 0.8s ease-out 1.6s both;
}

/* Responsive */
@media (max-width: 640px) {
    .app-title {
        font-size: 36px;
    }

    .plant-animation {
        width: 120px;
        height: 144px;
    }

    .btn-start {
        padding: 16px 40px;
        font-size: 16px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
