/* === Layout === */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === Header — glassmorphism === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  position: relative;
}

.header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--severity-critical) 0%, var(--severity-high) 25%,
    var(--severity-medium) 50%, var(--accent) 75%,
    var(--severity-low) 100%);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__logo-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--severity-critical), var(--accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.header__title {
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  font-weight: 400;
}

.header__subtitle {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* === Main === */
.main {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* === Map === */
.map-container {
  flex: 1;
  position: relative;
  min-height: 400px;
}

#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
}

/* Map overlay stats */
.map-stats {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 600;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.map-stat {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.map-stat__value {
  font-weight: 700;
  color: var(--text-primary);
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 500;
  transition: transform var(--transition-slow);
}

.sidebar--collapsed {
  transform: translateX(100%);
  position: absolute;
  right: 0; top: 0; bottom: 0;
}

.sidebar__drag-handle { display: none; }

.sidebar__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar__title {
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-muted);
}

.sidebar__search {
  padding: 8px 16px;
  flex-shrink: 0;
}

.sidebar__search-wrap {
  position: relative;
}

.sidebar__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
  opacity: 0.6;
}

.sidebar__search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
  font-size: 0.82rem;
}

.sidebar__search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card);
}

.sidebar__search input::placeholder {
  color: var(--text-muted);
}

.sidebar__events {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0;
}

/* === Timeline === */
.timeline-container {
  height: var(--timeline-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 8px 16px 14px;
  flex-shrink: 0;
  overflow-x: auto;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  position: relative;
}

.timeline-container::before {
  content: 'TIMELINE';
  position: absolute;
  top: 4px; left: 16px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* === Footer === */
.footer {
  padding: 8px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
  gap: 12px;
}

.footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer a:hover { color: var(--accent); }

/* === Ad slots — hidden until loaded === */
.ad-slot {
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot--loaded { display: flex; }

.ad-slot--header {
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
  width: 100%;
}

.ad-slot--sidebar {
  height: 250px;
  width: 100%;
  max-width: 300px;
  margin: 8px auto;
}

.ad-slot--mobile-footer {
  height: 50px;
  width: 320px;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
}
