﻿:root {
    --accent-hover: #ff69b4;
    --accent: #ff1493;
    --text-color: #ffffff;
    --background-dark: #212121;
    --estado-sin-cambios: #2ecc71;
    --estado-modificado: #ff4d4d;
    --header-bg: #D8ACC7;
    --row-hover: #333333;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #212121;
    color: var(--text-color);
}

header {
    background-color: #D8ACC7 !important;
    height: 110px !important;
}

.main-header {
    background-color: #D8ACC7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-sizing: border-box;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
}

.header-left {
    flex-direction: column;
    justify-content: center;
}

.logo {
    width: 100px;   /* antes era 50px */
    height: 100px;
    object-fit: contain;
}

.header-center h1 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    color: #000;
}

.header-right .icon , .header-right .icon-btn {
    color: #000;
    width: 32px;
    height: 32px;
    margin-left: 16px;
    cursor: pointer;
}

.icon-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon, .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 0;
}

.icon i, .icon-btn i {
    transition: transform 0.2s, color 0.2s;
}

.icon:hover i, .icon-btn:hover i {
    transform: scale(1.2);
    color: #333;
}

/* -------------------------------LIST----------------------------------------------------------------- */
/* Encabezado más prominente */
.table-header {
    margin-bottom: 10px;
    padding: 10px 20px;
    color: var(--text-color);
    font-size: 1.2em;
    text-align: center; 
}

.search-input {
    width: 90%;
    margin-left: 10px;
}

table.records-table {
    width: max-content;
    border-collapse: collapse;
    background-color: transparent;
    color: var(--text-color);
    border: none;
    table-layout: fixed; 
}

/* 
.records-wrapper {
    margin: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
} */

.records-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px auto;        
    width: fit-content;       
    max-width: 100vw;         
}

.records-container {
    height: 324px; /* Alto exacto para 5 filas (5 * 60px más los encabezados) */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: white #333;
    width: 100%; 
    padding-right: 0; 
    box-sizing: border-box; 
}

.records-container::-webkit-scrollbar {
    width: 8px;
}

.records-container::-webkit-scrollbar-track {
    background: #fcfcff;
}

.records-container::-webkit-scrollbar-thumb {
    background-color: white;
    border-radius: 10px;
}

table.records-table th {
    background-color: transparent;
    color: var(--accent);
    text-align: left;
    padding: 15px 20px;
    font-weight: normal;
    border: none;
    text-align: center;
    vertical-align: middle;
}

table.records-table td {
    padding: 15px 20px;
    border: none;
    border-bottom: 1px solid #444;
    text-align: center;
    vertical-align: middle;
}


table.records-table td.patient-id {
    color: var(--accent);
    font-weight: bold;
}

/* Estilos para los estados */
table.records-table td.status-unchanged {
    color: var(--estado-sin-cambios);
}

table.records-table td.status-modified {
    color: var(--estado-modificado);
}
table.records-table tr {
    transition: box-shadow 0.25s ease-in-out;
}

table.records-table tr:hover {
    box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent);
    /* background-color: transparent; */
}

.records-container::-webkit-scrollbar {
    width: 8px;
}

.records-container::-webkit-scrollbar-track {
    background: #333; 
}

.records-container::-webkit-scrollbar-thumb {
    background-color: white;
    border-radius: 10px;
}

.records-outer-wrapper {
    width: 100%;
    overflow-x: hidden;
}


table.records-table .status-unchanged {
    color: var(--estado-sin-cambios); 
}

table.records-table .status-modified {
    color: var(--estado-modificado); 
}

table.records-table .estado-badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid currentColor;
    display: inline-block;
    width: fit-content;
}





/* Botones de acción */
.action-button {
    background-color: transparent;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 5px;
}

.action-button:hover {
    color: var(--text-color);
}


.action-link {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 5px;
    padding: 5px;
    cursor: pointer;
}

.action-link:hover,
.action-link:visited,
.action-link:active,
.action-link:focus {
    color: var(--text-color);
    text-decoration: underline;
}

.contlabeler {
    height: auto; /* Alto exacto para 5 filas (5 * 60px más los encabezados) */
    overflow-y: visible;
    /* Personaliza la barra de desplazamiento */
    scrollbar-width: none;
    scrollbar-color: none;
}



.add-button {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.add-button:hover {
    background-color: var(--accent-hover, #4db8ff); /* Puedes definir esta variable */
    transform: translateY(-1px);
}

.add-button:active {
    transform: scale(0.98);
}



/* Esto es del rectangulo */
.annotation-box {
  position: absolute;
  cursor: move;
  box-sizing: border-box;
  border-radius: 4px;
  overflow: visible;
}

.resizer {
  width: 10px;
  height: 10px;
  background-color: white;
  border: 2px solid #333;
  border-radius: 50%;
  position: absolute;
  z-index: 20;
  display: none; /* Ocultos por defecto */
}

.annotation-box.active .resizer {
  display: block; /* Se muestran solo si el rectángulo está activo */
}

.resizer.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.resizer.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.resizer.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.resizer.br { bottom: -6px; right: -6px; cursor: nwse-resize; }


@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 153, 255, 0.9);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 153, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 153, 255, 0);
  }
}

.annotation-box.active {
  animation: pulse-border 1.2s infinite;
  z-index: 10;
  border-width: 2px;
}


#etiqueta-menu {
  position: absolute;
  background: #1e1e1e;
  color: white;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  font-size: 14px;
  min-width: 160px;
}

#etiqueta-menu div {
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease;
}

#etiqueta-menu div:hover {
  background: rgba(255, 255, 255, 0.1);
}

#etiqueta-menu hr {
  margin: 8px 0;
  border: none;
  border-top: 1px solid #555;
}

.image-link {
    text-decoration: none;
    color: white;
}

.image-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.image-label:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.image-label .material-symbols-outlined {
    font-size: 20px;
}

.action-link {
    text-decoration: none;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.action-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: var(--accent);
}

.action-link .material-symbols-outlined {
    font-size: 20px;
}



.image-container {
    position: relative;
    display: inline-block;
}

button.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.close-button:hover {
    background-color: #ccc;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    padding: 40px 0;
}

.modal-content {
    background-color: rgba(30, 30, 30, 0.85); /* fondo translúcido */
    backdrop-filter: blur(50px);             /* desenfoque elegante */
    margin: 40px auto;
    padding: 24px 32px;
    border-radius: 16px;
    border: 1px solid #444;
    width: 85%;
    max-width: 1000px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    color: #f2f2f2;
    font-family: 'Segoe UI', sans-serif;
    animation: fade-in 0.3s ease;
    transition: all 0.3s ease-in-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* The Close Button */
.close {
    color: #ff69b4;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: white;
}


.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.list {
    display: inline-block;
}



/* ============================================== */
/* ESTILOS PARA INPUTS Y SELECTS (Filtros y Búsqueda) */
/* ============================================== */

/* Estilos base para todos los inputs y selects dentro de un filtro */
.filter-wrapper input[type="text"], 
.filter-wrapper input[type="number"], 
.filter-wrapper select {
    /* Reinicio de apariencia nativa para mayor consistencia y control */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Diseño principal */
    background-color: #333; /* Fondo oscuro, a juego con .checkbox-group */
    color: #f1f1f1; /* Texto claro */
    border: 1px solid #ff1493; /* Borde del color principal */
    border-radius: 5px; /* Bordes redondeados */
    padding: 10px 12px; /* Espaciado interno */
    font-size: 1em;
    line-height: 1.2;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%; /* Ocupar todo el ancho disponible en su contenedor */
}

/* Efecto al enfocar (focus) para accesibilidad y estética */
.filter-wrapper input[type="text"]:focus, 
.filter-wrapper input[type="number"]:focus, 
.filter-wrapper select:focus {
    border-color: #fff; /* Borde más claro al enfocar */
    box-shadow: 0 0 5px rgba(255, 20, 147, 0.7); /* Sombra suave con el color principal */
    outline: none; /* Elimina el foco nativo del navegador */
}


/* --- Estilos Específicos para SELECT --- */

/* Estilos específicos para SELECT para agregar un indicador desplegable personalizado */
.filter-wrapper select {
    /* Agregamos un ícono de flecha personalizado */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%23f1f1f1%22%20d%3D%22M10.293%203.293L6%207.586%201.707%203.293A1%201%200%2000.293%204.707l5%205A1%201%200%20006%2010a1%201%200%2000.707-.293l5-5a1%201%200%2000-1.414-1.414z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px; /* Deja espacio para el ícono de flecha */
}

/* Estilo para las opciones dentro del select (puede variar mucho entre navegadores, pero ayuda a la consistencia) */
.filter-wrapper select option {
    background-color: #333; /* Fondo oscuro */
    color: #f1f1f1; /* Texto claro */
}


/* --- Estilos Específicos para Barra de Búsqueda Principal (ID Paciente) --- */

/* Estilo del contenedor del input de búsqueda para alineación */
.search-input-wrapper .input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ff1493; /* Aplica el borde al grupo en lugar del input */
    border-radius: 5px;
    background-color: #333; /* Fondo del grupo */
    padding: 0; /* Quitamos el padding del grupo */
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Efecto de foco en la barra de búsqueda */
.search-input-wrapper .input-group:focus-within {
    border-color: #fff;
    box-shadow: 0 0 5px rgba(255, 20, 147, 0.7);
}

/* Estilo para el icono de búsqueda */
.search-input-wrapper .input-group i {
    color: #ff1493; /* Color del icono principal */
    padding: 0 10px;
    font-size: 1.2em;
}

/* Estilo para el input de texto dentro de la barra de búsqueda */
.search-input-wrapper input.search-input {
    flex-grow: 1; /* Permite que el input ocupe el espacio restante */
    border: none; /* Elimina el borde redundante */
    background-color: transparent; /* Fondo transparente */
    padding: 10px 0; /* Ajusta el padding para alinear con el icono */
}


input .search-list {
    flex-grow: 1; /* Permite que el input ocupe el espacio restante */
    border: 2px solid rgb(255, 255, 255); /* Elimina el borde redundante */
    background-color: transparent; /* Fondo transparente */
    padding: 0; /* Ajusta el padding para alinear con el icono */
}

/* Eliminar el estilo de foco del input, ya que se aplica al contenedor .input-group */
.search-input-wrapper input.search-input:focus {
    border-color: transparent;
    box-shadow: none;
    outline: none;
}

/* Estilo para el pequeño select del filtro especial (operadores =, <, >) */
.special-filter-container .input-group select {
    max-width: 70px; /* Un poco más de ancho para los operadores */
    text-align: center;
}

/* Ajuste para el texto de las etiquetas de los filtros */
.filter-wrapper label {
    color: #f1f1f1; /* Asegura que la etiqueta sea visible con fondo oscuro */
}

/* Ajuste al contenedor del filtro especial para que el texto sea visible */
.special-filter-container {
    background-color: #2c2c2c; /* Cambia el fondo a un gris oscuro */
    border-color: #ff1493;
}

.special-filter-toggle {
    color: #ff1493; /* Color principal para el toggle */
}

/* ============================================== */
/* ESTILOS PARA EL BOTÓN DE DESCARGA MASIVA (ADMIN) */
/* ============================================== */

.download-all-button {
    /* Estilo principal */
    background-color: var(--accent); /* Color rosa/fucsia */
    color: var(--text-color); /* Texto blanco */
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s;
    
    /* Para centrar el icono y el texto */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    
    /* Posicionamiento en la tabla */
    margin: 10px 0; /* Margen superior e inferior para separarlo del contenido */
    align-self: flex-start; /* Asegura que se alinee a la izquierda dentro del .records-wrapper */
}

.download-all-button .material-symbols-outlined {
    font-size: 20px;
    line-height: 1; /* Asegura que el icono no añada espacio extra */
}

.download-all-button:hover {
    background-color: var(--background-dark); /* Fondo oscuro en hover */
    border-color: var(--accent-hover); /* Borde más brillante en hover */
    color: var(--accent-hover); /* Texto más brillante en hover */
    transform: translateY(-2px); /* Efecto 3D sutil */
    box-shadow: 0 4px 10px rgba(255, 20, 147, 0.4);
}

.download-all-button:active {
    transform: translateY(0);
    box-shadow: none;
}