:root {
    --bg-dark: #0f172a;          /* Azul marino institucional profundo */
    --bg-card: #1e293b;          /* Azul pizarra elegante para tarjetas */
    --primary: #f59e0b;          /* Dorado / Ámbar diplomático */
    --primary-glow: rgba(245, 158, 11, 0.4);
    --marker-color: #10b981;     /* Verde esmeralda para los marcadores principales */
    --marker-glow: rgba(16, 185, 129, 0.5);
    --accent-red: #ef4444;       /* Rojo acento secundario para ondas */
    --text-light: #f8fafc;       /* Blanco marfil suave */
    --text-muted: #94a3b8;       /* Gris pizarra claro */
    --border-color: #334155;     /* Bordes sutiles refinados */
    --border-gold: rgba(245, 158, 11, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, sans-serif; }
body.diplomatic-body { background-color: var(--bg-dark); color: var(--text-light); line-height: 1.6; }

.navbar { background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-gold); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 1rem; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand h1 { font-size: 1.1rem; }
.accent-text { color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); }
.subtitle { font-size: 0.75rem; color: var(--text-muted); }
.icon-glow { font-size: 1.5rem; filter: drop-shadow(0 0 8px var(--primary)); }
.nav-links a { color: var(--text-light); text-decoration: none; margin-left: 1.25rem; font-size: 0.85rem; transition: 0.3s; }
.nav-links a:hover { color: var(--primary); }

.hero { background: radial-gradient(circle at center, #312e81 0%, var(--bg-dark) 100%); padding: 3rem 1rem; text-align: center; border-bottom: 1px solid var(--border-color); }
.hero-container { max-width: 800px; margin: 0 auto; }
.badge { background: rgba(245, 158, 11, 0.15); color: var(--primary); border: 1px solid var(--primary); padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.75rem; text-transform: uppercase; display: inline-block; margin-bottom: 1rem; }
.hero h2 { font-size: 2rem; margin-bottom: 0.75rem; }
.hero p { color: var(--text-muted); font-size: 0.95rem; }

.section-container { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.max-width { max-width: 1200px; margin: 0 auto; }
.max-width-narrow { max-width: 800px; margin: 0 auto; }
.section-padding { padding: 4rem 1rem; }
.bg-alt {
    background-color: rgba(30, 41, 59, 0.5);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.text-center { text-align: center; }
.section-sub { color: var(--text-muted); margin-bottom: 2.5rem; font-size: 0.9rem; }

.card { background-color: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 12px; padding: 1.5rem; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); }
.map-card { padding: 0; overflow: hidden; }

.card-header { padding: 1rem 1.5rem; background: rgba(15, 23, 42, 0.9); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.pulse-dot { display: inline-block; width: 8px; height: 8px; background-color: var(--marker-color); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 8px var(--marker-glow); }

.map-viewport { width: 100%; height: 520px; position: relative; }
.map-container { width: 100%; height: 100%; z-index: 1; background: #0b0f19; }

.leaflet-tile-pane { filter: brightness(0.65) invert(1) contrast(1.2) hue-rotate(180deg) saturate(0.6); }
.leaflet-container { background-color: #0b0f19 !important; }

.hud-overlay { pointer-events: none; position: absolute; inset: 0; z-index: 10; }
.hud-corner { position: absolute; width: 20px; height: 20px; border: 2px solid var(--primary); }
.top-left { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.top-right { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.bottom-left { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.bottom-right { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

@keyframes waterRippleMarker {
    0% { width: 16px; height: 16px; opacity: 1; top: 0px; left: 0px; }
    100% { width: 120px; height: 120px; opacity: 0; top: -52px; left: -52px; }
}
.ripple-wave-1, .ripple-wave-2 { position: absolute; top: 0px; left: 0px; border-radius: 50%; pointer-events: none; z-index: 1; }
.ripple-wave-1 { border: 2px solid var(--marker-color); background: rgba(16, 185, 129, 0.2); }
.ripple-wave-2 { border: 1px solid var(--primary); background: rgba(245, 158, 11, 0.15); animation-delay: 0.2s !important; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(8px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.modal-backdrop.active { opacity: 1; pointer-events: auto; }
.modal-window { background: var(--bg-card); border: 1px solid var(--primary); box-shadow: 0 0 30px var(--primary-glow); border-radius: 16px; width: 90%; max-width: 650px; overflow: hidden; transform: scale(0.8) translateY(20px); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-backdrop.active .modal-window { transform: scale(1) translateY(0); }

.modal-header { padding: 1.25rem; background: rgba(245, 158, 11, 0.1); border-bottom: 1px solid var(--border-gold); display: flex; justify-content: space-between; align-items: center; }
.modal-title-wrap { display: flex; align-items: center; gap: 0.75rem; }
.modal-icon { font-size: 2rem; }
.badge-sm { font-size: 0.65rem; color: var(--primary); letter-spacing: 1px; font-weight: bold; }
.modal-close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.8rem; cursor: pointer; }
.modal-close-btn:hover { color: var(--accent-red); }

.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.modal-image-wrap { width: 100%; height: 240px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid var(--border-color); }
.modal-img { width: 100%; height: 100%; background-size: contain; background-repeat: no-repeat; background-position: center; }

.img-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; border: 1px solid var(--border-color); border-radius: 50%; width: 36px; height: 36px; color: white; background: rgba(15, 23, 42, 0.85); cursor: pointer; }
.img-nav.prev { left: 8px; }
.img-nav.next { right: 8px; }
.img-counter { position: absolute; bottom: 8px; right: 8px; z-index: 3; padding: 4px 8px; border-radius: 6px; color: white; background: rgba(15, 23, 42, 0.85); font-size: 12px; }
.img-nav:disabled { opacity: 0.35; cursor: default; }

.modal-desc { font-size: 0.9rem; color: #cbd5e1; }

.info-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.info-box { background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-color); padding: 0.75rem; border-radius: 8px; }
.box-label { font-size: 0.65rem; color: var(--primary); text-transform: uppercase; font-weight: bold; display: block; }
.box-value { font-size: 0.85rem; font-weight: 600; color: var(--text-light); }
.box-value.highlight { color: #34d399; }

.modal-footer { padding: 1rem 1.5rem; background: rgba(15, 23, 42, 0.9); border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--text-muted); }
.btn-gold { background: var(--primary); color: #0f172a; font-weight: bold; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; box-shadow: 0 0 10px var(--primary-glow); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

.feature-icon { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 0.75rem; }
.icon-gold { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--primary); }
.icon-green { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--marker-color); }
.icon-blue { background: rgba(59, 130, 246, 0.15); border: 1px solid #3b82f6; }

.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--border-gold); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-badge { position: absolute; left: -2.65rem; top: 0; width: 22px; height: 22px; background: var(--primary); color: #0f172a; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold; }
.timeline-year { font-weight: bold; color: var(--primary); font-size: 0.85rem; }
.timeline-content h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.timeline-content p { font-size: 0.85rem; color: var(--text-muted); }

.footer { text-align: center; padding: 2rem; background: #0b0f19; border-top: 1px solid var(--border-color); font-size: 0.8rem; color: var(--text-muted); }
.footer-sub { font-size: 0.7rem; color: var(--primary); margin-top: 0.25rem; }

@media (max-width: 768px) {
    .nav-container { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .brand h1 { font-size: 0.95rem; }
    .nav-links { display: flex; flex-wrap: wrap; gap: 0.75rem; width: 100%; }
    .nav-links a { margin-left: 0; font-size: 0.8rem; }
    .hero { padding: 2rem 1rem; }
    .hero h2 { font-size: 1.5rem; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .map-viewport { height: 400px; }
    .modal-backdrop { padding: 0.75rem; overflow-y: auto; }
    .modal-window { width: 100%; max-width: 650px; max-height: 94dvh; overflow-y: auto; }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; gap: 1rem; }
    .modal-image-wrap { height: 160px; flex-shrink: 0; }
    .info-boxes { grid-template-columns: 1fr; gap: 0.75rem; }
    .modal-footer { flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 1rem; }
    .btn-gold { width: 100%; padding: 0.75rem; }
    .section-padding { padding: 2.5rem 1rem; }
    .card { padding: 1rem; }
    .map-card { padding: 0; }
}
