/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
    /* Paleta de Colores */
    --primary: #00427c;
    --primary-light: #007bff;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;

    /* Sombras y Bordes */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark);
    line-height: 1.6;
}

/* ==========================================================================
   2. LAYOUT (ESTRUCTURA)
   ========================================================================== */
.app-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.app-container--wide {
    max-width: 1400px;
}

.main-content {
    margin-top: 2rem;
}

/* Layout de dos columnas (Split View) */
.l-split-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.l-split-layout__sidebar {
    flex: 1;
    position: sticky;
    top: 1rem;
}

.l-split-layout__main {
    flex: 1.5;
}

/* Grid genérico */
.l-grid {
    display: grid;
    gap: 1.5rem;
}

.l-grid--2-cols {
    grid-template-columns: 1fr 1fr;
}

/* Flex helpers */
.l-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* ==========================================================================
   3. COMPONENTES (C-CARD, C-BUTTON, C-INPUT)
   ========================================================================== */

.c-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.c-card__header {
    padding: 1.25rem;
    border-bottom: 1px solid #edf2f7;
    background-color: rgba(0,0,0,0.01);
}

.c-card__body {
    padding: 1.5rem;
}

.c-card__footer {
    padding: 1.25rem;
    background-color: #fdfdfd;
    border-top: 1px solid #edf2f7;
}

.c-card--highlight {
    border-top: 5px solid var(--primary);
}

/* Botones */
.c-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 0.95rem;
}

.c-button--primary { background: var(--primary); color: var(--white); }
.c-button--primary:hover { background: #003360; }

.c-button--secondary { background: var(--secondary); color: var(--white); }

.c-button--success { background: var(--success); color: var(--white); }

.c-button--outline { 
    background: transparent; 
    border-color: var(--primary); 
    color: var(--primary); 
}

.c-button--full { width: 100%; }

/* Inputs y Formularios */
.c-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 1rem;
}

.c-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.c-input--readonly {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.c-well {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary);
}

.c-well--success {
    background: #e8f5e9;
    border-left-color: var(--success);
}

/* ==========================================================================
   4. ELEMENTOS ESPECÍFICOS (VIEWER, ESTRELLAS)
   ========================================================================== */

/* Visor de Documentos */
.c-viewer-container {
    background: #525659;
    padding: 10px;
    border-radius: 4px;
}

.c-viewer-iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 4px;
    background: white;
}

/* Sistema de Estrellas */
.c-rating-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    margin: 1rem 0;
}

.c-rating-stars input { display: none; }

.c-rating-stars label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.c-rating-stars label:hover,
.c-rating-stars label:hover ~ label,
.c-rating-stars input:checked ~ label {
    color: #ffc107;
}

/* ==========================================================================
   5. ESTADOS Y UTILIDADES
   ========================================================================== */
.is-hidden {
    display: none !important;
}

.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.5);
}

.c-status-message {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .l-split-layout { flex-direction: column; }
    .l-grid--2-cols { grid-template-columns: 1fr; }
    .app-container { margin: 1rem auto; }
}


/* ========================================= */
/* x: para el INFO 
/* ========================================= */

/* --- CONFIGURACIÓN BASE (Igual que antes) --- */
.info-criterios {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    padding: 5px; /* ÁREA DE TOQUE MÁS GRANDE PARA MÓVILES */
    cursor: pointer;
	z-index:10;
	font-size: 0.8em;
}

/* 1. Ajuste del contenedor del Tooltip */
.info-tooltip {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 100;
    bottom: 125%; 
	font-size: 0.8em;
    
    /* CAMBIO CLAVE: Alineamos a la izquierda del icono en lugar del centro */
    left: 0; 
    margin-left: -10px; /* Un pequeño margen para que no esté pegado al borde */
    
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
}

/* 2. Ajuste de la flechita (para que apunte al icono) */
.info-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    
    /* CAMBIO CLAVE: La flecha ahora debe estar a la izquierda, sobre el icono */
    left: 20px; 
    
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* 3. Ajuste para pantallas muy pequeñas (Móviles) */
@media screen and (max-width: 480px) {
    .info-tooltip {
        width: 220px; /* Un poco más estrecho en móvil */
        left: -5px;   /* Ajuste fino para bordes */
    }
}




/* --- LOGICA PARA PC (HOVER) --- */
@media (hover: hover) {
    .info-criterios:hover .info-tooltip {
        visibility: visible;
        opacity: 1;
    }
}

/* --- LOGICA PARA TÁCTIL (CLICK/TAP) --- */
/* Usamos una clase que activaremos con JS para que al tocar aparezca y desaparezca */
.info-criterios.is-active .info-tooltip {
    visibility: visible;
    opacity: 1;
}


/* Opcional: Estilo para los ítems de esa lista específica */
.info-criterios ul li {
    list-style-type: none; /* Quita las viñetas */
    padding: 0;           /* Quita la sangría automática del navegador */
    margin: 0;            /* Quita márgenes externos */
    border-bottom: 1px solid #444; /* Una línea divisoria sutil */
}

.info-tooltip  ul li {
    list-style-type: none; /* Quita las viñetas */
    padding: 0;           /* Quita la sangría automática del navegador */
    margin: 0;            /* Quita márgenes externos */
    border-bottom: 1px solid #444; /* Una línea divisoria sutil */
}


/* ========================================= */
/* 1. Reset y Variables */
/* ========================================= */
:root {
    --primary-color: #007bff; /* Azul */
    --secondary-color: #6c757d; /* Gris */
    --background-color: #f8f9fa; /* Fondo claro */
    --text-color: #343a40; /* Texto oscuro */
    --border-radius: 8px;
    --spacing: 1.5rem;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: var(--spacing) auto;
    padding: 0 var(--spacing);
}

/* ========================================= */
/* 2. Estilos Comunes (Formularios y Botones) */
/* ========================================= */
.card {
    background: #ffffff;
    padding: var(--spacing);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--spacing);
}

input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    box-sizing: border-box; /* Importante para el padding */
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* Estilos de alerta/estado */
.status-message {
    padding: 10px;
    margin-top: 10px;
    border-radius: var(--border-radius);
    font-weight: bold;
}
.status-success { background-color: #d4edda; color: #155724; }
.status-error { background-color: #f8d7da; color: #721c24; }


/* ========================================= */
/* 3. Estilos Específicos (Responsive Layout) */
/* ========================================= */

/* Diseño para la página de Responder (respuestas.html) */
.answers-layout {
    display: flex;
    flex-direction: column; /* Apilados por defecto (móvil) */
    gap: var(--spacing);
}

.questions-panel, .document-panel {
    padding: var(--spacing);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    background-color: #ffffff;
}

/* Media Query para Tablet y Escritorio */
@media (min-width: 768px) {
    .answers-layout {
        flex-direction: row; /* En línea en pantallas grandes */
        align-items: flex-start;
    }
    .questions-panel {
        flex: 2; /* Ocupa 2/3 del espacio */
        min-width: 0;
    }
    .document-panel {
        flex: 1; /* Ocupa 1/3 del espacio */
        min-width: 0;
    }
    .document-panel iframe {
        height: 80vh; /* Altura para el documento PDF */
    }
}

/* Estilos para la interfaz de Puntuación (revision.html) */
.review-item {
    padding: 15px;
    border-bottom: 1px dashed #ccc;
    cursor: pointer;
    transition: background-color 0.2s;
}
.review-item:hover {
    background-color: #e9ecef;
}

.scoring-options input[type="radio"] {
    display: none; /* Ocultar el radio button nativo */
}
.scoring-options label {
    padding: 5px 10px;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    display: inline-block;
}
.scoring-options input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}


.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; font-size: 2em; }
.star-rating input { display: none; }
.star-rating label { color: #ddd; cursor: pointer; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #f5b301; }

/* cuando se selecciona zero-r */
.star-rating .zero-r:checked + label {
  color: red;
}

/* evita que otras estrellas se pinten cuando zero-r está activo */
.star-rating .zero-r:checked ~ label {
  color: red;
}
.star-rating .zero-r:hover ~ label {
  color: red;
}