/* styles.css */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    overflow-x: hidden; /* Previene el scroll horizontal en el body */
}


.container {
    width: 100%; /* Ahora ocupa el 100% del espacio disponible */
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-sizing: border-box; /* Asegura que padding se incluye en el width */
}

/* --- ESTILOS DE CABECERA --- */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 5px 0;
}

.header-content h1 {
    margin: 0;
    flex-grow: 1;
    text-align: left;
    font-size: 1.5em; /* Título principal reducido */
}

.user-info {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
    margin-right: 10px;
}

.logout-button {
    padding: 5px 10px;
    font-size: 0.8em;
    cursor: pointer;
    background-color: #dc3545; /* Rojo */
    color: white;
    border: none;
    border-radius: 4px;
    white-space: nowrap;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.employee-count {
    font-weight: bold;
    color: #0056b3;
    background-color: #e0f2f7;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 0.85em;
}

.filter-controls label {
    font-weight: bold;
    color: #555;
    font-size: 0.85em;
}

.filter-controls select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-size: 0.85em;
    cursor: pointer;
}

/* Contenedor principal de la tabla para el scroll horizontal */
.table-container {
    overflow-x: auto;
    width: 100%;
    margin-top: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

/* Estilos base para todas las celdas de la tabla */
th, td {
    padding: 6px 4px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 0.85em;
    position: relative;
    box-sizing: border-box;
}

/* Ancho específico para las celdas de los días (columnas 01, 02, etc.) */
th:not(:first-child), td:not(:first-child) {
    /* Los anchos se distribuirán automáticamente por table-layout: fixed */
}

/* Cabeceras */
thead th {
    background-color: #007bff;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Primera columna de la tabla (Nombres de Empleados) */
tbody tr td:first-child {
    text-align: left;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 20; /* Z-index alto para que esté por encima de las cabeceras */
    min-width: 120px; /* <-- ESTO DEFINE EL ANCHO MÍNIMO */
    width: 120px;    /* <-- ESTO DEFINE EL ANCHO PREFERENTE */
    overflow: hidden; /* Esto es importante si el texto se trunca, y se combina con text-overflow */
    text-overflow: ellipsis; /* Para los '...' si el texto es muy largo */
    white-space: nowrap; /* Para que el texto no salte de línea */
}

/* CABECERA DE LA PRIMERA COLUMNA ('Empleado') */
#headerRowPlaceholder {
    background-color: #007bff;
    color: white;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 15;
    text-align: left;
    min-width: 120px;
    width: 120px;
    font-size: 0.85em;
}

/* Estilo para el texto del nombre del empleado dentro de la celda */
.employee-name-text {
    display: block; /* Ocupa todo el ancho disponible dentro del TD */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* El 100% del padre (el TD) */
    font-size: 0.78em;
    box-sizing: border-box;
    padding: 0;
    cursor: pointer; /* Indicador de que es clicable */
}

/* Clases para los colores de las celdas */
.green-cell {
    background-color: #d4edda;
    color: #155724;
}

.orange-cell {
    background-color: #fff3cd;
    color: #856404;
}

.red-cell {
    background-color: #f8d7da;
    color: #721c24;
}

.blue-cell {
    background-color: #cce5ff;
    color: #004085;
}

/* Clase para días sin horas planeadas (ej. fines de semana o festivos) */
.no-hours-planned-cell {
    background-color: #e9ecef;
    color: #6c757d;
}

/* --- Clases para los Totales Mensuales en el Nombre del Empleado --- */
.employee-name.total-green {
    background-color: #d4edda;
    font-weight: bold;
    color: #155724;
}

.employee-name.total-red {
    background-color: #f8d7da;
    font-weight: bold;
    color: #721c24;
}

.employee-name.total-yellow {
    background-color: #fff3cd;
    font-weight: bold;
    color: #856404;
}

/* --- ESTILOS DEL MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Ancho de todo el viewport */
    height: 100vh; /* Alto de todo el viewport */
    background-color: rgba(0, 0, 0, 0.6); /* Fondo semitransparente oscuro */
    display: flex;
    justify-content: center; /* Centra horizontalmente */
    align-items: center; /* Centra verticalmente */
    z-index: 1000; /* Asegura que esté por encima de todo */
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 700px; /* Ancho máximo del modal */
    max-height: 80vh; /* Altura máxima del modal, permitiendo scroll si el contenido es largo */
    overflow-y: auto; /* Habilita el scroll vertical si el contenido excede max-height */
    position: relative; /* Para posicionar el botón de cerrar */
    font-size: 0.9em; /* Tamaño de fuente general del modal */
    color: #333;
}

.modal-content h2 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.8em;
}

.modal-content h3 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    font-size: 1.2em;
}

.modal-content p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-content ul li {
    background-color: #f9f9f9;
    margin-bottom: 5px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.modal-close-button:hover {
    color: #333;
}

.error {
    color: red;
    text-align: center;
    font-weight: bold;
}

/* --- ESTILOS PARA EL TOOLTIP (general) --- */
/* Esta clase debe estar en tu CSS para que los tooltips funcionen en los días */
.tooltip {
    position: relative;
    /* display: inline-block;  O BLOCK, dependiendo del elemento, para TD suele ser un comportamiento por defecto en table-cell */
}



.tooltip .tooltiptext {
    visibility: hidden;
    width: 115px; /* Ancho del tooltip */
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%; /* Posición encima de la celda */
    left: 50%;
    margin-left: -60px; /* Centrar tooltip */
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.7em; /* Tamaño de fuente más pequeño para el tooltip */
    pointer-events: none; /* Asegura que el tooltip no interfiera con eventos de ratón */
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%; /* Flecha apuntando hacia abajo */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}



#headerRowPlaceholder_dayOfWeek {
    width: 150px;
    min-width: 150px;
    box-sizing: border-box;
}



/* public/styles.css */
.daily-imputation-summary {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}
.daily-imputation-summary h4 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
}
.daily-project-list {
    list-style: none;
    padding-left: 0;
    margin-top: 5px;
}
.daily-project-list li {
    margin-bottom: 3px;
    font-size: 0.9em;
    color: #555;
}