/* ================================================
   XRAYNEWS — dashboard.css
   ================================================ */

/* ---- Page Layout ---- */
.dashboard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* ================================================
   TOP NAVIGATION
   ================================================ */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 1rem;
  background: rgba(8,11,18,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 24px rgba(0,0,0,0.5);
  /* Safe area support for notched phones */
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-icon { font-size: 1.3rem; line-height: 1; }
.nav-logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  background: linear-gradient(135deg, var(--accent-cyan), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Center zone */
.nav-center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 620px;
}

/* Dropdown trigger button */
.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  position: relative;
}
.nav-btn:hover {
  background: rgba(0,212,255,0.07);
  border-color: rgba(0,212,255,0.3);
  color: var(--text-primary);
}
.nav-dropdown { position: relative; }
.dropdown-arrow { font-size: 0.65rem; }

/* Search */
.nav-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.nav-search-input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2.2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.83rem;
  transition: var(--transition-fast);
}
.nav-search-input::placeholder { color: var(--text-muted); }
.nav-search-input:focus {
  outline: none;
  border-color: rgba(0,212,255,0.4);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.08);
}
.search-dropdown {
  left: 0;
  right: 0;
  min-width: unset;
  max-height: 320px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
}
.search-result-item:hover { background: rgba(0,212,255,0.07); }
.search-result-flag  { font-size: 1rem; flex-shrink: 0; }
.search-result-text  { font-size: 0.82rem; color: var(--text-primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta  { font-size: 0.74rem; color: var(--text-muted); flex-shrink: 0; }

/* Right zone */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Live indicator */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.25);
  border-radius: 20px;
}
.live-dot {
  width: 7px; height: 7px;
  background: #ff4444;
  border-radius: 50%;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #ff4444; }
  50%       { opacity: 0.4; box-shadow: none; }
}
.live-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ff4444;
  letter-spacing: 0.12em;
}

/* Notification button */
.nav-icon-btn {
  position: relative;
  padding: 0.4rem 0.55rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.nav-icon-btn:hover { background: rgba(0,212,255,0.07); border-color: rgba(0,212,255,0.3); color: var(--text-primary); }
.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  background: var(--unverified);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* User menu */
.user-menu { position: relative; }
.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.user-avatar-btn:hover { background: rgba(0,212,255,0.07); border-color: rgba(0,212,255,0.3); }
.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
}
.user-name { font-size: 0.8rem; color: var(--text-secondary); }
.user-chevron { font-size: 0.6rem; color: var(--text-muted); }
.user-dropdown { right: 0; left: auto; min-width: 180px; }
.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================
   TICKERS
   ================================================ */
.ticker-bar {
  display: flex;
  align-items: center;
  height: var(--ticker-height);
  overflow: hidden;
  position: relative;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.ticker-breaking { margin-top: var(--nav-height); }

.ticker-breaking {
  background: linear-gradient(90deg, rgba(180,0,0,0.25) 0%, rgba(20,10,10,0.95) 120px);
}
.ticker-verified {
  background: linear-gradient(90deg, rgba(0,80,40,0.3) 0%, rgba(8,17,13,0.95) 120px);
}

.ticker-label {
  flex-shrink: 0;
  padding: 0 0.9rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 2;
  position: relative;
}
.breaking-label { color: #ff6b6b; background: rgba(180,0,0,0.15); }
.verified-label  { color: var(--verified); background: rgba(0,80,40,0.2); }

.ticker-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.ticker-wrapper::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--bg-primary));
  pointer-events: none;
  z-index: 1;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  will-change: transform;
}
.ticker-ltr { animation: ticker-ltr 240s linear infinite; }
.ticker-rtl { animation: ticker-rtl 320s linear infinite; }
.ticker-ltr:hover, .ticker-rtl:hover { animation-play-state: paused; }

@keyframes ticker-ltr {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes ticker-rtl {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.ticker-flag       { font-size: 0.95rem; line-height: 1; }
.ticker-headline   { color: var(--text-primary); }
.ticker-confidence { color: var(--verified); font-weight: 600; font-size: 0.72rem; }
.ticker-breaking-tag { color: #ff6b6b; font-weight: 700; font-size: 0.72rem; }
.ticker-dot { color: var(--text-muted); padding: 0 0.2rem; font-size: 0.7rem; }

/* ================================================
   GLOBE SECTION
   ================================================ */
.globe-section {
  background-color: #080b12;
  position: relative;
  width: 100%;
  height: calc(100vh - var(--nav-height) - var(--ticker-height) * 2);
  min-height: 400px;
  overflow: visible;
  background: var(--bg-primary);
  flex-shrink: 0;
}

#globe-container {
  width: 100%;
  height: 100%;
  display: block;

  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;}

/* Globe tooltip */
.globe-tooltip {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  background: rgba(13,17,23,0.95);
  border: 1px solid rgba(0,212,255,0.22);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  min-width: 140px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
.globe-tooltip.visible { opacity: 1; transform: translateY(0); }
.tooltip-country {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: var(--accent-cyan);
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}
.tooltip-count { font-size: 0.8rem; color: var(--text-secondary); }
.tooltip-heat  { font-size: 0.72rem; color: var(--contested); margin-top: 2px; }

/* Overlay mode controls */
.overlay-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: none !important;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.overlay-btn {
  padding: 0.38rem 0.85rem;
  background: rgba(8,11,18,0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,212,255,0.18);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.overlay-btn:hover {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.45);
  color: var(--text-primary);
}
.overlay-btn.active {
  background: rgba(0,212,255,0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* Country filter badge */
.country-filter-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(0,212,255,0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,212,255,0.35);
  border-radius: 20px;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  animation: badge-in 0.2s ease both;
}
.country-filter-badge.visible { display: flex; }
@keyframes badge-in { from { opacity:0; transform: scale(0.9); } to { opacity:1; transform: scale(1); } }
.clear-filter-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(0,212,255,0.6); font-size: 0.75rem; line-height: 1;
  padding: 0 2px;
  transition: color var(--transition-fast);
}
.clear-filter-btn:hover { color: var(--accent-cyan); }

/* Globe HUD stats */
.globe-stats {
  position: absolute;
  bottom: 1.2rem;
  left: 1.2rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-lg);
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-icon   { font-size: 1rem; line-height: 1; }
.stat-block  { display: flex; flex-direction: column; line-height: 1.2; }
.stat-value  { font-family: 'Orbitron', sans-serif; font-size: 1rem; font-weight: 700; }
.stat-label  { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-divider { width: 1px; height: 32px; background: var(--glass-border); }

/* Globe legend */
.globe-legend {
  position: absolute;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
}
.legend-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}
.legend-scale {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.legend-swatch {
  width: 22px; height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
}
.legend-item span {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ================================================
   STORIES SECTION
   ================================================ */
.stories-section {
  padding: 1.5rem 1.25rem 2rem;
  background: var(--bg-primary);
}

.stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stories-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.stories-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
}
.stories-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Story grid */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* Loading / empty states */
.loading-stories {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.no-stories {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-muted);
  text-align: center;
}

/* ================================================
   STORY CARD
   ================================================ */
.story-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform var(--transition-normal),
              box-shadow var(--transition-normal),
              border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.story-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0;
  transition: opacity var(--transition-normal);
}
@media(hover:hover){
.story-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,212,255,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), var(--glow-cyan);
}
.story-card:hover::before { opacity: 1; }
}
.story-card:focus {
  outline: 2px solid rgba(0,212,255,0.5);
  outline-offset: 2px;
}

/* Card top row */
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.card-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Category badge */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(var(--cat-color, 0,212,255), 0.1);
  color: var(--cat-color, var(--accent-cyan));
  border: 1px solid color-mix(in srgb, var(--cat-color, #00d4ff) 35%, transparent);
}

/* Breaking badge */
.breaking-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: rgba(255,68,68,0.12);
  border: 1px solid rgba(255,68,68,0.3);
  border-radius: 5px;
  color: #ff6b6b;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.06em;
  animation: break-pulse 2s ease-in-out infinite;
}
@keyframes break-pulse {
  0%,100% { box-shadow: none; }
  50%      { box-shadow: 0 0 8px rgba(255,68,68,0.45); }
}

/* Country */
.card-country {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.country-flag { font-size: 1.05rem; line-height: 1; }
.country-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card body */
.card-body { flex: 1; }
.card-headline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.card-summary {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Confidence */
.confidence-wrap {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
}
.confidence-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.confidence-label {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.confidence-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}
.confidence-track {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.confidence-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
  width: 0%;
}
.confidence-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.verified-count {
  font-size: 0.7rem;
  color: var(--verified);
  font-weight: 600;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.card-sources, .card-time {
  font-size: 0.73rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.card-expand-btn {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  padding: 3px 9px;
  border: 1px solid rgba(0,212,255,0.22);
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition-fast);
  background: none;
}
.card-expand-btn:hover {
  background: rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.5);
  box-shadow: var(--glow-cyan);
}

/* Expanded sources panel */
.card-expanded {
  display: none;
  overflow: hidden;
}
.card-expanded.open { display: block; animation: expand-in 0.22s ease both; }
@keyframes expand-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.expanded-inner {
  padding-top: 0.65rem;
  border-top: 1px solid rgba(0,212,255,0.1);
  margin-top: 0.1rem;
}
.expanded-loading { font-size: 0.78rem; color: var(--text-muted); padding: 0.4rem 0; }
.sources-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.sources-list { display: flex; flex-direction: column; gap: 0.3rem; }
.source-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: rgba(255,255,255,0.025);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
}
.source-agree   { font-size: 0.8rem; flex-shrink: 0; font-weight: 700; }
.agree-yes      { color: var(--verified); }
.agree-no       { color: var(--unverified); }
.source-name    { flex: 1; color: var(--text-primary); font-weight: 500; }
.source-type    { color: var(--text-muted); font-size: 0.7rem; }
.source-link    { color: var(--accent-cyan); font-size: 0.8rem; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1100px) {
  .story-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-center { max-width: none; }
  .nav-btn    { display: none; }
  .story-grid { grid-template-columns: 1fr; }
  .globe-section { height: calc(100vh - var(--nav-height) - var(--ticker-height) * 2); min-height: 340px;   position: relative;
  overflow: visible;
}
  .globe-stats { gap: 0.65rem; padding: 0.5rem 0.75rem; }
  .stat-value  { font-size: 0.85rem; }
  .overlay-controls { top: 0.6rem; right: 0.6rem; }
  .overlay-btn { padding: 0.3rem 0.6rem; font-size: 0.68rem; }
  .stories-header { flex-direction: column; align-items: flex-start; }
  .stories-controls { width: 100%; justify-content: flex-start; }
  .user-name, .user-chevron { display: none; }
  .live-text { display: none; }
}

@media (max-width: 480px) {
  .top-nav { padding: 0 0.75rem; gap: 0.5rem; padding-top: max(20px, env(safe-area-inset-top, 20px)); height: calc(var(--nav-height) + max(20px, env(safe-area-inset-top, 20px))); }
  .nav-search-wrapper { max-width: 160px; }
  .globe-legend { display: none; }
  .stories-section { padding: 1rem 0.75rem 1.5rem; }
}

/* ---- Fresh badge ---- */
.fresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,255,100,0.12);
  color: #00ff64;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(0,255,100,0.3);
  animation: fresh-pulse 2s infinite;
}
@keyframes fresh-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ---- Source badge ---- */
.source-badge {
  display: inline-block;
  background: rgba(0,212,255,0.08);
  color: #00d4ff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(0,212,255,0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ---- Toast notifications ---- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(13,17,23,0.96);
  border: 1px solid rgba(255,60,60,0.35);
  border-left: 3px solid #ff3c3c;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 280px;
  max-width: 360px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  font-family: Inter, sans-serif;
}
.toast.toast-in  { transform: translateX(0); }
.toast.toast-out { transform: translateX(120%); }
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-label { font-size: 10px; font-weight: 700; color: #ff3c3c; letter-spacing: 0.1em; margin-bottom: 3px; }
.toast-headline { font-size: 12px; color: #e8eaf0; line-height: 1.4; }
.toast-country { font-size: 10px; color: #8892a4; margin-top: 4px; }
.toast-close {
  background: none;
  border: none;
  color: #8892a4;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.toast-close:hover { color: #e8eaf0; }

/* ---- Stats bar ---- */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 10px 24px;
  background: rgba(13,17,23,0.7);
  border-top: 1px solid rgba(0,212,255,0.1);
  border-bottom: 1px solid rgba(0,212,255,0.1);
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #8892a4;
}
.stat-item .stat-num {
  color: #00d4ff;
  font-weight: 700;
  font-size: 15px;
  min-width: 28px;
  text-align: right;
}
.stat-item .stat-label { color: #5a6478; font-size: 10px; letter-spacing: 0.06em; }
.stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(0,212,255,0.12);
}
@media (max-width:600px) {
  .stats-bar { gap: 16px; }
  .stat-divider { display: none; }
}

/* ---- Modal source link ---- */
.mdl-source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,212,255,0.1);
  color: #00d4ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0,212,255,0.3);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  margin-left: 8px;
}
.mdl-source-link:hover {
  background: rgba(0,212,255,0.2);
  border-color: rgba(0,212,255,0.6);
  color: #fff;
}

/* ---- Dropdown panel z-index fix ---- */
.dropdown-menu {
  z-index: 1100 !important;
}
.notif-panel {
  z-index: 1100 !important;
}

#globe-container {
  position: relative;
  z-index: 2;
}



/* Card improvements */
.story-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
@media(hover:hover){
.story-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,255,0.15);
}
}




  50%       { opacity: 0.45; }
}

/* Outline mode button */
/* HIDDEN */ .overlay-btn.outline-btn { display: none;
  border-left: 1px solid rgba(0,212,255,0.15);
  margin-left: 4px;
  padding-left: 10px;
}
.overlay-btn.outline-btn.active {
  background: rgba(0,212,255,0.18);
  color: #00d4ff;
  border-color: rgba(0,212,255,0.5);
}

/* Load More Button */
.load-more-container {
  text-align: center;
  padding: 32px 20px 48px;
}
.load-more-btn {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.25);
  color: #00d4ff;
  font-family: Orbitron, sans-serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  padding: 14px 40px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}
.load-more-btn:hover {
  background: rgba(0,212,255,0.14);
  border-color: rgba(0,212,255,0.5);
  box-shadow: 0 0 20px rgba(0,212,255,0.2);
  transform: translateY(-2px);
}
.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Story Save/Bookmark Button */
.card-save-btn {
  background: none;
  border: none;
  color: rgba(232,234,240,0.35);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
  margin-left: auto;
}
.card-save-btn:hover {
  color: #ffd700;
  transform: scale(1.2);
  background: rgba(255,215,0,0.08);
}
.card-save-btn.card-saved {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255,215,0,0.6);
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Dropdown open state */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: #0d1117;
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  padding: 6px 0;
  z-index: 1100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}
.dropdown-menu.open {
  display: block;
  animation: dropFade 0.15s ease;
}
@keyframes dropFade {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.nav-dropdown {
  position: relative;
}
.user-menu {
  position: relative;
}
.search-dropdown {
  left: auto;
  right: 0;
  min-width: 280px;
}
.user-dropdown {
  left: auto;
  right: 0;
  min-width: 200px;
}
.notifications-menu {
  left: auto;
  right: 0;
  min-width: 320px;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  color: #e8eaf0;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.dropdown-item:hover,
.dropdown-item.active {
  background: rgba(0,212,255,0.12);
  color: #00d4ff;
}
.dropdown-item.danger {
  color: #ff4444;
}
.dropdown-item.danger:hover {
  background: rgba(255,68,68,0.12);
}
.dropdown-divider {
  height: 1px;
  background: rgba(0,212,255,0.1);
  margin: 4px 0;
}
.dropdown-arrow {
  font-size: 10px;
  margin-left: 4px;
  transition: transform 0.2s;
}
[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}


/* ============================================
   OVERLAY / MAP MODE BUTTONS — REDESIGNED
   ============================================ */
.globe-overlay-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 20;
  background: rgba(8,11,18,0.85);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 32px;
  padding: 6px 10px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(0,212,255,0.08);
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 32px);
}

.overlay-btn {
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  color: rgba(232,234,240,0.55);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: Inter, sans-serif;
}
.overlay-btn:hover {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.3);
  color: #00d4ff;
  transform: translateY(-1px);
}
.overlay-btn.active {
  background: rgba(0,212,255,0.18);
  border-color: rgba(0,212,255,0.6);
  color: #00d4ff;
  box-shadow: 0 0 12px rgba(0,212,255,0.25), inset 0 1px 0 rgba(0,212,255,0.15);
  text-shadow: 0 0 8px rgba(0,212,255,0.5);
}

/* Mode-specific active colors */
.overlay-btn[data-mode="conflicts"].active {
  background: rgba(255,68,68,0.18);
  border-color: rgba(255,68,68,0.6);
  color: #ff4444;
  box-shadow: 0 0 12px rgba(255,68,68,0.25);
  text-shadow: 0 0 8px rgba(255,68,68,0.5);
}
.overlay-btn[data-mode="weather"].active {
  background: rgba(0,160,255,0.18);
  border-color: rgba(0,160,255,0.6);
  color: #00a0ff;
  box-shadow: 0 0 12px rgba(0,160,255,0.25);
  text-shadow: 0 0 8px rgba(0,160,255,0.5);
}
.overlay-btn[data-mode="elections"].active {
  background: rgba(140,40,255,0.18);
  border-color: rgba(140,40,255,0.6);
  color: #c060ff;
  box-shadow: 0 0 12px rgba(140,40,255,0.25);
  text-shadow: 0 0 8px rgba(140,40,255,0.5);
}
.overlay-btn[data-mode="density"].active {
  background: rgba(255,170,0,0.18);
  border-color: rgba(255,170,0,0.6);
  color: #ffaa00;
  box-shadow: 0 0 12px rgba(255,170,0,0.25);
  text-shadow: 0 0 8px rgba(255,170,0,0.5);
}
.outline-btn {
  border-left: 1px solid rgba(0,212,255,0.15) !important;
  margin-left: 4px;
  padding-left: 16px;
}

/* Spin toggle button */

/* ============================================
   STORIES FILTER BAR — REDESIGNED
   ============================================ */
.stories-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.control-select {
  background: rgba(13,17,23,0.95);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 20px;
  color: rgba(232,234,240,0.8);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 28px 6px 12px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(0,212,255,0.5)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all 0.2s ease;
  min-width: 120px;
  font-family: Inter, sans-serif;
}
.control-select:hover {
  border-color: rgba(0,212,255,0.4);
  color: #e8eaf0;
  box-shadow: 0 0 8px rgba(0,212,255,0.1);
}
.control-select:focus {
  border-color: rgba(0,212,255,0.6);
  box-shadow: 0 0 12px rgba(0,212,255,0.2);
}
.control-select option {
  background: #0d1117;
  color: #e8eaf0;
}

/* Stories header redesign */
.stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(13,17,23,0.6);
  border-bottom: 1px solid rgba(0,212,255,0.08);
  gap: 12px;
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.stories-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #00d4ff;
  font-family: Orbitron, sans-serif;
  white-space: nowrap;
}
.stories-count {
  background: rgba(0,212,255,0.12);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  color: rgba(0,212,255,0.8);
  font-family: Inter, sans-serif;
  font-weight: 600;
}

/* Stats bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 20px;
  background: rgba(8,11,18,0.9);
  border-bottom: 1px solid rgba(0,212,255,0.08);
  border-top: 1px solid rgba(0,212,255,0.05);
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
}
.stat-num {
  font-family: Orbitron, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #00d4ff;
  line-height: 1;
}
.stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(232,234,240,0.4);
}
.stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(0,212,255,0.1);
}

/* Activity legend */
.activity-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0 12px;
  color: rgba(232,234,240,0.4);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-low    { background: rgba(140,40,255,0.8); }
.legend-med    { background: rgba(255,210,0,0.8); }
.legend-high   { background: rgba(255,120,0,0.8); }
.legend-max    { background: rgba(255,45,45,0.9); }

/* Xray Badge */
.xray-badge {
  font-size: 9px;
  font-weight: 600;
  color: #00ff88;
  background: rgba(0,255,136,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: help;
}
.xray-badge:hover {
  background: rgba(0,255,136,0.25);
}


/* Primary action button in modal */
.mdl-action-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%) !important;
  color: #000 !important;
  text-decoration: none !important;
}
.mdl-action-primary:hover {
  opacity: 0.9;
}


/* ================================================
   STORY THREADING STYLES
   ================================================ */

/* Thread badge on story cards */
.thread-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  margin-left: 8px;
  white-space: nowrap;
}

.thread-badge:hover {
  background: rgba(139, 92, 246, 0.25);
}

/* Related thread badge */
.related-thread-badge {
  font-size: 12px;
  margin-left: auto;
  padding: 0 4px;
}

/* Thread section on story detail page */
#thread-section {
  margin: 24px 0;
  padding: 20px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
}

#thread-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  margin-bottom: 16px;
}

/* Thread navigation */
.thread-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.thread-nav-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thread-nav-btn:hover:not(.thread-nav-disabled) {
  background: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

.thread-nav-disabled {
  color: #666;
  background: rgba(100, 100, 100, 0.1);
  border-color: rgba(100, 100, 100, 0.2);
  cursor: default;
}

.thread-position {
  font-size: 13px;
  color: #8b5cf6;
  font-weight: 600;
}

/* Thread items list */
.thread-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  text-decoration: none;
  color: #e0e0e0;
  transition: all 0.2s ease;
}

.thread-item:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

.thread-item.thread-active {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
}

.thread-num {
  font-size: 11px;
  font-weight: 700;
  color: #8b5cf6;
  min-width: 28px;
}

.thread-content {
  flex: 1;
  min-width: 0;
}

.thread-headline {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.thread-current {
  color: #8b5cf6;
  font-size: 16px;
}

/* ================================================
   COUNTRY BRIEFINGS STYLES (SIDEBAR)
   ================================================ */

/* Briefing section in sidebar */
.sb-briefing-section {
  padding: 12px 0;
}

.sb-briefing-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #00d4ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.sb-briefing-icon {
  font-size: 14px;
}

.sb-briefing-content {
  font-size: 13px;
  line-height: 1.5;
}

.sb-briefing-loading {
  color: #666;
  font-style: italic;
  padding: 8px 0;
}

.sb-briefing-inner {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
}

.sb-briefing-date {
  font-size: 11px;
  color: #00d4ff;
  font-weight: 600;
  margin-bottom: 8px;
}

.sb-briefing-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.sb-briefing-stat {
  font-size: 12px;
  color: #00d4ff;
}

.sb-briefing-top {
  font-size: 11px;
  color: #00ff88;
  text-decoration: none;
  transition: color 0.2s;
}

.sb-briefing-top:hover {
  color: #00ff88;
  text-decoration: underline;
}

.sb-briefing-summary {
  font-size: 12px;
  color: #b0b0b0;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}

/* Thread badge in sidebar mini cards */
.sb-thread-badge {
  font-size: 10px;
  margin-left: auto;
  opacity: 0.8;
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */

@media (max-width: 768px) {
  .thread-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .thread-nav-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .thread-item {
    padding: 10px 12px;
  }
  
  .thread-headline {
    font-size: 13px;
  }
}

/* Story detail link */
.card-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 4px;
  color: #00d4ff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.card-detail-link:hover {
  background: rgba(0,212,255,0.22);
  border-color: #00d4ff;
  color: #fff;
}

/* === GLOBE GLOW EFFECT - SUBTLE === */
#globe-container {
  position: relative;
}

/* ================================================
   LOAD MORE BUTTON
   ================================================ */

.load-more-wrapper {
  display: flex;
  justify-content: center;
  padding: 24px 0 32px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.load-more-btn:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
  transform: translateY(-1px);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.load-more-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Loading spinner for load-more */
.load-more-btn.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .load-more-btn {
    padding: 12px 24px;
    font-size: 13px;
  }
}


/* Mobile Portrait Fix - Aggressive navbar padding */
@media (max-width: 768px) and (orientation: portrait) {
  .top-nav {
    padding-top: 25px !important;
    height: calc(var(--nav-height) + 25px) !important;
  }
  body {
    padding-top: 25px;
  }
  .mobile-menu {
    top: calc(60px + 25px) !important;
  }
}

/* Extra safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 768px) and (orientation: portrait) {
    .top-nav {
      padding-top: max(25px, env(safe-area-inset-top)) !important;
      height: calc(var(--nav-height) + max(25px, env(safe-area-inset-top))) !important;
    }
    body {
      padding-top: max(25px, env(safe-area-inset-top));
    }
    .mobile-menu {
      top: calc(60px + max(25px, env(safe-area-inset-top))) !important;
    }
  }
}


/* Sources Empty State */
.sources-empty {
  padding: 24px 16px;
  text-align: center;
  color: rgba(232, 234, 240, 0.6);
}
.sources-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.sources-empty-text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(232, 234, 240, 0.8);
  margin-bottom: 4px;
}
.sources-empty-sub {
  font-size: 12px;
  color: rgba(232, 234, 240, 0.4);
}

/* ================================================
   VISUAL POLISH v2026-03-09
   ================================================ */

/* Category-colored left accent border on cards */
.story-card {
  border-left: 3px solid var(--card-accent, rgba(0,212,255,0.4));
}
.story-card:hover {
  border-left-color: var(--card-accent, var(--accent-cyan));
}

/* Confidence row — xray badge + score grouped right */
.confidence-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conf-pct {
  font-size: 0.58em;
  opacity: 0.4;
  font-weight: 400;
}

/* Card footer: left meta / right actions */
.card-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.card-meta-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Sidebar mini score bar */
.sb-score-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
  min-width: 36px;
  max-width: 72px;
}
.sb-score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Sidebar close polish */
.sb-close {
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}
.sb-close:hover {
  background: rgba(255,68,68,0.25) !important;
  color: #ff6b6b;
}

/* Sidebar view-all Orbitron */
.sb-view-all {
  font-family: 'Orbitron', sans-serif !important;
  font-size: 10px !important;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* HUD stat gradient */
.stat-value {
  background: linear-gradient(135deg, var(--accent-cyan), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================
   Country Heat Map Tooltip
   ================================================ */
.country-tooltip {
  background: rgba(8, 11, 18, 0.95) !important;
  border: 1px solid rgba(0, 212, 255, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 255, 0.15) !important;
}
.country-tooltip::before {
  border-top-color: rgba(0, 212, 255, 0.4) !important;
}
.country-tooltip .leaflet-tooltip-content {
  color: #e8eaf0;
  font-family: 'Inter', sans-serif;
  margin: 0;
}

/* Prevent text selection on map */
#globe-container,
#globe-container svg,
#globe-container path,
#globe-container .leaflet-container,
#globe-container .leaflet-interactive {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-container {
  user-select: none;
  -webkit-user-select: none;
}

.country-tooltip {
  user-select: none;
  -webkit-user-select: none;
}

/* Aggressive no-select for Leaflet map elements */
.leaflet-container,
.leaflet-container svg,
.leaflet-container path,
.leaflet-interactive,
.leaflet-interactive path,
svg.leaflet-zoom-animated,
.leaflet-overlay-pane svg,
.leaflet-overlay-pane path {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

.leaflet-container path {
  pointer-events: all;
  cursor: pointer;
}

.leaflet-container path:focus {
  outline: none !important;
}

/* Nuclear option: prevent ALL selection on map */
#globe-container * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Prevent SVG focus/active states */
.leaflet-interactive,
.leaflet-interactive *,
svg.leaflet-zoom-animated path,
.leaflet-overlay-pane path {
  outline: none !important;
  outline-offset: 0 !important;
  stroke-dasharray: none !important;
}

/* Remove any Leaflet click highlight */
.leaflet-clickable,
.leaflet-clickable:hover,
.leaflet-clickable:active,
.leaflet-clickable:focus {
  outline: none !important;
  stroke: inherit !important;
  stroke-width: inherit !important;
}

/* Prevent text selection highlight color */
::selection {
  background: transparent !important;
}
::-moz-selection {
  background: transparent !important;
}

/* Remove focus ring from SVG paths */
svg path:focus,
svg path:active,
svg *:focus,
svg *:active {
  outline: none !important;
  outline-offset: 0 !important;
}

/* Leaflet specific: remove any highlight class */
.leaflet-interactive.leaflet-clickable {
  outline: none !important;
}

.leaflet-interactive:hover {
  outline: none !important;
}

/* Stories Search Wrapper */
.stories-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.stories-search-icon {
  position: absolute;
  left: 10px;
  color: rgba(0, 212, 255, 0.6);
  font-size: 14px;
  pointer-events: none;
}

.stories-search-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px 8px 32px;
  color: #fff;
  font-size: 13px;
  width: 180px;
  transition: all 0.2s ease;
}

.stories-search-input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.stories-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 900px) {
  .stories-search-input {
    width: 140px;
  }
}

@media (max-width: 600px) {
  .stories-search-wrapper {
    width: 100%;
  }
  .stories-search-input {
    width: 100%;
  }
}
