/* ============================================================
   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 */
body.admin-body { overflow-y: auto; padding-bottom: 2rem; }

/* ============================================================
   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; }
.admin-link { color: white; text-decoration: none; font-weight: 600; font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.4); padding: 0.4rem 1rem; border-radius: 20px; transition: 0.2s; }
.admin-link:hover { background: rgba(255,255,255,0.1); }

/* ============================================================
   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); }

/* ============================================================
   ADMIN NAVBAR
   ============================================================ */
.navbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.navbar .logo { font-weight: 700; color: var(--brand); font-size: 1.1rem; }
.admin-nav { display: flex; gap: 1rem; align-items: center; }
.back-link { color: var(--ink-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: 0.2s; }
.back-link:hover { color: var(--accent); }
.btn-logout { background: #fee2e2; color: var(--red); border: none; padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-logout:hover { background: var(--red); color: white; }

/* ============================================================
   ADMIN CONTENEDOR & TARJETAS
   ============================================================ */
.admin-container { max-width: 800px; margin: 2rem auto; padding: 0 1.5rem; }

.auth-card, .dashboard-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    border: 1px solid var(--border); overflow: hidden; margin-bottom: 2rem;
}
.auth-card { max-width: 400px; margin: 4rem auto; }
.auth-card__header, .dashboard-card__header {
    background: var(--brand); color: white; padding: 1.5rem 2rem; text-align: center;
}
.auth-card__header h1, .dashboard-card__header h2 { font-size: 1.3rem; margin: 0; font-weight: 600; }
.auth-card__body, .dashboard-form { padding: 2rem; }

/* Form Elements */
.form-row { display: grid; grid-template-columns: 1fr 150px; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; margin-bottom: 1.25rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; margin-bottom: 0.4rem; }
.form-group input {
    padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 1rem; outline: none; transition: 0.2s; background: #f8fafc;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.2); background: white; }

/* Prog Section */
.prog-section { background: var(--bg); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 2rem; }
.prog-section__header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
.prog-columns-header { display: grid; grid-template-columns: 100px 1fr 40px; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; margin-bottom: 0.5rem; padding: 0 0.25rem; }
.prog-list { display: flex; flex-direction: column; gap: 0.75rem; }
.prog-item { display: grid; grid-template-columns: 100px 1fr 40px; gap: 0.5rem; align-items: center; }
.prog-item input { padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; outline: none; transition: 0.2s; background: var(--surface); width: 100%; }
.prog-item input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }

/* Buttons */
.btn-primary-full, .btn-save {
    width: 100%; padding: 1rem; background: var(--accent); color: white; border: none;
    border-radius: var(--radius); font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.2s;
    box-shadow: 0 2px 4px rgba(37,99,235,0.2);
}
.btn-primary-full:hover, .btn-save:hover { background: #1d4ed8; }
.btn-add { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 0.3rem 0.8rem; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-add:hover { background: var(--brand-light); }
.btn-danger { background: #fee2e2; color: var(--red); border: none; border-radius: var(--radius); font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-danger:hover { background: #fca5a5; color: white; }

/* ============================================================
   UTILIDADES & EXTRAS
   ============================================================ */
.hidden { display: none !important; }
.error-msg { color: var(--red); font-size: 0.85rem; text-align: center; margin-top: 1rem; }
.loading-msg { text-align: center; padding: 2rem; color: var(--ink-muted); }

/* Toasts */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; }
.toast { background: var(--ink); color: white; padding: 1rem 1.5rem; border-radius: var(--radius); font-weight: 600; display: flex; gap: 0.5rem; opacity: 0; transform: translateY(20px); transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow); }
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--red); }

/* 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; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .prog-item { grid-template-columns: 80px 1fr 35px; }
}

