/* =========================================
   ESTRUCTURA GENERAL Y TEMA
========================================= */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    transition: background 0.3s, color 0.3s;
}

/* --- Tema Claro --- */
body.light {
    background-color: #f9f6f1; /* blanco hueso suave */
    color: #1f2937; /* gris oscuro neutro */
}

body.light a {
    color: #1d4ed8;
}

body.light .resumen {
    color: #3b3b3b;
    opacity: 0.85;
}

body.light .paginacion strong {
    background-color: #d97706; /* naranja oscuro */
}

body.light .paginacion a,
body.light .paginacion a:visited,
body.light .paginacion .puntos {
    color: #d97706 !important;
}

body.light .paginacion a:hover {
    color: #1d4ed8 !important; /* azul más fuerte */
}

/* --- Tema Oscuro --- */
body.dark {
    background-color: #111111;
    color: #eeeeee;
}

body.dark a {
    color: #a78bfa;
}

body.dark .resumen {
    color: #facc15;
    opacity: 0.85;
}

/* =========================================
   PANEL
========================================= */
.btn-panel {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 10px;
    text-decoration: none;
    font-size: 18px;
    background: #444;
    color: #fff;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.btn-panel:hover {
    background: #666;
}

.boton-volver {
    display: inline-block;
    margin-top: 2rem;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    background-color: #3aaefc; /* azul cielo */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

/* Forzamos color y estilos para cualquier estado */
.boton-volver:link,
.boton-volver:visited,
.boton-volver:active,
.boton-volver:focus,
.boton-volver:hover {
    color: white !important;
    text-decoration: none !important;
}

.panel {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #222;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contenedor-volver {
    text-align: right;
    margin-top: 2rem;
}

/* =========================================
   CABECERA Y CONTROLES
========================================= */
header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.controles {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.7); /* Claro */
    backdrop-filter: blur(5px);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark .controles {
    background-color: rgba(20, 20, 20, 0.7); /* Oscuro */
}

#refresh-gallery,
#theme-toggle {
    all: unset;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.3rem;
    color: inherit;
    transition: transform 0.2s ease;
}

#refresh-gallery:hover,
#theme-toggle:hover {
    transform: scale(1.2);
}

/* =========================================
   NAVEGACIÓN DE FILTROS
========================================= */
.filtros a {
    margin-right: 1rem;
    text-decoration: none;
    font-weight: bold;
    color: #d4d4d8;
    transition: color 0.2s;
}

.filtros a:visited {
    color: #ff9e63;
}

.filtros a:hover {
    color: #3b82f6;
}

.filtros a.activo {
    color: #facc15;
    text-decoration: underline;
}

/* =========================================
   GALERÍA DE IMÁGENES
========================================= */
.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    padding: 1rem;
}

.galeria img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s;
    cursor: pointer;
}

.galeria img:hover {
    transform: scale(1.02);
}

/* =========================================
   AGRUPACIÓN POR FECHA
========================================= */
.bloque-fecha {
    display: contents;
}

.etiqueta-fecha {
    grid-column: 1 / -1;
    font-weight: bold;
    font-size: 1.1rem;
    color: #facc15;
    padding: 1rem 0 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #3f3f46;
}

.grupo-fecha {
    width: 100%;
    font-size: 1.2rem;
    font-weight: bold;
    color: #facc15;
    margin: 2rem 1rem 0.5rem;
    border-bottom: 1px solid #3f3f46;
    padding-bottom: 0.3rem;
}

/* =========================================
   PAGINACIÓN
========================================= */
.paginacion {
    text-align: center;
    padding: 1rem;
}

.paginacion a,
.paginacion a:visited,
.paginacion a:active,
.paginacion a:focus,
.paginacion a:hover {
    margin: 0 4px;
    padding: 4px 8px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    background: transparent;
    color: #ff9e63 !important;
    transition: background-color 0.2s, color 0.2s;
}

.paginacion a:hover {
    color: #60a5fa !important;
}

.paginacion strong {
    background-color: #f59e0b;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

.paginacion .puntos {
    color: #ff9e63;
    margin: 0 6px;
    font-weight: bold;
}

/* =========================================
   TOOLTIP PERSONALIZADO
========================================= */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #f8fafc;
    padding: 6px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.tooltip:hover::after {
    opacity: 1;
}

/* =========================================
   RESUMEN DE RESULTADOS
========================================= */
.resumen {
    text-align: center;
    margin: 1.5rem 0 1rem;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.85;
}
