/* estilos.css - Directorio Boardgames v1.6 - Logo mas grande y estilo de Nuevo Lugar */
:root {
    --primary: #1a2a3a;
    --accent: #d35400;
    --urgent: #f1c40f;
    --urgent-bg-header: #FDFAF0;
    --bg: #f0f2f5;
    --text-main: #2c3e50;
    --border: #e0e6ed;
    --btn-map-border: #4D88EC;
    --link-color: #3498db;
    --secondary-btn: #45AAE2;
    /* ========== COLORES Header v1.5 ========== */
    --header-bg: #003362;       /* BG del header */
    --header-line: #FF9800;     /* Linea inferior del header */
    --btn-inicio-bg: #003362;   /* Color base del btn de inicio */
    --btn-inicio-hover: #9DE164; /* Color hover btn de inicio */
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding-bottom: 100px; 
    color: var(--text-main); 
}

header { 
    background: var(--header-bg); /* <- Cambiado */
    color: white; 
    padding: 30px 20px 50px; 
    text-align: center; 
    border-bottom: 5px solid var(--header-line); /* <- Cambiado */
}

.container { 
    max-width: 1100px; 
    margin: -30px auto 0; 
    padding: 0 15px; 
}

/* =========================================
   SISTEMA DE BÚSQUEDA (Consolidado)
   ========================================= */
.search-box { 
    background: white; 
    border-radius: 50px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    margin-bottom: 10px; 
    border: 1px solid #ddd; 
    overflow: hidden; 
}

.search-wrapper { 
    display: flex; 
    align-items: center; 
    padding: 0 20px; 
}

.icon-search {
    width: 20px !important;  /* Tamaño fijo obligatorio */
    height: 20px !important; /* Altura fija obligatoria */
    flex-shrink: 0;          /* Evita que se aplaste si hay mucho texto */
    filter: invert(70%);     /* Color gris */
    display: block;          /* Elimina espacios fantasma abajo */
}

#busqueda { 
    width: 100%; 
    padding: 18px 12px; 
    border: none; 
    font-size: 1rem; 
    outline: none; 
    color: var(--text-main); 
    background: transparent;
}

/* ==========================================================================
   ESTRUCTURA DE FILTROS Y BOTÓN RESPONSIVO v1.6
   ========================================================================== */

/* Contenedor Maestro: En móvil es vertical (bloques apilados) */
.section-header-flex { 
    display: flex; 
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start; 
    margin: 35px 0 15px; 
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Bloque que agrupa Mostrar y Ordenar por */
.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}

/* Sub-bloques internos para "Mostrar" y "Ordenar" */
.type-controls, 
.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
}

/* Estilo para los textos explicativos */
.section-divider-text { 
    font-size: 0.8rem; 
    font-weight: 800; 
    color: #64748b; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    margin: 0; 
    white-space: nowrap; 
    display: flex; 
    align-items: center; 
    flex-grow: 0;
}

/* Contenedor de las 3 opciones de Radio Buttons */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    
}

/* Estilos individuales de cada opción Radio */
.filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; 
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333333;
    transition: color 0.2s ease;
}

/* Dropdown de Ordenamiento estilizado */
#ordenamiento {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: white;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: bold;
    outline: none;
}

/* Contenedor del Botón Sugerir (Asegura alineación a la izquierda en móviles) */
.actions-group {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

/* Botón Registro/Sugerir adaptado para evitar desborde en móvil */
.btn-register { 
    background-color: #F1C225; 
    color: white; 
    text-decoration: none; 
    height: 36px; 
    padding: 0 16px; 
    border-radius: 6px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    transition: background 0.2s; 
    white-space: nowrap;
    width: auto; /* Mide solo su contenido, no el 100% de la pantalla */
    max-width: 100%;
    box-sizing: border-box;
}

/* =========================================
   TARJETAS DE EVENTOS - RESPONSIVE CORREGIDO
   ========================================= */
.grid { display: flex; flex-direction: column; gap: 15px; }

.card {
    background: white;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.08); 
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card:hover {
    border-color: #24A2F6; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 0; 
}

.card:active {
    transform: scale(0.98); 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-hint-detalles {
    position: absolute;
    top: 0;            
    right: 0;          
    background: #0581D4;
    color: white;
    font-size: 0.6rem; 
    font-weight: 600;
    padding: 6px 12px;
    border-bottom-left-radius: 8px; 
    text-transform: uppercase;
    pointer-events: none; 
    opacity: 0.9;
    z-index: 10;       
}

/* --- ESTADOS MODIFICADORES DE LA TARJETA --- */
.card.is-soon { border-left: 8px solid var(--urgent); }
.card.is-soon .card-header { background-color: var(--urgent-bg-header); }

.card.is-new-place { 
    outline: 2px solid #1ED760 !important; 
    outline-offset: -3px !important; 
    box-shadow: 0 4px 15px rgba(30, 215, 96, 0.2) !important;
}

/* --- MAQUETACIÓN MÓVIL POR DEFECTO (Evita amontonamientos) --- */
.card-header { 
    display: flex; 
    flex-wrap: wrap;           /* Permite que los tags y la hora caigan abajo naturalmente */
    flex-direction: row;       /* ¡Arreglado! Logo y título se quedan en la misma línea */
    align-items: center; 
    padding: 8px 8px; 
    gap: 15px; 
}

/* Contenedor extra para que en móvil el logo y el título queden juntos arriba si se desea, 
   pero aplicando flex-wrap natural todo caerá de forma limpia en el bloque izquierdo */
.host-logo-placeholder { 
    width: 90px; 
    height: 90px; 
    border-radius: 8px; 
    object-fit: cover; 
    background: #eee; 
}

.col-host { 
    flex: 1;                   /* Ocupa todo el espacio al lado del logo, manteniendo el título arriba */
    min-width: 200px;          /* Evita que se aplaste horriblemente antes de romper */
    display: flex; 
    flex-direction: column; 
}

.host-name { font-weight: 800; font-size: 1.15rem; color: var(--primary); }

.days-to-go { 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    margin-top: 3px;
    color: var(--accent);
}

.col-act { 
    width: 100%;               /* Se adueña de su fila abajo del título */
    display: flex; 
    gap: 6px; 
    flex-wrap: wrap; 
    justify-content: flex-start;
    padding: 0; 
}

.activity-tag { 
    padding: 4px 12px; 
    border-radius: 6px; 
    font-size: 0.7rem; 
    font-weight: 800; 
    text-transform: uppercase; 
}

.col-time { 
    width: 100%;               /* En móvil, la fecha usa todo el ancho abajo */
    display: flex; 
    gap: 25px; 
    justify-content: flex-start; /* Alineado a la izquierda como el logo */
}

.time-item { display: flex; flex-direction: column; align-items: flex-start; }
.time-label { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; font-weight: 700; }
.time-val { 
    font-size: 0.85rem; 
    font-weight: 700; 
    line-height: 1.2; 
    max-width: 160px; 
    display: block; 
    word-wrap: break-word; 
}
.time-val.date { color: var(--accent); }

/* --- ENJAULAMOS EL COMPORTAMIENTO DESKTOP / TABLET --- */
@media (min-width: 768px) {
    .card-header { 
        flex-direction: row;   /* En pantallas grandes vuelve a ser una fila horizontal */
        flex-wrap: nowrap;
        gap: 15px; 
    }
    .col-host { 
        flex: 0 0 280px;       /* Recupera su ancho fijo de escritorio */
    }
    .col-act { 
        flex: 1;               /* Toma el centro libre */
    }
    .col-time { 
        flex: 0 0 320px;       /* Recupera su ancho derecho */
        justify-content: flex-end; 
    }
}

/* =========================================
   CONTENIDO EXPANDIDO
   ========================================= */
.card-content { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.4s ease; 
}

.card.active .card-content { 
    max-height: 1500px; 
    border-top: 1px solid #f1f5f9; 
}

.card.active .btn-hint-detalles {
    display: none;
}

.three-col-layout { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr 280px; 
    gap: 30px; 
    padding: 30px; 
}

.details-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    border-right: 1px solid #f1f5f9; 
    padding-right: 20px; 
}

.info-block strong { display: block; font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px; }
.info-block span { font-size: 0.95rem; font-weight: 600; }

.org-link { color: var(--link-color); text-decoration: none; font-weight: 700; }
.org-link:visited { color: var(--link-color); }
.org-link:hover { text-decoration: underline; }

.highlight-val {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.social-links { display: flex; flex-direction: column; gap: 12px; border-right: 1px solid #f1f5f9; padding-right: 20px; }
.btn-social { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 12px; 
    text-decoration: none; 
    border-radius: 8px; 
    font-size: 0.85rem; 
    font-weight: 700; 
}

.btn-fb { background: #1877f2; color: white; }
.btn-ig { background: #933C8C; color: white; }
.btn-map { border: 2px solid var(--btn-map-border); color: var(--btn-map-border); }

.svg-icon { width: 16px; height: 16px; object-fit: contain; }
.white-filter { filter: brightness(0) invert(1); }

.flyer-box { width: 100%; height: 280px; border-radius: 10px; overflow: hidden; background: #f8fafc; }
.flyer-img { width: 100%; height: 100%; object-fit: cover; object-position: top; cursor: zoom-in; }

.footer-version {
    position: absolute;
    top: 0.6em;
    right: 20px;
    z-index: 1000;
    text-align: center;
    padding: 0; 
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    opacity: 0.8;
}

/* =========================================
   MODALES (GENERAL Y REGISTRO)
   ========================================= */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.9); 
    justify-content: center; 
    align-items: center; 
}

#modalRegistro {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 15px;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    width: 95%;
    max-width: 600px;
    border-radius: 12px;
    box-sizing: border-box;
    margin: 0 auto 50px auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

.flyer-display {
    max-width: 95%;
    max-height: 90vh; 
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-out;
    padding: 0;           
    background: none;     
    display: block;
    margin: auto;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   ESTILOS FORMULARIO DE REGISTRO 
   ========================================= */
.form-container { color: var(--text-main); }
.form-header h2 { margin: 0 0 5px; color: var(--primary); font-size: 1.4rem; }
.form-header p { margin: 0 0 20px; font-size: 0.85rem; color: #64748b; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; margin-bottom: 6px; color: #64748b; letter-spacing: 0.5px; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-family: inherit; 
    font-size: 0.95rem; 
    box-sizing: border-box; 
    outline: none;
}

.form-group input:focus, .form-group select:focus { border-color: var(--secondary-btn); }

.radio-group { display: flex; gap: 25px; padding: 5px 0; }
.radio-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.radio-label input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 5px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: none;
    color: var(--text-main);
    cursor: pointer;
}

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; border-top: 1px solid #f1f5f9; padding-top: 20px; }

.btn-primary { background: var(--accent); color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.btn-secondary { background: #f1f5f9; color: #64748b; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 700; cursor: pointer; }

input[name="_gotcha"] { display: none !important; }
.form-divider { border: 0; border-top: 1px solid var(--border); margin: 25px 0; }

input[type="file"] { font-size: 0.85rem; color: #64748b; padding: 5px 0; }

/* =========================================
   SPINNER Y RESPONSIVE GENERAL
   ========================================= */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .col-time { flex: 1 1 100%; justify-content: space-between; border-top: 1px solid #f1f5f9; padding-top: 10px; }
    .three-col-layout { grid-template-columns: 1fr; padding: 15px; }
    .details-grid, .social-links { border: none; padding: 0; }
}

@media (max-width: 600px) {
    .btn-hint-detalles {
        font-size: 0.55rem;
        padding: 5px 6px;
    }
}

/* ==========================================================================
   MEDIA QUERY: CONTROL EXCLUSIVO DESKTOP (Alineación de Filtros en 1 sola línea)
   ========================================================================== */
@media (min-width: 768px) {
    /* Pasa todo el bloque a formato horizontal de extremo a extremo */
    .section-header-flex { 
        flex-direction: row;
        justify-content: space-between;
        align-items: center; 
        gap: 20px;
    }

    /* Junta "Mostrar:" y "Ordenar por:" uno al lado del otro */
    .filter-group {
        flex-direction: row;
        align-items: center;
        gap: 30px; /* Separación elegante entre filtros */
        width: auto;
    }

    .type-controls, 
    .sort-controls {
        width: auto;
    }

    /* Manda el botón de Registro firmemente a la derecha */
    .actions-group {
        width: auto;
        justify-content: flex-end;
    }
}

/* =========================================
   BOTON "VOLVER A INICIO" v1.5
   ========================================= */
#btn-back-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    background-color: var(--btn-inicio-bg); /* Solía ser --primary, ahora es independiente */
    color: white;
    border: 2px solid var(--header-line); /* Vinculado a la línea del header para que combine */
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.2s;
}

#btn-back-to-top:hover {
    background-color: var(--btn-inicio-hover); /* Cambia a naranja al pasar el mouse */
    transform: translateY(-3px); /* Pequeño brinco estético */
}

#btn-back-to-top:active {
    transform: scale(0.95);
}