/* ============================================================
   DESIGN SYSTEM – Feria Real
   ============================================================ */
:root {
    --brand: #1e3a8a; /* Deep elegant blue */
    --brand-light: #eff6ff;
    --accent: #2563eb; 
    --ink: #1e293b;
    --ink-muted: #64748b;
    --surface: #ffffff;
    --bg: #f1f5f9;
    --border: #cbd5e1;
    --red: #ef4444;
    --green: #10b981;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 8px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
body { display: flex; flex-direction: column; }
body.public-body { overflow: hidden; } /* Prevents whole page scroll for map */

/* ============================================================
   HEADER & FOOTER (Alto contraste)
   ============================================================ */
.evento-header, .evento-footer {
    flex-shrink: 0;
    background: var(--brand);
    color: white;
    z-index: 100;
}
.evento-header {
    border-bottom: 12px solid #dde3ed; /* Frame for the map */
}
body.map-zoomed .evento-header { border-bottom-width: 0; }

.header-top {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
    gap: 1rem;
}
.header-row-top { display: flex; align-items: center; gap: 1rem; }
.logo { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.cabecera-title { font-size: 1rem; font-weight: 600; opacity: 0.9; }

/* Search Bar */
.search-container { position: relative; width: 100%; max-width: 300px; }
.search-container::before {
    content: "🔍"; position: absolute; left: 0.75rem; top: 50%;
    transform: translateY(-50%); font-size: 0.9rem; opacity: 0.6; pointer-events: none;
}
#search-input {
    width: 100%; padding: 0.6rem 1rem 0.6rem 2.25rem;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px; color: white; font-size: 0.95rem; outline: none; transition: 0.2s;
}
#search-input::placeholder { color: rgba(255,255,255,0.6); }
#search-input:focus { background: white; color: var(--ink); }

.evento-footer {
    padding: 1rem 2rem; border-top: 12px solid #dde3ed;
    display: flex; justify-content: space-between; align-items: center;
}
body.map-zoomed .evento-footer { border-top-width: 0; }
.evento-footer p { font-size: 0.85rem; opacity: 0.8; }

/* ============================================================
   MAPA INTERACTIVO
   ============================================================ */
.map-section {
    flex: 1; position: relative; overflow: hidden; background: #dde3ed;
}
#map-container { position: relative; transform-origin: 0 0; touch-action: none; }
#map-image { display: block; max-width: none; }

.punto-interes {
    position: absolute; background: transparent; border: 2px solid transparent;
    cursor: pointer; z-index: 10; transition: 0.2s;
}
.punto-interes:hover { background: rgba(37,99,235,0.2); border-color: var(--accent); }

.highlight-overlay {
    position: absolute; pointer-events: none; z-index: 20;
    background: rgba(16,185,129,0.2); border: 3px solid var(--green); border-radius: 6px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ============================================================
   MODAL PUBLICO
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(15,23,42,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; }

.info-modal {
    background: var(--surface); width: 90%; max-width: 450px;
    border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.close-btn {
    position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px;
    border: none; background: var(--bg); border-radius: 50%; cursor: pointer;
    font-size: 1.2rem; font-weight: bold; color: var(--ink-muted); transition: 0.2s;
}
.close-btn:hover { background: var(--red); color: white; }

.modal-content { padding: 2rem; max-height: 80vh; overflow-y: auto; }
.modal-content h2 { font-size: 1.6rem; color: var(--brand); margin-bottom: 0.5rem; }
.schedule {
    display: inline-block; padding: 0.3rem 0.8rem; background: var(--brand-light);
    color: var(--accent); border-radius: var(--radius); font-weight: 600; font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.modal-content h3 { font-size: 0.8rem; color: var(--ink-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1rem; }

.programacion-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.programacion-list li {
    display: flex; gap: 1rem; padding: 0.75rem;
    background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border);
}
.prog-time { font-weight: 700; color: var(--accent); min-width: 50px; }
.prog-act { color: var(--ink); }

/* ============================================================
   UTILIDADES & EXTRAS
   ============================================================ */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .header-top { flex-direction: column; padding: 1rem; gap: 0.8rem; }
    .search-container { max-width: 100%; }
    .evento-footer { flex-direction: column; gap: 1rem; text-align: center; }
}
