/* 
   HOJA DE ESTILOS CSS - EVALUACIÓN DE SOSTENIBILIDAD PERSONAL
   Estilos completamente renovados con enfoque ecológico y accesibilidad
*/

/* ===== RESET Y CONFIGURACIONES GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Asegura que padding y border no afecten el ancho total */
}

:root {
    /* Nueva paleta de colores ecológicos - Verde bosque y terracota */
    --color-primary: #2E8B57;        /* Verde principal - representa sostenibilidad */
    --color-primary-dark: #1F6F47;   /* Verde oscuro para contraste */
    --color-primary-light: #3CA374;  /* Verde claro para estados hover */
    --color-secondary: #E76F51;      /* Terracota - color de acento */
    --color-accent: #F4A261;         /* Naranja suave para destacar */
    --color-neutral: #A8D5BA;        /* Verde neutro para fondos suaves */
    --color-background: #F8FBF9;     /* Fondo principal muy claro */
    --color-surface: #FFFFFF;        /* Superficies de tarjetas y formularios */
    --color-text: #2D3748;           /* Texto principal con buen contraste */
    --color-text-light: #4A5568;     /* Texto secundario */
    --color-border: #E2E8F0;         /* Bordes sutiles */
    --color-error: #E53E3E;          /* Rojo para errores */
    --color-success: #38A169;        /* Verde para éxitos */
    
    /* Tipografía - Fuentes modernas y legibles */
    --font-primary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-secondary: 'Poppins', Arial, sans-serif;
    
    /* Espaciado - Sistema consistente */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-xxl: 3rem;     /* 48px */
    
    /* Bordes y efectos visuales */
    --border-radius: 8px;        /* Bordes redondeados estándar */
    --border-radius-lg: 12px;    /* Bordes más redondeados */
    --shadow: 0 2px 8px rgba(46, 139, 87, 0.08);         /* Sombra suave */
    --shadow-lg: 0 8px 25px rgba(46, 139, 87, 0.12);     /* Sombra media */
    --shadow-hover: 0 12px 35px rgba(46, 139, 87, 0.18); /* Sombra hover */
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;                          /* Mejor legibilidad */
    color: var(--color-text);
    background: linear-gradient(135deg, #f0f7f4 0%, #e8f4ee 100%); /* Gradiente sutil */
    min-height: 100vh;                         /* Ocupa toda la pantalla */
    padding: var(--spacing-md);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container {
    max-width: 950px;                          /* Ancho máximo óptimo para lectura */
    margin: 0 auto;                            /* Centrado horizontal */
    background-color: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);              /* Sombra elevada */
    overflow: hidden;                          /* Evita que los hijos sobresalgan */
    border: 1px solid var(--color-border);     /* Borde sutil */
}

/* ===== CABECERA ===== */
.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;                          /* Contiene los efectos de fondo */
}

/* Efecto de superposición con gradientes radiales */
.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 15% 20%, rgba(244, 162, 97, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(168, 213, 186, 0.15) 0%, transparent 40%);
    pointer-events: none;                      /* No interfiere con clicks */
}

.header h1 {
    font-family: var(--font-secondary);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;                                /* Encima del fondo */
    letter-spacing: -0.5px;                    /* Espaciado más compacto */
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;                              /* Texto ligeramente transparente */
    font-weight: 400;
    position: relative;
    z-index: 1;
    max-width: 600px;                          /* Ancho máximo para mejor lectura */
    margin: 0 auto;                            /* Centrado */
}

.requerido {
    color: var(--color-accent);                /* Destaca campos obligatorios */
    font-weight: 700;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    padding: var(--spacing-xl);
}

/* ===== SECCIONES DEL FORMULARIO ===== */
.form-section {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transición suave */
    position: relative;
    overflow: hidden;
}

/* Borde lateral decorativo con gradiente */
.form-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
}

/* Efecto hover para las secciones */
.form-section:hover {
    transform: translateY(-3px);               /* Levanta ligeramente */
    box-shadow: var(--shadow-hover);           /* Sombra más pronunciada */
}

.section-title {
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 1.4rem;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Icono decorativo antes del título */
.section-title::before {
    content: "🌿";                             /* Emoji ecológico */
    margin-right: var(--spacing-sm);
    font-size: 1.3rem;
}

/* ===== GRUPOS DE FORMULARIO ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--color-text);
    font-size: 1rem;
    transition: color 0.2s ease;               /* Transición suave para hover */
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;                 /* Transición para todos los cambios */
    background-color: white;
    font-family: inherit;                      /* Hereda la fuente del body */
}

/* Estados del input */
.form-input:focus {
    outline: none;
    border-color: var(--color-primary);        /* Borde verde al enfocar */
    background-color: white;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1); /* Sombra de enfoque */
}

/* Validación visual para inputs incorrectos */
.form-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--color-error);
    background-color: rgba(229, 62, 62, 0.03); /* Fondo rojo muy suave */
}

.form-help {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: normal;
}

/* ===== GRUPOS DE RADIO Y CHECKBOX ===== */
.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;                           /* Permite que se envuelvan en móvil */
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    margin-right: var(--spacing-md);
    position: relative;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin-right: var(--spacing-sm);
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);        /* Color personalizado para inputs */
    cursor: pointer;
}

.radio-option label,
.checkbox-option label {
    font-weight: normal;
    cursor: pointer;
    transition: color 0.2s ease;
}

/* Efecto hover en las etiquetas */
.radio-option:hover label,
.checkbox-option:hover label {
    color: var(--color-primary);
}

/* ===== CONTENEDOR DE ERRORES ===== */
.error-container {
    background: linear-gradient(to right, rgba(229, 62, 62, 0.05), rgba(229, 62, 62, 0.02));
    border-left: 4px solid var(--color-error); /* Borde lateral rojo */
    color: var(--color-error);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    display: none;                             /* Oculto por defecto */
    font-weight: 500;
}

.error-container.show {
    display: block;
    animation: slideIn 0.4s ease-out;          /* Animación al mostrar */
}

/* ===== BOTONES MEJORADOS - DISEÑO COMPLETAMENTE RENOVADO ===== */
.form-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xxl);
    flex-wrap: wrap;                           /* En móvil se apilan */
    position: relative;
}

/* Línea decorativa sobre los botones */
.form-buttons::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transición personalizada */
    min-width: 220px;                          /* Ancho mínimo consistente */
    position: relative;
    overflow: hidden;                          /* Para el efecto de brillo */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Efecto de brillo al hacer hover */
.btn::after {
    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:hover::after {
    left: 100%;                                /* Animación del brillo */
}

/* Botón principal - Verde */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(46, 139, 87, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);               /* Efecto de levitación */
    box-shadow: 0 10px 25px rgba(46, 139, 87, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);               /* Feedback al presionar */
}

/* Botón secundario - Neutral */
.btn-secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--color-primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    margin-right: var(--spacing-sm);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: scale(1.1);                     /* Icono ligeramente más grande */
}

/* ===== PIE DE PÁGINA ===== */
.footer {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    text-align: center;
    padding: var(--spacing-lg);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

/* Patrón de fondo sutil */
.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm10 10h20v20H10V10z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.footer p {
    position: relative;
    z-index: 1;                                /* Encima del patrón de fondo */
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(10px);           /* Entra desde abajo */
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(-20px);          /* Entra desde la izquierda */
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== MEJORAS DE ESTADO ===== */
.form-input:valid:not(:placeholder-shown) {
    border-color: var(--color-success);        /* Borde verde para inputs válidos */
    background-color: rgba(56, 161, 105, 0.02);
}

/* Personalización del select */
select.form-input {
    appearance: none;                          /* Elimina el estilo por defecto */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232E8B57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;                       /* Espacio para la flecha */
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
        box-shadow: none;
        border: none;                          /* En móvil, sin bordes */
    }
    
    body {
        padding: 0;
        background: var(--color-surface);      /* Fondo simple en móvil */
    }
    
    .header {
        padding: var(--spacing-lg);
    }
    
    .header h1 {
        font-size: 2rem;                       /* Título más pequeño */
    }
    
    .main-content {
        padding: var(--spacing-lg);
    }
    
    .form-buttons {
        flex-direction: column;                /* Botones en columna */
        align-items: stretch;
    }
    
    .btn {
        width: 100%;                           /* Botones a ancho completo */
    }
    
    .radio-group, .checkbox-group {
        flex-direction: column;                /* Opciones en columna */
        gap: var(--spacing-sm);
    }
    
    .form-section::before {
        width: 3px;                            /* Borde lateral más fino */
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.7rem;                     /* Título aún más pequeño */
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .form-section {
        padding: var(--spacing-md);            /* Menos padding en móvil */
    }
    
    .btn {
        padding: 14px 24px;
        min-width: auto;                       /* Ancho automático */
    }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn::after {
        display: none;                         /* Elimina efectos de movimiento */
    }
}

/* Enfocado para teclado - importante para accesibilidad */
.form-input:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Modo alto contraste */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000000;
        --color-border: #000000;
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .form-input {
        border-width: 2px;                     /* Bordes más gruesos */
    }
}

/* Estilos para compartir en redes sociales */
.modal-compartir {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);           /* Fondo semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;                             /* Por encima de todo */
}

.modal-contenido {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.redes-sociales {
    display: grid;
    grid-template-columns: 1fr 1fr;            /* Dos columnas */
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn-red-social {
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* Colores específicos de cada red social */
.btn-red-social.facebook { background: #3b5998; }
.btn-red-social.twitter { background: #1da1f2; }
.btn-red-social.linkedin { background: #0077b5; }
.btn-red-social.whatsapp { background: #25d366; }

/* Estilos para gráficos */
.chart-container {
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;                        /* Centrado */
}

/* Estilos para comparativa */
.comparativa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive */
    gap: 1rem;
    margin-top: 1rem;
}

.comparativa-item {
    display: flex;
    justify-content: space-between;            /* Espacio entre texto y valor */
    padding: 0.75rem;
    background: #f8f9fa;                       /* Fondo gris suave */
    border-radius: 4px;
}

/* Diferencias positivas y negativas */
.diferencia.positiva {
    color: #2e7d32;                            /* Verde para positivo */
    font-weight: bold;
}

.diferencia.negativa {
    color: #d32f2f;                            /* Rojo para negativo */
    font-weight: bold;
}

/* Estilos para sistema de login */
.login-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Grid para mostrar evaluaciones anteriores */
.evaluaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.evaluacion-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.evaluacion-card .puntuacion {
    font-size: 2rem;
    font-weight: bold;
    color: #2e7d32;                            /* Verde para puntuaciones */
    margin: 0.5rem 0;
}
/* ============================================ */
/* ESTILOS ADICIONALES PARA SISTEMA DE STORAGE */
/* ============================================ */
/* Agregar estos estilos dentro del tag <style> en index.php, después de los estilos existentes */

/* Estilos para el botón de configuración */
.btn-config {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-config:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Modal de configuración */
.modal-config {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-config.active {
    display: flex;
}

.modal-contenido-config {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-config h2 {
    color: #2e7d32;
    margin-top: 0;
    border-bottom: 2px solid #2e7d32;
    padding-bottom: 1rem;
}

.config-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.config-section h3 {
    color: #333;
    margin-top: 0;
    font-size: 1.3rem;
}

.config-section p {
    color: #666;
    line-height: 1.6;
}

.config-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-config-action {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-info {
    background-color: #3498db;
    color: white;
}

.btn-info:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-cerrar-modal {
    background-color: #95a5a6;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 2rem;
    width: 100%;
    font-size: 1rem;
}

.btn-cerrar-modal:hover {
    background-color: #7f8c8d;
}

.storage-info {
    background: #e8f5e9;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #2e7d32;
    margin: 1rem 0;
}

.storage-info h4 {
    color: #2e7d32;
    margin-top: 0;
}

.storage-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.storage-info li {
    margin: 0.3rem 0;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Actualización de responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-contenido-config {
        width: 95%;
        padding: 1.5rem;
    }
    
    .config-buttons {
        flex-direction: column;
    }
    
    .btn-config-action {
        width: 100%;
        justify-content: center;
    }
}