/* ==================================================
   RESET Y BASE
   ================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f8ff;
}

/* ==================================================
   ESTRUCTURA GENERAL (LAYOUT)
   ================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    background-color: #ecf0f1;
}

.content-wrapper {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==================================================
   MENÚ LATERAL
   ================================================== */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
    width: 100%;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

.sidebar a:hover {
    background-color: #3498db;
}

/* ==================================================
   TABLAS
   ================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #3498db;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #3498db;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* ==================================================
   BOTONES Y FORMULARIOS
   ================================================== */
button, input[type="submit"] {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 4px;
    transition: all 0.3s;
}

button:hover, input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

form {
    display: inline-block;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 100%;
    margin: 5px 0 15px;
}

label {
    font-weight: bold;
    margin-top: 10px;
    display: inline-block;
}

/* ==================================================
   MENSAJES
   ================================================== */
.mensaje {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ==================================================
   PÁGINA DE INICIO — HERO / BIENVENIDA
   ================================================== */
.hero-inicio {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.hero-contenido {
    flex: 1;
    min-width: 260px;
}

.hero-contenido h1 {
    font-size: 2.2em;
    margin: 0 0 10px;
}

.hero-contenido p {
    font-size: 1.05em;
    opacity: 0.95;
}

.periodo-activo {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 10px;
}

.hero-login {
    background: rgba(255, 255, 255, 0.12);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(6px);
    min-width: 260px;
}

.hero-login h3 {
    margin-top: 0;
}

.hero-login input {
    width: 100%;
    padding: 8px;
    margin: 5px 0 12px;
    border-radius: 6px;
    border: none;
    box-sizing: border-box;
}

.hero-login button,
.btn-salir {
    width: 100%;
    padding: 10px;
    border: none;
    background: #facc15;
    color: #1e293b;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

.btn-salir {
    width: auto;
    padding: 8px 20px;
}

.error-login {
    color: #fecaca;
    font-weight: bold;
}

.hero-sesion {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ==================================================
   PÁGINA DE INICIO — ESTADÍSTICAS
   ================================================== */
.estadisticas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 35px;
}

.tarjeta-estadistica {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border-left: 5px solid #3b82f6;
}

.tarjeta-estadistica .numero {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #1e3a8a;
}

.tarjeta-estadistica .etiqueta {
    color: #64748b;
    font-size: 0.95em;
}

/* ==================================================
   PÁGINA DE INICIO — BLOQUES Y TARJETAS
   ================================================== */
.bloque-inicio {
    margin-bottom: 40px;
}

.bloque-inicio h2 {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    color: #1e293b;
}

.grid-tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.tarjeta {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.tarjeta:hover {
    transform: translateY(-4px);
}

.tarjeta img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.imagen-vacia {
    height: 160px;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
}

.tarjeta-cuerpo {
    padding: 15px;
}

.tarjeta-cuerpo h3 {
    margin: 0 0 8px;
    font-size: 1.1em;
    color: #1e293b;
}

.tarjeta-cuerpo .fecha,
.tarjeta-cuerpo .categoria {
    font-size: 0.85em;
    color: #64748b;
    margin: 4px 0;
}

.tarjeta-cuerpo p {
    margin: 6px 0;
    color: #475569;
    font-size: 0.92em;
}

.tarjeta-cuerpo .resumen {
    margin: 6px 0 4px;
    color: #475569;
    font-size: 0.92em;
}

.sin-datos {
    color: #94a3b8;
    font-style: italic;
}

/* ==================================================
   PÁGINA DE INICIO — DETALLES EXPANDIBLES
   ================================================== */
.mas-info {
    margin-top: 6px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
}

.mas-info summary {
    cursor: pointer;
    color: #3b82f6;
    font-size: 0.88em;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.mas-info summary::-webkit-details-marker {
    display: none;
}

.mas-info summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.2s;
}

.mas-info[open] summary::before {
    transform: rotate(90deg);
}

.mas-info summary:hover {
    text-decoration: underline;
}

.contenido-completo {
    margin-top: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.9em;
    color: #334155;
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.5;
}

/* ==================================================
   PÁGINA DE INICIO — MÓDULOS
   ================================================== */
.grid-modulos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.modulo-card {
    display: block;
    padding: 18px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
    transition: all 0.2s;
}

.modulo-card:hover {
    background: #3b82f6;
    color: #fff;
    transform: translateY(-2px);
}

/* ==================================================
   MÓDULO ASISTENCIA — Info del evento
   ================================================== */
.info-evento {
    background: #f1f5f9;
    border-left: 5px solid #3b82f6;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.info-evento h3 {
    margin: 0 0 8px;
    color: #1e3a8a;
}

.info-evento p {
    margin: 4px 0;
    color: #475569;
    font-size: 0.95em;
}

/* Botón "Asistiré" */
button[title="Asistiré"], 
.formulario-asistencia button {
    background: linear-gradient(45deg, #3b82f6, #1e3a8a);
}
/* ==================================================
   PÁGINA DE INICIO — Botones de acción del evento
   ================================================== */
.acciones-evento {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    flex-wrap: wrap;
}

.acciones-evento form {
    flex: 1;
    min-width: 120px;
    margin: 0;
}

.acciones-evento button {
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    font-size: 0.85em;
    border-radius: 20px;
}

.btn-asistir {
    background: linear-gradient(45deg, #3b82f6, #1e3a8a) !important;
}

.btn-asistir:hover {
    background: linear-gradient(45deg, #2563eb, #1e40af) !important;
}

.btn-ver-lista {
    background: linear-gradient(45deg, #64748b, #475569) !important;
}

.btn-ver-lista:hover {
    background: linear-gradient(45deg, #475569, #334155) !important;
}
/* ==================================================
   GALERÍA DE ESPACIOS FÍSICOS
   ================================================== */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.galeria-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
}

.galeria-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.galeria-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.galeria-item-info {
    margin-top: 6px;
    color: #64748b;
}