/* ============================================
   ESTILOS COMPARTIDOS - MVP HUERTO
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #4CAF50;
    --primary-earth: #8D6E63;
    --dark-green: #388E3C;
    --light-green: #81C784;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-light: #f8f9fa;
    --text-dark: #2d3748;
    --text-primary: #2d3748;
    --text-light: #718096;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Modo Oscuro */
body.dark-mode {
    --bg-primary: #2d3748;
    --bg-secondary: #1a202c;
    --bg-light: #1a202c;
    --text-primary: #e2e8f0;
    --text-dark: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-light: #a0aec0;
    --border-color: #2d3748;
    --shadow: rgba(0, 0, 0, 0.3);
}

body.dark-mode .navbar {
    background: #2d3748;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-links a {
    color: #e2e8f0 !important;
}

body.dark-mode .nav-links a:hover {
    color: var(--primary-green) !important;
}

body.dark-mode .nav-logo {
    color: #e2e8f0 !important;
}

/* Estilos especiales para links de navbar */
.collaborate-link {
    color: var(--primary-green) !important;
    font-weight: 600 !important;
}

.logout-link {
    color: #ff5252 !important;
}

body.dark-mode .footer {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

body.dark-mode .feature-card,
body.dark-mode .how-it-works-step,
body.dark-mode .faq-item {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .feature-card h3,
body.dark-mode .how-it-works-step h3,
body.dark-mode .faq-item h3 {
    color: #e2e8f0;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, rgba(56, 142, 60, 0.9) 0%, rgba(109, 76, 65, 0.9) 100%);
}

body.dark-mode .cta-section {
    background: linear-gradient(135deg, rgba(56, 142, 60, 0.9) 0%, rgba(109, 76, 65, 0.9) 100%);
}

body.dark-mode .features,
body.dark-mode .how-it-works {
    background: #1a202c;
}

body {
    font-family: "Outfit","Outfit Fallback";
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Navegación */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-green);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary-green);
}

.nav-cta {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Destacar el enlace del Planificador */
.nav-links a[href="/app/auth.html"],
.nav-links a[href="app/auth.html"] {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.nav-links a[href="/app/auth.html"]:hover,
.nav-links a[href="app/auth.html"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

/* Contenedor principal */
.main-content {
    padding-top: 80px;
    min-height: 100vh;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-earth));
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 1rem 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.9rem;
}

/* Botones generales */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background: var(--primary-green);
    color: white;
}

/* Menú Hamburguesa */
.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    background: transparent;
    border: none;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

body.dark-mode .hamburger-menu span {
    background: var(--text-primary);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: var(--bg-primary) !important;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 1rem 2rem;
        gap: 0.5rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 1001;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 10px 12px;
        font-size: 0.95rem;
        border-radius: 6px;
        transition: background 0.2s;
    }
    
    .nav-links a:hover {
        background: var(--bg-secondary);
    }
    
    /* Agrupar elementos de control al final del menú */
    .nav-links li:nth-child(6),
    .nav-links li:nth-child(8),
    .nav-links li:nth-child(9),
    .nav-links li:nth-child(10) {
        margin-top: auto;
        padding-top: 0.5rem;
        border-top: 1px solid var(--bg-secondary);
    }
    
    /* Sección de controles: compacta y horizontal */
    .nav-links li:nth-child(6),
    .nav-links li:nth-child(8),
    .nav-links li:nth-child(9) {
        width: auto;
        display: flex;
        align-items: center;
        padding: 8px 12px;
    }
    
    /* Plan badge - prominente */
    .nav-links li:nth-child(8) {
        width: 100%;
        margin-top: 1rem;
        margin-bottom: 0;
        padding-top: 1rem;
        border-top: 2px solid var(--primary-green);
    }
    
    /* Logout link - al final */
    .nav-links li:nth-child(9) {
        width: 100%;
        margin-top: auto;
    }
    
    .logout-link {
        color: #e74c3c !important;
    }
    
    .logout-link:hover {
        background: rgba(231, 76, 60, 0.1) !important;
    }
    
    /* Overlay cuando el menú está abierto */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
