/* ================================================
   XRAYNEWS — main.css
   Shared design system, variables, reset, utilities
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;900&display=swap');

/* ------------------------------------------------
   CSS Custom Properties
   ------------------------------------------------ */
:root {
  /* Backgrounds */
  --bg-primary:   #080b12;
  --bg-secondary: #0d1117;
  --bg-tertiary:  #141922;

  /* Accents */
  --accent-cyan:   #00d4ff;
  --accent-purple: #7b2fff;

  /* Status */
  --verified:    #00ff88;
  --unverified:  #ff4444;
  --contested:   #ffaa00;
  --false-flag:  #ff0066;

  /* Text */
  --text-primary:   #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;

  /* Glass */
  --glass-bg:     rgba(13, 17, 23, 0.72);
  --glass-border: rgba(0, 212, 255, 0.12);
  --glass-blur:   blur(20px);

  /* Glows */
  --glow-cyan:   0 0 20px rgba(0, 212, 255, 0.3);
  --glow-purple: 0 0 20px rgba(123, 47, 255, 0.3);
  --glow-green:  0 0 16px rgba(0, 255, 136, 0.3);
  --glow-red:    0 0 16px rgba(255, 68, 68, 0.3);

  /* Layout */
  --nav-height:    60px;
  --ticker-height: 40px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s ease;
}

/* ------------------------------------------------
   Reset
   ------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: #fff; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  transition: var(--transition-fast);
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
}

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

/* ------------------------------------------------
   Typography
   ------------------------------------------------ */
.font-orbitron { font-family: 'Orbitron', sans-serif; }
.font-inter    { font-family: 'Inter',    sans-serif; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

.text-primary   { color: var(--text-primary)   !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted)     !important; }
.text-cyan      { color: var(--accent-cyan)    !important; }
.text-purple    { color: var(--accent-purple)  !important; }
.text-verified  { color: var(--verified)       !important; }
.text-danger    { color: var(--unverified)     !important; }

/* ------------------------------------------------
   Glassmorphism
   ------------------------------------------------ */
.glass {
  background:    var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.glass-card {
  background:    var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ------------------------------------------------
   Buttons
   ------------------------------------------------ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), #0099cc);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover {
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.55);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: transparent;
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 212, 255, 0.35);
  cursor: pointer;
  transition: var(--transition-normal);
}
.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* ------------------------------------------------
   Form Elements
   ------------------------------------------------ */
.input-field {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(0,212,255,0.14);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  outline: none;
  border-color: rgba(0,212,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.10), var(--glow-cyan);
  background: rgba(255,255,255,0.06);
}

.control-select {
  padding: 0.5rem 0.9rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238892a4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}
.control-select:hover, .control-select:focus {
  border-color: rgba(0,212,255,0.35);
  color: var(--text-primary);
  outline: none;
}
.control-select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ------------------------------------------------
   Status Badges
   ------------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
}

.badge-verified   { background: rgba(0,255,136,0.12); color: var(--verified); border: 1px solid rgba(0,255,136,0.28); }
.badge-unverified { background: rgba(255,170,0,0.10); color: var(--contested); border: 1px solid rgba(255,170,0,0.28); }
.badge-contested  {
  background: rgba(255,68,68,0.10); color: var(--unverified); border: 1px solid rgba(255,68,68,0.28);
  animation: badge-pulse 1.8s ease-in-out infinite;
}
.badge-false      { background: rgba(255,0,102,0.10); color: var(--false-flag); border: 1px solid rgba(255,0,102,0.28); text-decoration: line-through; }

@keyframes badge-pulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 10px rgba(255,68,68,0.4); }
}

/* ------------------------------------------------
   Scrollbar
   ------------------------------------------------ */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb        { background: rgba(0,212,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(0,212,255,0.4); }

/* ------------------------------------------------
   Utilities
   ------------------------------------------------ */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm  { gap: 0.5rem; }
.flex-gap-md  { gap: 1rem; }
.hidden       { display: none !important; }
.sr-only      { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.loading-spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(0,212,255,0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
/* Dropdown menus (shared) */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  z-index: 2000;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), var(--glow-cyan);
  animation: dropdown-in var(--transition-fast) ease both;
}
.dropdown-menu.open { display: block; }
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: left;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
}
.dropdown-item:hover {
  background: rgba(0,212,255,0.07);
  color: var(--text-primary);
}
.dropdown-item.danger { color: var(--unverified); }
.dropdown-item.danger:hover { background: rgba(255,68,68,0.08); }
.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.25rem 0;
}

/* ============================================
   PINNED STYLES
   ============================================ */

#pinned-stories {
    margin-bottom: 24px;
}

.pinned-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pinned-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pinned-icon {
    font-size: 20px;
}

.pinned-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
}

.pinned-updated {
    margin-left: auto;
    font-size: 12px;
    color: #888;
}

.pinned-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .pinned-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .pinned-section {
        padding: 12px;
    }
    .pinned-header h3 {
        font-size: 14px;
    }
    .pinned-headline {
        font-size: 13px;
    }
    .pinned-card {
        padding: 12px;
    }
}

@media (max-width: 1024px) {
    .pinned-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


.pinned-card {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3), 0 0 30px rgba(0, 255, 136, 0.2);
    position: relative;
    background: rgba(11, 15, 25, 0.95);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    z-index: 0;
}

.pinned-card:hover {
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.5), 0 0 50px rgba(0, 255, 136, 0.3), 0 0 80px rgba(0, 212, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.pinned-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.15);
}

.pinned-country {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.pinned-headline {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 12px;
}

.pinned-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pinned-category {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.pinned-score {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.pinned-score.high {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.pinned-score.medium {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
}

.pinned-score.low {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

/* === PINNED STORY GLOW EFFECT === */

.pinned-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00d4ff, #00ff88, #ffaa00, #00d4ff);
    background-size: 400% 400%;
    border-radius: 14px;
    z-index: -1;
    animation: pinned-glow 3s ease infinite;
    opacity: 0.7;
}

.pinned-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.95);
    border-radius: 12px;
    z-index: -1;
}

@keyframes pinned-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


.pinned-card:hover::before {
    opacity: 1;
    animation: pinned-glow 1.5s ease infinite;
}

/* ================================================
   Country Sidebar - Scrollable
   ================================================ */
#sb { position: fixed; top: 0; right: 0; width: 420px; height: 100vh; z-index: 9999; pointer-events: none; }
#sb.sb-open { pointer-events: auto; }
.sb-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); opacity: 0; transition: opacity 0.25s; }
#sb.sb-open .sb-overlay { opacity: 1; }
.sb-panel { 
  position: absolute; top: 0; right: 0; width: 100%; height: 100vh; 
  background: linear-gradient(145deg, #0d1117 0%, #080c12 100%);
  border-left: 1px solid rgba(0,200,255,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  display: flex; flex-direction: column;
}
#sb.sb-open .sb-panel { transform: translateX(0); }
.sb-head { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; position: relative; z-index: 5; }
.sb-head-info { display: flex; align-items: center; gap: 12px; }
.sb-flag { font-size: 36px; }
.sb-name { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.sb-sub { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.sb-close {
  z-index: 100; pointer-events: auto; 
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; 
  background: rgba(255,255,255,0.1); border: none; border-radius: 8px; 
  color: #fff; font-size: 18px; cursor: pointer; transition: all 0.2s;
}
.sb-close:hover { background: rgba(255,100,100,0.3); }
.sb-act { padding: 12px 20px; flex-shrink: 0; }
.sb-act-label { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 1px; margin-bottom: 8px; }
.sb-act-bars { display: flex; gap: 4px; }
.sb-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.sb-bar-on { border-radius: 2px; }
.sb-divider { height: 1px; background: rgba(255,255,255,0.08); flex-shrink: 0; }
.sb-briefing-section { flex-shrink: 0; }
.sb-briefing-head { padding: 12px 20px; font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 8px; }
.sb-briefing-icon { font-size: 16px; }
.sb-briefing-content { padding: 0 20px 16px; }
.sb-briefing-inner { background: rgba(0,150,255,0.08); border-radius: 8px; padding: 12px; border: 1px solid rgba(0,150,255,0.2); }
.sb-briefing-date { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 8px; }
.sb-briefing-stats { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sb-briefing-stat { font-size: 11px; color: rgba(255,255,255,0.6); }
.sb-briefing-top { font-size: 11px; color: #00d4ff; text-decoration: none; }
.sb-briefing-top:hover { text-decoration: underline; }
.sb-briefing-summary { font-size: 13px; color: rgba(255,255,255,0.8); line-height: 1.6; }
.sb-briefing-loading { font-size: 13px; color: rgba(255,255,255,0.5); text-align: center; padding: 20px; }
.sb-stories-title { padding: 12px 20px; font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,0.6); flex-shrink: 0; }
.sb-list { 
  flex: 1; overflow-y: auto; overflow-x: hidden; 
  padding: 0 16px 16px; 
  scrollbar-width: thin; scrollbar-color: rgba(0,200,255,0.3) transparent;
}
.sb-list::-webkit-scrollbar { width: 6px; }
.sb-list::-webkit-scrollbar-track { background: transparent; }
.sb-list::-webkit-scrollbar-thumb { background: rgba(0,200,255,0.3); border-radius: 3px; }
.sb-list::-webkit-scrollbar-thumb:hover { background: rgba(0,200,255,0.5); }
.sb-empty { padding: 40px 20px; text-align: center; color: rgba(255,255,255,0.4); font-size: 14px; }
.sb-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); 
  border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; 
  transition: all 0.2s;
}
.sb-card:hover { background: rgba(255,255,255,0.08); border-color: rgba(0,200,255,0.3); transform: translateX(-4px); }
.sb-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sb-cat { font-size: 9px; padding: 2px 8px; border-radius: 4px; border: 1px solid; letter-spacing: 0.5px; }
.sb-brk { font-size: 9px; padding: 2px 6px; background: rgba(255,100,100,0.2); color: #ff6464; border-radius: 4px; }
.sb-thread-badge { font-size: 10px; color: #a78bfa; }
.sb-social-badge { font-size: 9px; padding: 2px 6px; background: rgba(255,150,0,0.15); color: #ffaa00; border-radius: 4px; }
.sb-twitter-badge { background: rgba(29,161,242,0.15); color: #1da1f2; }
.sb-reddit-badge { background: rgba(255,69,0,0.15); color: #ff4500; }
.sb-card-hl { font-size: 14px; font-weight: 500; color: #fff; line-height: 1.4; margin-bottom: 10px; }
.sb-card-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255,255,255,0.5); }
.sb-dots { display: flex; gap: 2px; margin-right: auto; }
.sb-dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.sb-dot-on { background: currentColor; }
.sb-age { margin-left: auto; }
.sb-srcs { opacity: 0.6; }
.sb-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.sb-view-all {
  width: 100%; padding: 12px; background: linear-gradient(135deg, rgba(0,150,255,0.2), rgba(0,200,255,0.1));
  border: 1px solid rgba(0,200,255,0.3); border-radius: 8px; color: #00d4ff; 
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s;
}
.sb-view-all:hover { background: linear-gradient(135deg, rgba(0,150,255,0.3), rgba(0,200,255,0.2)); }

/* Prevent body scroll when sidebar open */
.sb-body-open { overflow: hidden; }

/* Mobile responsive */
@media (max-width: 480px) {
  #sb { width: 100vw; }
  .sb-panel { width: 100%; }
}

/* ================================================
   SIDEBAR MOBILE RESPONSIVE
   ================================================ */

/* Briefing section smooth visibility transition */
.sb-briefing-section {
  transition: visibility 0.2s, max-height 0.2s ease-out;
  overflow: hidden;
}
.sb-briefing-divider {
  transition: visibility 0.2s;
}

/* Mobile portrait - bottom sheet */
@media (max-width: 600px) {
  .sb-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 80vh !important;
    max-height: 80vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-top: 1px solid rgba(0,212,255,0.3) !important;
    border-left: none !important;
    transform: translateY(100%) !important;
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
    touch-action: pan-y !important;
    will-change: transform !important;
  }
  #sb.sb-open .sb-panel {
    transform: translateY(0) !important;
  }
  .sb-head { padding: 14px 16px !important; overflow: visible !important; }
  .sb-act { padding: 8px 16px !important; overflow: visible !important; max-height: none !important; }
  .sb-briefing-section { padding: 8px 16px !important; overflow: visible !important; max-height: none !important; }
  .sb-briefing-content { overflow: visible !important; max-height: none !important; }
  .sb-divider { display: block !important; }
  .sb-stories-title { padding: 8px 16px !important; }
  .sb-list { 
    overflow: visible !important; 
    height: auto !important; 
    max-height: none !important; 
    padding: 0 8px 12px !important; 
    margin-bottom: 8px !important;
  }
  .sb-card, .sb-list-item { 
    touch-action: pan-y !important; 
    pointer-events: auto !important;
  }
  .sb-foot { 
    padding: 20px 16px 40px 16px !important; 
    margin-top: 16px !important; 
    border-top: 1px solid rgba(0,212,255,0.15) !important;
  }
}

/* Mobile landscape */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .sb-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 95vh !important;
    max-height: 95vh !important;
    border-radius: 12px 12px 0 0 !important;
    border-top: 1px solid rgba(0,212,255,0.3) !important;
    border-left: none !important;
    transform: translateY(100%) !important;
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
    touch-action: pan-y !important;
    will-change: transform !important;
  }
  #sb.sb-open .sb-panel {
    transform: translateY(0) !important;
  }
  .sb-head { padding: 6px 16px !important; overflow: visible !important; }
  .sb-act { padding: 4px 16px !important; overflow: visible !important; max-height: none !important; }
  .sb-briefing-section { padding: 4px 16px !important; overflow: visible !important; max-height: none !important; }
  .sb-briefing-content { overflow: visible !important; max-height: none !important; }
  .sb-divider { display: block !important; }
  .sb-stories-title { padding: 4px 16px !important; }
  .sb-list { overflow: visible !important; height: auto !important; max-height: none !important; padding: 0 8px 8px !important; margin-bottom: 6px !important; }
  .sb-list-item { padding: 6px !important; margin-bottom: 4px !important; }
  .sb-foot { padding: 12px 16px 30px 16px !important; margin-top: 10px !important; border-top: 1px solid rgba(0,212,255,0.15) !important; }
}

/* Futuristic Spinner */
#globe-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}
.spinner-ring {
  width: 60px;
  height: 60px;
  border: 2px solid rgba(0, 212, 255, 0.1);
  border-top: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}
.spinner-text {
  color: var(--accent-cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── Leaflet 2D Map — Dark Theme ────────────────────────────────────────── */
#globe-container .leaflet-container {
  background: #080b12 !important;
  font-family: inherit;
}
.leaflet-tile-pane { opacity: 0.92; }
.leaflet-control-zoom a {
  background: rgba(8,11,18,0.9);
  color: #00d4ff;
  border-color: rgba(0,212,255,0.2);
}
.leaflet-control-zoom a:hover { background: rgba(0,212,255,0.1); }
.leaflet-popup-content-wrapper {
  background: rgba(8,11,18,0.95);
  border: 1px solid rgba(0,212,255,0.3);
  color: #e0e8f8;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.leaflet-popup-tip { background: rgba(8,11,18,0.95); }
.leaflet-popup-close-button { color: #00d4ff !important; }
.map-popup-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-family: 'Orbitron', sans-serif;
}
.map-popup-title {
  font-size: 13px;
  line-height: 1.4;
  color: #e0e8f8;
}

/* Pulsing breaking-news marker ring */
@keyframes markerPulse {
  0%   { box-shadow: 0 0 0 0    rgba(255,255,255,0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(255,255,255,0);   }
  100% { box-shadow: 0 0 0 0    rgba(255,255,255,0);   }
}
.breaking-marker { animation: markerPulse 1.5s ease-out infinite; }


/* ================================================
   Leaflet Map — Dark Theme v2
   ================================================ */
#globe-container {
  background: #080b12;
}
.leaflet-container {
  background: #080b12 !important;
  font-family: inherit;
}
.leaflet-tile-pane {
  opacity: 0.95;
}

/* Zoom controls */
.leaflet-control-zoom {
  border: 1px solid rgba(0,212,255,0.2) !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}
.leaflet-control-zoom a {
  background: rgba(8,11,18,0.92) !important;
  color: #00d4ff !important;
  border-color: rgba(0,212,255,0.15) !important;
  font-size: 16px !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  transition: background 0.2s;
}
.leaflet-control-zoom a:hover {
  background: rgba(0,212,255,0.12) !important;
  color: #ffffff !important;
}

/* Tooltip wrapper */
.map-tooltip-wrapper.leaflet-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.map-tooltip-wrapper.leaflet-tooltip::before {
  display: none !important;
}
.map-tooltip {
  background: rgba(8,11,18,0.96);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 240px;
  pointer-events: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.map-tooltip-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 4px;
}
.map-tooltip-title {
  color: #c8d8f0;
  font-size: 12px;
  line-height: 1.45;
}

/* Map container border glow */
#globe-container::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 500;
}

/* Force dark background on empty tile areas */

/* ================================================
   Leaflet — Force dark background everywhere
   Prevents white edges on all screen sizes
   ================================================ */
#globe-container,
#globe-container .leaflet-container,
#globe-container .leaflet-map-pane,
#globe-container .leaflet-tile-container,
#globe-container .leaflet-layer,
.leaflet-container,
.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-tile-container,
.leaflet-layer {
  background: #080b12 !important;
}

/* Individual tile cells that 404 or are out-of-bounds */
.leaflet-tile {
  background: #080b12 !important;
}

/* The globe-section and globe-container themselves */
.globe-section,
#globe-container {
  background: #080b12 !important;
  overflow: hidden;
}

/* ================================================
   Map Pins v10 — Glowing SVG Pins
   ================================================ */
.map-pin-pulse {
  animation: mapPinPulse 1.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes mapPinPulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.35); opacity: 0.75; }
  100% { transform: scale(1);   opacity: 1; }
}
.leaflet-marker-icon { cursor: pointer; }

/* ================================================
   Map Tooltip v10 — Premium Glass Design
   ================================================ */
.map-tip-wrapper.leaflet-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.map-tip-wrapper.leaflet-tooltip::before { display: none !important; }

.map-tip {
  background: rgba(6, 8, 18, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  width: 260px;
  max-width: 260px;
  min-width: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
}

.map-tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.map-tip-cat {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-tip-country {
  font-size: 10px;
  color: rgba(200, 216, 240, 0.55);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.map-tip-title {
  color: #e2eaf8;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.map-tip-score {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.map-tip-score-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(200,216,240,0.4);
}

.map-tip-score-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.map-tip-score-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.map-tip-score-val {
  font-size: 10px;
  font-weight: 700;
  min-width: 22px;
  text-align: right;
}

.map-tip-cta {
  font-size: 10px;
  color: rgba(0, 212, 255, 0.55);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: right;
  margin-top: 2px;
}

/* ============================================
   DEVELOPING STORIES SECTION
   ============================================ */
.developing-section {
  margin-bottom: 24px;
  border: 1px solid rgba(255, 68, 68, 0.25);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,59,48,0.06) 0%, rgba(255,140,0,0.03) 100%);
}
.developing-card {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.developing-card:last-child {
  border-bottom: none;
}
.developing-card:hover {
  background: rgba(255,68,68,0.06);
}
.developing-title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  line-height: 1.4;
  margin-bottom: 6px;
}
.developing-live {
  animation: pulse 2s infinite;
  background: #ff4444;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
}
.developing-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255, 59, 48, 0.08);
  border-bottom: 1px solid rgba(255, 68, 68, 0.15);
}
.developing-header h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  margin: 0;
}
.developing-icon {
  font-size: 16px;
}
.developing-content {
  flex: 1;
  min-width: 0;
}
.developing-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.developing-related {
  color: #ff9500;
}
.developing-updated {
  color: rgba(255,255,255,0.4);
}
.dev-modal-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.dev-modal-updated {
  color: rgba(255,255,255,0.4);
}
.dev-modal-related {
  color: #ff9500;
}
.dev-related-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.dev-related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.dev-related-card {
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.dev-related-card:hover {
  background: rgba(255,255,255,0.08);
}
.dev-related-headline {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}
.dev-related-meta {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ============================================
   DEVELOPING STORY MODAL
   ============================================ */
.dev-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dev-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}

.dev-modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    border: 1px solid rgba(255,59,48,0.3);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dev-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,59,48,0.05);
}

.dev-modal-title h2 {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 8px 0 0 0;
    line-height: 1.3;
}

.dev-modal-live {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #ff3b30;
    background: rgba(255,59,48,0.15);
    padding: 4px 10px;
    border-radius: 4px;
    animation: pulse-live 2s infinite;
}

.dev-modal-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dev-modal-close:hover {
    background: rgba(255,59,48,0.2);
    color: #ff3b30;
}

.dev-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.85);
}

.dev-modal-body .dev-h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dev-modal-body .dev-h3:first-child {
    margin-top: 0;
}

.dev-modal-body .dev-h4 {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin: 16px 0 8px 0;
}

.dev-modal-body .dev-p {
    margin: 0 0 16px 0;
}

.dev-modal-body .dev-list {
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

.dev-modal-body .dev-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.dev-modal-body .dev-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ff9500;
}

.dev-modal-body strong {
    color: #fff;
}

.dev-modal-body em {
    color: rgba(255,255,255,0.7);
}

.dev-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.dev-modal-updated {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dev-modal-related {
    background: rgba(255,149,0,0.15);
    color: #ff9500;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .dev-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .dev-modal-header {
        padding: 16px;
    }
    
    .dev-modal-title h2 {
        font-size: 18px;
    }
    
    .dev-modal-body {
        padding: 16px;
        font-size: 14px;
    }
    
    .dev-modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
    }
}

.xray-original-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* XrayNews Original Badge */
.xray-original-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
