/* css/global.css - Estilos CSS Profesionales y de Alta Estética (Tema Claro) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta de colores profesional e institucional (Sin fondo negro) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --secondary: #475569;
    --secondary-hover: #334155;
    --secondary-light: #f1f5f9;
    
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    /* Colores del semáforo de clima laboral */
    --clr-superior: #7fc29b;
    --clr-fortaleza: #b5ef8a;
    --clr-promedio: #d7f171;
    --clr-debilidad: #f0803c;
    --clr-critico: #e9190f;
    
    /* Sombras y bordes */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
}

/* Layout General */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-surface);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 550;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background-color: var(--secondary-light);
    color: var(--secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.btn-danger {
    background-color: var(--clr-critico);
    color: white;
}

.btn-danger:hover {
    background-color: #c2150a;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Formularios */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    font-family: inherit;
    font-size: 14.5px;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    resize: vertical;
}

/* Tablas */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    background-color: var(--secondary-light);
    color: var(--secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

tr:hover td {
    background-color: var(--primary-light);
}

/* Mapa de Calor */
.cell-val {
    font-weight: bold;
    text-align: center;
    color: var(--text-main);
    border-radius: 4px;
    padding: 6px;
    font-size: 13px;
}

.bg-superior { background-color: var(--clr-superior); color: #064e3b; }
.bg-fortaleza { background-color: var(--clr-fortaleza); color: #1e3a1e; }
.bg-promedio { background-color: var(--clr-promedio); color: #3f4e04; }
.bg-debilidad { background-color: var(--clr-debilidad); color: #7c2d12; }
.bg-critico { background-color: var(--clr-critico); color: #ffffff; }

/* Grid de Informes */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 8px 0;
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Paginación de Encuesta */
.survey-page {
    display: none;
}

.survey-page.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.survey-question {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.survey-question-text {
    font-size: 15.5px;
    font-weight: 550;
    margin-bottom: 12px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 768px) {
    .options-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 12px;
    }
}

.option-btn {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.option-btn:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.option-btn.selected {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Utility classes */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

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

/* Footer Global */
.app-footer-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3.5rem;
    padding: 1.25rem 2rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 13.5px;
    color: var(--text-muted);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-footer-brand:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.app-footer-brand p {
    margin: 0;
    font-weight: 500;
}
.app-footer-brand a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
}
.app-footer-brand a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary);
}
