:root {
  --bg: #0b0b0b;
  --card: #151515;
  --text: #eaeaea;
  --muted: #9a9a9a;
  --accent: #e10600; /* red */
  --border: #2a2a2a;
}

/* Animations for admin users page */
@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutToRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Messaging Animations */
@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messagePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 212, 170, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 170, 0);
  }
}

.typing-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #888;
  margin: 0 1px;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.message-enter {
  animation: messageSlideIn 0.3s ease-out;
}

.message-sent {
  animation: messagePulse 0.6s ease-out;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.topbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}

select, button, input[type="text"] {
  background: #111;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  outline: none;
}

button.primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;

  /* 🔴 Red theme (same opacity style as your green badge) */
  background: rgba(255, 77, 77, 0.12);   /* light red background */
  border: 1px solid rgba(255, 77, 77, 0.35); 
  color: #FF9999;  /* soft red/pink text */
}

button.primary:hover {
  background: rgba(255, 77, 77, 0.2); /* slightly stronger on hover */
}


.layout {
  display: grid;
  grid-template-columns: 70% 30%;
  height: calc(100vh - 56px);
}

#map {
  width: 100%;
  height: 100%;
}

.sidebar {
  border-left: 1px solid var(--border);
  background: #0f0f0f;
  overflow: auto;
  padding: 10px;
  height: 100%;
  min-height: 100%;
}

.news-item {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  border-left: none !important; /* Prevent any unwanted red borders */
  border-right: none !important; /* Prevent any unwanted red borders */
  border-top: none !important; /* Prevent any unwanted red borders */
  outline: none !important; /* Prevent any unwanted red outlines */
  box-shadow: none !important; /* Prevent any unwanted red shadows */
}

.news-item img.icon {
  width: 20px;
  height: 20px;
  align-self: start;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

.news-item a {
  color: var(--text);
  text-decoration: none;
}
.news-item a:hover {
  color: #fff;
  text-decoration: underline;
}

.small {
  color: var(--muted);
  font-size: 12px;
}

/* News Marquee Styles */
.news-marquee-container {
  position: relative;
  margin-bottom: 16px;
}

/* Click to read text above ribbon */
.news-marquee-container::before {
  content: 'Click to read';
  display: block;
  text-align: center;
  color: #888;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.news-marquee-ribbon {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
  border: 2px solid #cc0000;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

@keyframes marquee-glow {
  0% {
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3), 0 0 20px rgba(225, 6, 0, 0.1);
  }
  100% {
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.5), 0 0 30px rgba(225, 6, 0, 0.2);
  }
}

.news-marquee {
  height: 40px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(90deg, 
    rgba(204, 0, 0, 0.1) 0%, 
    rgba(204, 0, 0, 0.2) 25%, 
    rgba(204, 0, 0, 0.3) 50%, 
    rgba(204, 0, 0, 0.2) 75%, 
    rgba(204, 0, 0, 0.1) 100%);
  border-bottom: 1px solid rgba(204, 0, 0, 0.3);
}

/* Click indicator removed */

.marquee-content {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
}

.marquee-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 0 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
  position: relative;
}

/* News text styling */
.marquee-text::after {
  content: ' • Breaking News';
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.9;
  font-weight: 500;
  color: #cc0000;
}

/* Marquee icon styling handled in JavaScript */

/* Marquee animation */
@keyframes marquee-scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Pause animation on hover */
.news-marquee:hover .marquee-content {
  animation-play-state: paused;
}

/* Click bounce animation removed */

/* Text pulse animation removed */

/* All marquee text stays white with consistent styling */

.section-title {
  padding: 6px 0;
  margin: 8px 0 4px;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
}

.token-badge { padding: 4px 8px; background: #111; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 12px; }

/* === COMPREHENSIVE MOBILE RESPONSIVENESS === */

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, rgba(11, 11, 11, 0.98) 0%, rgba(20, 20, 20, 0.95) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  box-shadow: 
    0 -2px 12px rgba(0, 0, 0, 0.3),
    0 -1px 0 rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mobile-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-left: 8px;
  padding-right: 8px;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 70px;
  position: relative;
  font-family: inherit;
  overflow: hidden;
}

.mobile-nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 16px;
}

.mobile-nav-btn:hover {
  color: #fff;
  transform: none; /* Remove transform on mobile to prevent shaking */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-nav-btn:hover::before {
  opacity: 1;
}

.mobile-nav-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.2) 0%, rgba(255, 107, 107, 0.15) 100%);
  box-shadow: 
    0 3px 10px rgba(255, 77, 77, 0.2),
    0 0 0 1px rgba(255, 77, 77, 0.2) inset;
  transform: none; /* Remove transform on mobile to prevent shaking */
}

.mobile-nav-btn.active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d4d 0%, #ff6b6b 100%);
  box-shadow: 0 0 6px rgba(255, 77, 77, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.mobile-nav-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
}

.mobile-nav-icon svg {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-nav-btn:hover .mobile-nav-icon svg {
  transform: scale(1.1);
}

.mobile-nav-btn.active .mobile-nav-icon svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(255, 77, 77, 0.4));
}

.mobile-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.mobile-nav-btn:hover .mobile-nav-label {
  opacity: 1;
  transform: translateY(-1px);
}

.mobile-nav-btn.active .mobile-nav-label {
  opacity: 1;
  color: #ff4d4d;
  text-shadow: 0 0 8px rgba(255, 77, 77, 0.3);
}

/* Map toggle specific enhancements */
.mobile-nav-btn#mobileMapToggle {
  position: relative;
}

.mobile-nav-btn#mobileMapToggle .mobile-nav-icon {
  position: relative;
}

.mobile-nav-btn#mobileMapToggle .mobile-nav-icon svg {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-nav-btn#mobileMapToggle.active .mobile-nav-icon svg {
  animation: mapPulse 1.5s ease-in-out infinite;
}

@keyframes mapPulse {
  0%, 100% { transform: scale(1.15); }
  50% { transform: scale(1.25); }
}

/* Location button specific styling */
.mobile-nav-btn#mobileLocationShare:hover {
  background: linear-gradient(135deg, rgba(0, 179, 126, 0.2) 0%, rgba(0, 212, 170, 0.15) 100%);
  box-shadow: 0 6px 20px rgba(0, 179, 126, 0.3);
}

.mobile-nav-btn#mobileLocationShare:hover .mobile-nav-icon svg {
  filter: drop-shadow(0 0 8px rgba(0, 179, 126, 0.4));
}

/* Account button specific styling */
.mobile-nav-btn#mobileAccount:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(129, 140, 248, 0.15) 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.mobile-nav-btn#mobileAccount:hover .mobile-nav-icon svg {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

/* Mobile Map Toggle Button (fallback for desktop) */
.mobile-map-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff4d4d, #ff6b6b);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 77, 77, 0.4);
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
}

.mobile-map-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 77, 77, 0.6);
}

.mobile-map-toggle.map-hidden {
  background: linear-gradient(135deg, #00b37e, #00d4aa);
  box-shadow: 0 4px 16px rgba(0, 179, 126, 0.4);
}

.mobile-map-toggle.map-hidden:hover {
  box-shadow: 0 6px 20px rgba(0, 179, 126, 0.6);
}

/* --- Mobile layout adjustments --- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 54vh 46vh;
    height: auto;
    min-height: calc(100vh - 56px);
  }
  .sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .topbar { flex-wrap: wrap; }
  .custom-selector { flex: 1 1 160px; min-width: 140px; }
  
  /* Mobile marquee adjustments */
  .news-marquee-container::before {
    display: none;
  }
  
  .news-marquee {
    height: 35px;
  }
  .marquee-text {
    font-size: 12px;
    padding: 0 15px;
  }
  .marquee-text::after {
    font-size: 10px;
    margin-left: 6px;
  }
}

/* Mobile Map Toggle Button */
.mobile-map-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff4d4d, #ff6b6b);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 77, 77, 0.4);
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
}

.mobile-map-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 77, 77, 0.6);
}

.mobile-map-toggle.map-hidden {
  background: linear-gradient(135deg, #00b37e, #00d4aa);
  box-shadow: 0 4px 16px rgba(0, 179, 126, 0.4);
}

.mobile-map-toggle.map-hidden:hover {
  box-shadow: 0 6px 20px rgba(0, 179, 126, 0.6);
}

/* Mobile Layout Adjustments */
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh 50vh;
    height: auto;
    min-height: calc(100vh - 56px);
  }
  
  .sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  
  /* When map is visible, adjust grid layout */
  .layout.map-visible {
    grid-template-rows: 60vh 40vh;
  }
  
  .layout.map-hidden {
    grid-template-rows: 0 100vh;
  }
  
  .layout.map-hidden #map {
    display: none;
  }
  
  .topbar { 
    flex-wrap: wrap; 
    gap: 8px;
  }
  
  .custom-selector { 
    flex: 1 1 140px; 
    min-width: 120px; 
  }
  
  /* Mobile marquee adjustments */
  .news-marquee {
    height: 35px;
  }
  .marquee-text {
    font-size: 12px;
    padding: 0 15px;
  }
}

/* Desktop layout - keep original topbar structure */
@media (min-width: 769px) {
  .topbar {
    display: flex;
    gap: 8px;
    padding: 10px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .topbar #topbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .topbar-controls {
    display: contents;
  }
  
  .mobile-bottom-nav {
    display: none !important;
  }
  
  .mobile-map-toggle {
    display: none !important;
  }
  
  .topbar-controls {
    display: none !important;
  }
  
  #locationIcon {
    display: flex !important;
  }
  
  #authArea {
    display: flex !important;
  }
}

/* Tablet and Mobile (768px and below) */
@media (max-width: 768px) {
  /* Prevent excessive animations and shaking on mobile */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  /* Allow text selection for input fields and content areas */
  input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }
  
  /* Reduce motion for better mobile experience */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* Prevent zooming and improve touch behavior */
  body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  /* Reduce transform animations on mobile */
  .mobile-nav-btn:hover,
  .mobile-nav-btn:active,
  .mobile-nav-btn.active {
    transform: none !important;
  }
  
  /* Smooth but minimal transitions */
  .mobile-nav-btn {
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  }
  
  /* Show mobile bottom navigation */
  .mobile-bottom-nav {
    display: flex;
  }
  
  /* Hide desktop sticky buttons on mobile */
  .mobile-map-toggle {
    display: none;
  }
  
  #locationIcon {
    display: none;
  }
  
  .layout {
    grid-template-rows: 60vh 40vh;
    padding-bottom: 80px; /* Space for bottom nav */
  }
  
  /* When map is visible, adjust grid layout */
  .layout.map-visible {
    grid-template-rows: 60vh 40vh;
  }
  
  .layout.map-hidden {
    grid-template-rows: 0 100vh;
  }
  
  .layout.map-hidden #map {
    display: none;
  }
  
  /* Mobile topbar reorganization */
  .topbar {
    padding: 12px 16px;
    gap: 0;
    flex-direction: column;
    align-items: stretch;
  }
  
  /* First row: Logo, Signal, Category */
  .topbar #topbar-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
  }
  
  /* Reorder elements for mobile: Logo, Signal, Category */
  .topbar #topbar-left .signalbar {
    order: 2; /* Signal bar second */
  }
  
  .topbar #topbar-left .token-badge {
    order: 3; /* Category capsule third */
  }
  
  /* Logo section */
  .topbar #topbar-left > a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    height: 28px;
    order: 1; /* Logo first */
  }
  
  .topbar #topbar-left > a img {
    height: 28px;
    width: auto;
    flex-shrink: 0;
  }
  
  .topbar #topbar-left > a span {
    font-size: 16px;
    line-height: 1;
  }
  
  /* Hide desktop controls on mobile first row */
  .topbar #topbar-left .custom-selector,
  .topbar #topbar-left #refreshBtn {
    display: none;
  }
  
  /* Category badge and signal bar on the right */
  .topbar #topbar-left .token-badge {
    order: 1;
    font-size: 11px;
    padding: 4px 8px;
    min-width: 50px;
    height: 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .signalbar {
    order: 2;
    width: auto;
    height: 24px;
    justify-content: flex-end;
    margin: 0;
    display: flex;
    align-items: center;
  }
  
  /* Second row: Country/Region selectors and refresh button */
  .topbar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    min-width: 0;
  }
  
  .topbar-controls .custom-selector {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 13px;
    height: 36px;
    box-sizing: border-box;
  }
  
  .topbar-controls #refreshBtn {
    padding: 8px 16px;
    font-size: 13px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    height: 36px;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  
  /* Mobile refresh button - icon only */
  .topbar-controls #mobileRefreshBtn {
    padding: 8px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  
  .topbar-controls #mobileRefreshBtn:hover {
    background: #1a1a1a;
    border-color: #444;
    transform: none; /* Remove transform on mobile to prevent shaking */
  }
  
  .topbar-controls #mobileRefreshBtn .refresh-icon {
    width: 20px;
    height: 20px;
  }
  
/* Spin animation for mobile refresh icon */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Earth Scanning Animation */
.scan-ring {
  position: absolute;
  border: 2px solid rgba(0, 179, 126, 0.4);
  border-radius: 50%;
  animation: earth-scan 2s infinite;
}

.scan-ring-1 {
  width: 60px;
  height: 60px;
  top: -5px;
  left: -5px;
  animation-delay: 0s;
}

.scan-ring-2 {
  width: 80px;
  height: 80px;
  top: -15px;
  left: -15px;
  animation-delay: 0.5s;
}

.scan-ring-3 {
  width: 100px;
  height: 100px;
  top: -25px;
  left: -25px;
  animation-delay: 1s;
}

@keyframes earth-scan {
  0% {
    transform: scale(0.8) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5) rotate(360deg);
    opacity: 0;
  }
}

/* Earth Scanning Icon Hover Effects */
.earth-scanning-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 179, 126, 0.4);
}

.earth-scanning-icon:active {
  transform: scale(0.95);
}

/* Show earth scanning icons when AI is processing */
.earth-scanning-icon.processing {
  opacity: 1;
  transform: scale(1);
}

/* Hide earth scanning icons by default */
.earth-scanning-icon {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}


/* Mobile earth scanning icon positioning */
@media (max-width: 768px) {
  .earth-scanning-icon {
    display: none;
  }
  
  /* Hide desktop AI classification button on mobile */
  .ai-classification-btn {
    display: none !important;
  }
  
  
  /* Mobile AI popup - show on mobile with proper positioning */
  #aiProcessingIndicator {
    display: flex !important;
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: auto !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 0, 0, 0.95) 100%) !important;
    border: 1px solid rgba(255, 77, 77, 0.4) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 10000 !important;
    align-items: center !important;
    gap: 12px !important;
    height: 48px !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  /* Mobile AI popup elements */
  #aiProcessingIndicator .scanning-icon {
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    animation: pulse 2s infinite !important;
  }
  
  #aiProcessingIndicator .scan-ring {
    position: absolute !important;
    top: -3px !important;
    left: -3px !important;
    right: -3px !important;
    bottom: -3px !important;
    border: 1px solid transparent !important;
    border-top: 1px solid #ff4d4d !important;
    border-radius: 50% !important;
    animation: spin 1.5s linear infinite !important;
  }
  
  #aiProcessingIndicator .scanning-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  #aiProcessingIndicator .text-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
  }
  
  #aiProcessingIndicator .title {
    font-size: 12px !important;
    margin: 0 !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  #aiProcessingIndicator .processing-message {
    font-size: 10px !important;
    margin: 0 !important;
    color: #ccc !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  #aiProcessingIndicator .progress-container {
    width: 60px !important;
    height: 3px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  
  #aiProcessingIndicator .progress-bar {
    width: 0% !important;
    height: 100% !important;
    background: linear-gradient(90deg, #ff4d4d, #cc0000) !important;
    border-radius: 2px !important;
    transition: width 0.3s ease !important;
  }
}

@media (min-width: 769px) {
  .earth-scanning-icon {
    display: flex;
  }
}
  
  .topbar-controls #refreshBtn:hover {
    background: #1a1a1a;
    border-color: #444;
    transform: none; /* Remove transform on mobile to prevent shaking */
  }
  
  .topbar-controls #refreshBtn .refresh-icon {
    width: 14px;
    height: 14px;
  }
  
  /* Hide auth area on mobile (moved to bottom nav) */
  #authArea {
    display: none;
  }
  
  /* Mobile news items */
  .news-item {
    padding: 8px;
    gap: 6px;
  }
  
  .news-item img.icon {
    width: 16px;
    height: 16px;
  }
  
  .news-item a {
    font-size: 13px;
    line-height: 1.3;
  }
  
  .small {
    font-size: 11px;
  }
  
  /* Mobile marquee - hide completely to prevent red box */
  .news-marquee-container {
    display: none !important;
  }
  
  .news-marquee-container::before {
    display: none;
  }
  
  .news-marquee {
    height: 30px;
  }
  
  .marquee-text {
    font-size: 11px;
    padding: 0 12px;
  }
  
  .marquee-text::after {
    font-size: 9px;
    margin-left: 4px;
  }
  
  
  /* Mobile popups */
  .news-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    bottom: auto;
    right: auto;
  }
  
  .news-popup.show {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .news-popup-image {
    height: 120px;
  }
  
  .news-popup-news-title {
    font-size: 14px;
  }
  
  .news-popup-summary {
    font-size: 12px;
  }
  
  /* Mobile selectors */
  .selector-popup {
    width: 95vw;
    max-width: none;
  }
  
  .selector-popup-header {
    padding: 16px 20px;
  }
  
  .selector-popup-body {
    padding: 16px 20px;
  }
  
  .selector-item {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  /* Mobile auth area */
  #authArea .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  #authArea .btn .account-icon {
    width: 14px;
    height: 14px;
  }
  
  /* Mobile location icon */
  #locationIcon {
    bottom: 90px;
    width: 45px;
    height: 45px;
  }
  
  #locationIcon .location-icon {
    width: 20px;
    height: 20px;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  .layout {
    grid-template-rows: 55vh 45vh;
  }
  
  /* When map is visible, adjust grid layout */
  .layout.map-visible {
    grid-template-rows: 55vh 45vh;
  }
  
  .layout.map-hidden {
    grid-template-rows: 0 100vh;
  }
  
  .layout.map-hidden #map {
    display: none;
  }
  
  .topbar {
    padding: 6px;
  }
  
  .topbar #topbar-left {
    gap: 6px;
  }
  
  .topbar-controls .custom-selector {
    min-width: 120px;
    padding: 8px 12px;
    font-size: 13px;
    height: 36px;
    box-sizing: border-box;
  }
  
  .custom-selector .selector-arrow {
    font-size: 10px;
  }
  
  .topbar-controls #refreshBtn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 100px;
    height: 36px;
    box-sizing: border-box;
  }
  
  /* Mobile refresh button - icon only */
  .topbar-controls #mobileRefreshBtn {
    padding: 8px;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
  }
  
  .token-badge {
    font-size: 10px;
    padding: 2px 4px;
    min-width: 40px;
  }
  
  .signalbar .light {
    width: 12px;
    height: 12px;
  }
  
  /* Mobile news items */
  .news-item {
    padding: 6px;
    gap: 4px;
  }
  
  .news-item img.icon {
    width: 14px;
    height: 14px;
  }
  
  .news-item a {
    font-size: 12px;
  }
  
  .small {
    font-size: 10px;
  }
  
  /* Mobile marquee - hide completely to prevent red box */
  .news-marquee-container {
    display: none !important;
  }
  
  .news-marquee-container::before {
    display: none;
  }
  
  .news-marquee {
    height: 28px;
  }
  
  .marquee-text {
    font-size: 10px;
    padding: 0 10px;
  }
  
  .marquee-text::after {
    font-size: 8px;
    margin-left: 4px;
  }
  
  
  /* Mobile popups */
  .news-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    bottom: auto;
    right: auto;
  }
  
  .news-popup.show {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .news-popup-image {
    height: 100px;
  }
  
  .news-popup-news-title {
    font-size: 13px;
  }
  
  .news-popup-summary {
    font-size: 11px;
  }
  
  /* Mobile selectors */
  .selector-popup-header {
    padding: 12px 16px;
  }
  
  .selector-popup-body {
    padding: 12px 16px;
  }
  
  .selector-item {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  /* Mobile auth area */
  #authArea .btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  #authArea .btn .account-icon {
    width: 12px;
    height: 12px;
  }
  
  /* Mobile location icon */
  #locationIcon {
    bottom: 80px;
    width: 40px;
    height: 40px;
  }
  
  #locationIcon .location-icon {
    width: 18px;
    height: 18px;
  }
  
  /* Mobile map toggle */
  .mobile-map-toggle {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 15px;
    right: 15px;
  }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
  .layout {
    grid-template-rows: 55vh 45vh;
  }
  
  /* When map is visible, adjust grid layout */
  .layout.map-visible {
    grid-template-rows: 55vh 45vh;
  }
  
  .layout.map-hidden {
    grid-template-rows: 0 100vh;
  }
  
  .layout.map-hidden #map {
    display: none;
  }
  
  .topbar {
    padding: 4px;
  }
  
  .topbar-controls .custom-selector {
    min-width: 120px;
    padding: 8px 12px;
    font-size: 13px;
    height: 36px;
    box-sizing: border-box;
  }
  
  .topbar-controls #refreshBtn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 100px;
    height: 36px;
    box-sizing: border-box;
  }
  
  /* Mobile refresh button - icon only */
  .topbar-controls #mobileRefreshBtn {
    padding: 8px;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
  }
  
  .token-badge {
    font-size: 9px;
    padding: 1px 3px;
    min-width: 35px;
  }
  
  .signalbar .light {
    width: 10px;
    height: 10px;
  }
  
  /* Mobile news items */
  .news-item {
    padding: 4px;
    gap: 3px;
  }
  
  .news-item img.icon {
    width: 12px;
    height: 12px;
  }
  
  .news-item a {
    font-size: 11px;
  }
  
  .small {
    font-size: 9px;
  }
  
  /* Mobile marquee - hide completely to prevent red box */
  .news-marquee-container {
    display: none !important;
  }
  
  .news-marquee-container::before {
    display: none;
  }
  
  .news-marquee {
    height: 26px;
  }
  
  .marquee-text {
    font-size: 9px;
    padding: 0 8px;
  }
  
  .marquee-text::after {
    font-size: 7px;
    margin-left: 3px;
  }
  
  
  /* Mobile popups */
  .news-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    bottom: auto;
    right: auto;
  }
  
  .news-popup.show {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .news-popup-image {
    height: 80px;
  }
  
  .news-popup-news-title {
    font-size: 12px;
  }
  
  .news-popup-summary {
    font-size: 10px;
  }
  
  /* Mobile selectors */
  .selector-popup-header {
    padding: 10px 12px;
  }
  
  .selector-popup-body {
    padding: 10px 12px;
  }
  
  .selector-item {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  /* Mobile auth area */
  #authArea .btn {
    padding: 5px 8px;
    font-size: 10px;
  }
  
  #authArea .btn .account-icon {
    width: 10px;
    height: 10px;
  }
  
  /* Mobile location icon */
  #locationIcon {
    bottom: 70px;
    width: 35px;
    height: 35px;
  }
  
  #locationIcon .location-icon {
    width: 16px;
    height: 16px;
  }
  
  /* Mobile map toggle */
  .mobile-map-toggle {
    width: 45px;
    height: 45px;
    font-size: 18px;
    bottom: 10px;
    right: 10px;
  }
}

/* === ACCOUNT PAGE MOBILE RESPONSIVENESS === */
@media (max-width: 768px) {
  /* Account page main container */
  main {
    max-width: 100% !important;
    margin: 20px auto !important;
    padding: 16px !important;
  }
  
  /* Account page header */
  main h1 {
    font-size: 24px !important;
    margin-bottom: 6px !important;
  }
  
  main p {
    font-size: 14px !important;
  }
  
  /* Account card */
  .card {
    padding: 20px !important;
    margin-bottom: 24px !important;
  }
  
  /* User profile section */
  .card > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    padding-bottom: 16px !important;
  }
  
  .card > div:first-child > div:first-child {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }
  
  .card > div:first-child h2 {
    font-size: 18px !important;
  }
  
  .card > div:first-child p {
    font-size: 13px !important;
  }
  
  .card > div:first-child button {
    padding: 6px 12px !important;
    font-size: 13px !important;
  }
  
  /* Account info grid */
  .card > div:last-child {
    gap: 16px !important;
  }
  
  .card > div:last-child > div {
    grid-template-columns: 120px 1fr !important;
    gap: 12px !important;
    padding: 10px 0 !important;
  }
  
  .card > div:last-child > div > div:first-child {
    font-size: 12px !important;
  }
  
  .card > div:last-child > div > div:last-child {
    font-size: 14px !important;
  }
  
  /* Edit modal */
  #editModal > div {
    width: 95vw !important;
    max-width: none !important;
    padding: 24px !important;
  }
  
  #editModal h2 {
    font-size: 20px !important;
  }
  
  #editModal form {
    gap: 16px !important;
  }
  
  #editModal input {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }
  
  #editModal button {
    padding: 10px 20px !important;
    font-size: 14px !important;
  }
  
  /* Saved news section */
  .saved-news {
    padding: 20px !important;
  }
  
  .saved-news h2 {
    font-size: 18px !important;
  }
  
  .saved-news p {
    font-size: 13px !important;
  }
  
  /* Saved news items */
  .saved-news-item {
    padding: 12px !important;
    gap: 12px !important;
  }
  
  .saved-news-item .news-image,
  .saved-news-item .news-placeholder {
    width: 60px !important;
    height: 60px !important;
  }
  
  .saved-news-item .news-title {
    font-size: 14px !important;
    line-clamp: 2;
  }
  
  .saved-news-item .news-meta {
    font-size: 11px !important;
    gap: 8px !important;
  }
  
  .saved-news-item .btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    min-width: 80px !important;
  }
  
  .saved-news-item .btn-icon {
    width: 14px !important;
    height: 14px !important;
  }
}

@media (max-width: 480px) {
  /* Account page main container */
  main {
    margin: 16px auto !important;
    padding: 12px !important;
  }
  
  /* Account page header */
  main h1 {
    font-size: 20px !important;
  }
  
  main p {
    font-size: 13px !important;
  }
  
  /* Account card */
  .card {
    padding: 16px !important;
    margin-bottom: 20px !important;
  }
  
  /* User profile section */
  .card > div:first-child > div:first-child {
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
  }
  
  .card > div:first-child h2 {
    font-size: 16px !important;
  }
  
  .card > div:first-child p {
    font-size: 12px !important;
  }
  
  .card > div:first-child button {
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
  
  /* Account info grid */
  .card > div:last-child {
    gap: 12px !important;
  }
  
  .card > div:last-child > div {
    grid-template-columns: 100px 1fr !important;
    gap: 8px !important;
    padding: 8px 0 !important;
  }
  
  .card > div:last-child > div > div:first-child {
    font-size: 11px !important;
  }
  
  .card > div:last-child > div > div:last-child {
    font-size: 13px !important;
  }
  
  /* Edit modal */
  #editModal > div {
    padding: 20px !important;
  }
  
  #editModal h2 {
    font-size: 18px !important;
  }
  
  #editModal form {
    gap: 12px !important;
  }
  
  #editModal input {
    padding: 8px 10px !important;
    font-size: 13px !important;
  }
  
  #editModal button {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
  
  /* Saved news section */
  .saved-news {
    padding: 16px !important;
  }
  
  .saved-news h2 {
    font-size: 16px !important;
  }
  
  .saved-news p {
    font-size: 12px !important;
  }
  
  /* Saved news items */
  .saved-news-item {
    padding: 10px !important;
    gap: 10px !important;
  }
  
  .saved-news-item .news-image,
  .saved-news-item .news-placeholder {
    width: 50px !important;
    height: 50px !important;
  }
  
  .saved-news-item .news-title {
    font-size: 13px !important;
  }
  
  .saved-news-item .news-meta {
    font-size: 10px !important;
    gap: 6px !important;
  }
  
  .saved-news-item .btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    min-width: 70px !important;
  }
  
  .saved-news-item .btn-icon {
    width: 12px !important;
    height: 12px !important;
  }
}

/* === ADMIN PAGES MOBILE RESPONSIVENESS === */
@media (max-width: 768px) {
  /* Admin topbar */
  .topbar {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 8px !important;
  }
  
  .topbar #adminTabs {
    order: -1 !important;
    width: 100% !important;
    justify-content: center !important;
    margin: 8px 0 !important;
  }
  
  .topbar #adminTabs a {
    padding: 6px 12px !important;
    font-size: 13px !important;
  }
  
  .topbar input[type="text"] {
    width: 200px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
  }
  
  .topbar button.primary {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
  
  .topbar .token-badge {
    font-size: 11px !important;
    padding: 2px 6px !important;
  }
  
  /* Admin layout */
  #adminLayout {
    flex-direction: column !important;
    gap: 16px !important;
    padding: 12px !important;
  }
  
  #adminLayout > div:first-child {
    flex: none !important;
    width: 100% !important;
  }
  
  #adminLayout > div:last-child {
    flex: none !important;
    width: 100% !important;
  }
  
  /* Admin form */
  #regionForm {
    gap: 12px !important;
  }
  
  #regionForm input {
    padding: 8px !important;
    font-size: 14px !important;
  }
  
  #regionForm label {
    font-size: 11px !important;
  }
  
  #regionForm .action-buttons-row {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  #regionForm .action-buttons-row button {
    width: 100% !important;
    min-width: unset !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
  }
  
  /* Admin regions list */
  #regionsList {
    overflow-x: auto !important;
  }
  
  .regions-overview-content {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .region-status-item {
    justify-content: space-between !important;
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
  
  /* Admin users page */
  main {
    max-width: 100% !important;
    margin: 16px auto !important;
    padding: 12px !important;
  }
  
  main h1 {
    font-size: 24px !important;
  }
  
  main p {
    font-size: 14px !important;
  }
  
  /* Users table */
  #usersWrap {
    overflow-x: auto !important;
  }
  
  table {
    min-width: 600px !important;
  }
  
  table th,
  table td {
    padding: 12px 8px !important;
    font-size: 12px !important;
  }
  
  /* User search */
  #userSearch {
    width: 200px !important;
    padding: 6px 8px 6px 30px !important;
    font-size: 13px !important;
  }
  
  #searchIcon {
    left: 8px !important;
  }
  
  /* Modals */
  #modal > div,
  #visibilityModal > div {
    width: 95vw !important;
    max-width: none !important;
    padding: 20px !important;
  }
  
  #modal h3,
  #visibilityModal h3 {
    font-size: 16px !important;
  }
  
  #modal form,
  #visibilityModal form {
    gap: 12px !important;
  }
  
  #modal input,
  #modal select,
  #visibilityModal input,
  #visibilityModal select {
    padding: 8px 10px !important;
    font-size: 13px !important;
  }
  
  #modal button,
  #visibilityModal button {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
  
  /* Visibility modal grid */
  #visibilityModal > div > div:nth-child(3) {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  
  #chatHeader {
    padding: 12px 16px !important;
  }
  
  #chatName {
    font-size: 14px !important;
  }
  
  #chatStatus {
    font-size: 11px !important;
  }
  
  #messagesList {
    padding: 12px !important;
  }
  
  #messageInput {
    padding: 12px 16px !important;
  }
  
  #messageText {
    font-size: 13px !important;
  }
  
  #sendMessageBtn {
    width: 35px !important;
    height: 35px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  /* Admin topbar */
  .topbar {
    padding: 6px !important;
  }
  
  .topbar input[type="text"] {
    width: 150px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
  }
  
  .topbar button.primary {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }
  
  .topbar .token-badge {
    font-size: 10px !important;
    padding: 1px 4px !important;
  }
  
  /* Admin layout */
  #adminLayout {
    padding: 8px !important;
    gap: 12px !important;
  }
  
  /* Admin form */
  #regionForm {
    gap: 8px !important;
  }
  
  #regionForm input {
    padding: 6px !important;
    font-size: 13px !important;
  }
  
  #regionForm label {
    font-size: 10px !important;
  }
  
  #regionForm .action-buttons-row button {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
  
  /* Admin regions list */
  .region-status-item {
    padding: 6px 8px !important;
    font-size: 10px !important;
  }
  
  /* Admin users page */
  main {
    margin: 12px auto !important;
    padding: 8px !important;
  }
  
  main h1 {
    font-size: 20px !important;
  }
  
  main p {
    font-size: 13px !important;
  }
  
  /* Users table */
  table {
    min-width: 500px !important;
  }
  
  table th,
  table td {
    padding: 8px 6px !important;
    font-size: 11px !important;
  }
  
  /* User search */
  #userSearch {
    width: 150px !important;
    padding: 4px 6px 4px 25px !important;
    font-size: 12px !important;
  }
  
  #searchIcon {
    left: 6px !important;
  }
  
  /* Modals */
  #modal > div,
  #visibilityModal > div {
    padding: 16px !important;
  }
  
  #modal h3,
  #visibilityModal h3 {
    font-size: 14px !important;
  }
  
  #modal form,
  #visibilityModal form {
    gap: 8px !important;
  }
  
  #modal input,
  #modal select,
  #visibilityModal input,
  #visibilityModal select {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
  
  #modal button,
  #visibilityModal button {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  
  /* Messaging modal */
  #messagingModal > div {
    height: 75vh !important;
  }
  
  #chatHeader {
    padding: 10px 12px !important;
  }
  
  #chatName {
    font-size: 13px !important;
  }
  
  #chatStatus {
    font-size: 10px !important;
  }
  
  #messagesList {
    padding: 8px !important;
  }
  
  #messageInput {
    padding: 8px 12px !important;
  }
  
  #messageText {
    font-size: 12px !important;
  }
  
  #sendMessageBtn {
    width: 30px !important;
    height: 30px !important;
    font-size: 12px !important;
  }
}

/* Additional bottom navigation enhancements */
.mobile-bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.1) 20%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.1) 80%, 
    transparent 100%);
}

/* Enhanced button press animation */
.mobile-nav-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

/* Ripple effect on button press */
.mobile-nav-btn {
  position: relative;
  overflow: hidden;
}

.mobile-nav-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.mobile-nav-btn:active::after {
  width: 300px;
  height: 300px;
}

/* Improved focus states for accessibility */
.mobile-nav-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.3);
}

.mobile-nav-btn:focus:not(:active) {
  transform: translateY(-2px) scale(1.02);
}

/* Smooth transitions for all interactive elements */
.mobile-nav-btn * {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Loading animation for location sharing */
.location-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.location-loading-content {
  background: linear-gradient(135deg, rgba(11, 11, 11, 0.95) 0%, rgba(20, 20, 20, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.location-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 179, 126, 0.3);
  border-top: 3px solid #00b37e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.location-loading-text {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.location-loading-subtext {
  color: #888;
  font-size: 14px;
  margin: 8px 0 0 0;
}

/* Location sent icon */
.location-sent-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkmarkBounce 0.6s ease-in-out;
}

@keyframes checkmarkBounce {
  0% { 
    transform: scale(0);
    opacity: 0;
  }
  50% { 
    transform: scale(1.2);
    opacity: 1;
  }
  100% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* Location sent animation */
.location-sent {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20001;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease-in-out;
}

.location-sent-content {
  background: linear-gradient(135deg, rgba(0, 179, 126, 0.95) 0%, rgba(0, 150, 100, 0.9) 100%);
  border: 1px solid rgba(0, 179, 126, 0.3);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 179, 126, 0.3);
  animation: slideIn 0.4s ease-out;
}

.location-sent-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  font-weight: bold;
  margin: 0 auto 16px;
  animation: checkmark 0.6s ease-in-out;
}

.location-sent-text {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.location-sent-subtext {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin: 8px 0 0 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
  }
  to { 
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes checkmark {
  0% { 
    transform: scale(0);
    opacity: 0;
  }
  50% { 
    transform: scale(1.2);
    opacity: 1;
  }
  100% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile responsiveness for selectors */
@media (max-width: 768px) {
  .custom-selector {
    min-width: 120px;
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .selector-popup {
    width: 95vw;
  }
  
  .selector-popup-header {
    padding: 16px 20px;
  }
  
  .selector-popup-body {
    padding: 16px 20px;
  }
  
  .selector-item {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  #authArea .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  #authArea .btn .account-icon {
    width: 14px;
    height: 14px;
  }
  
  /* Mobile news detail buttons */
  .news-detail .news-detail-actions {
    flex-direction: column;
    gap: 6px;
  }
  
  .news-detail .news-detail-actions .btn {
    width: 100%;
    flex: none;
    padding: 12px 16px;
    font-size: 13px;
  }
  
  /* Mobile refresh button */
  #refreshBtn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .refresh-tooltip {
    font-size: 12px;
    padding: 10px 12px;
    max-width: 250px;
  }
}

/* === Severity signal bar (3 lights) === */
.signalbar {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-left: auto !important;   /* 🔑 pushes it to the far right */
}


.signalbar .light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0.60;                /* dim when off */
  box-shadow: 0 0 0 2px var(--border, #f7faff) inset;
  transition: opacity 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.signalbar .light.red    { background: #2faf0000; }
.signalbar .light.yellow { background: #faad1400; }
.signalbar .light.green  { background: #53c41a00; }

.signalbar .light.on {
  opacity: 1;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,.01) inset,
    0 0 0px currentColor;
  transform: translateY(-0.5px);
}
/* --- Shared UI primitives --- */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:.5rem; padding:.6rem .9rem; border-radius:10px;
  border:1px solid #333; background:#0b0b0b; color:#ddd;
  text-decoration:none; cursor:pointer; transition:transform .05s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color:#444; background:#111; }
.btn:active { transform: translateY(0); }

.btn-white {
  background:#fff; color:#111; border-color:#fff;
}
.btn-white:hover { background:#f5f5f5; border-color:#f5f5f5; }

.btn-ghost {
  background:transparent; color:#ddd; border-color:#333;
}
.input {
  width:100%; padding:.65rem .75rem; border:1px solid #333; border-radius:10px;
  background:#0f0f0f; color:#ddd; outline:none;
}
.input:focus { border-color:#555; }
.input::placeholder { color:#888; }
.badge-ok { color:#00c27a; }
.badge-err { color:#e66; }
/* --- Toast (top center) --- */
#toastRoot {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  min-width: 260px;
  max-width: 86vw;
  margin: 0 auto;
  background: #0b0b0b;
  border: 1px solid #333;
  color: #ddd;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0,0,0,.45);
  font-size: 14px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 140ms ease, transform 140ms ease, border-color 140ms ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.toast.info  { border-color: #3ea6ff; }
.toast.info  .dot { background:#3ea6ff; }
.toast.success { border-color: #00b37e; }
.toast.success .dot { background:#00b37e; }
.toast.error { border-color: #e10600; }
.toast.error .dot { background:#e10600; }

.saved-news {
  margin: 20px 0;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 12px;
  background: #0b0b0b;
}
.saved-news h2 { font-size: 18px; margin: 6px 0 14px; color: #ddd; }

/* Read Later List - Single Row Layout */
.saved-news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-news-item {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.saved-news-item:hover {
  background: #151515;
  border-color: #444;
  transform: none; /* Remove transform to prevent shaking on mobile */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Countdown Timer */
.countdown-timer {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.countdown-timer.expired {
  background: linear-gradient(135deg, #e10600, #ff4444);
  animation: pulse 2s infinite;
}

/* News Image */
.saved-news-item .news-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #333;
  flex-shrink: 0;
}

.saved-news-item .news-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 24px;
  flex-shrink: 0;
}

/* News Content */
.saved-news-item .news-content {
  flex: 1;
  min-width: 0;
}

.saved-news-item .news-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-news-item .news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.saved-news-item .news-source {
  color: #4d79ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.saved-news-item .news-source:hover {
  color: #6b8cff;
  text-decoration: underline;
}

.saved-news-item .news-date {
  color: #888;
}

/* Action Buttons */
.saved-news-item .news-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.saved-news-item .btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-width: 100px;
  justify-content: center;
}

.saved-news-item .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.saved-news-item .btn:hover::before {
  left: 100%;
}

.saved-news-item .btn-read {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.saved-news-item .btn-read:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.saved-news-item .btn-remove {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.saved-news-item .btn-remove:hover {
  background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

/* Modern Icons */
.saved-news-item .btn-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saved-news-item .news-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  flex-shrink: 0;
}

.saved-news-item .news-placeholder svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .saved-news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .saved-news-item .news-image,
  .saved-news-item .news-placeholder {
    width: 100%;
    height: 120px;
  }
  
  .saved-news-item .news-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .saved-news-item .btn {
    flex: 1;
    justify-content: center;
  }
}

/* mobile tweaks */
@media (max-width: 480px) {
  .saved-grid { grid-template-columns: 1fr; }
  .saved-grid .news-card img.hero,
  .saved-grid .news-card .ph { height: 140px; }
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* === User Visibility Restrictions === */
.restricted-overlay {
  position: relative;
}

.restricted-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.restricted-overlay::before {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  z-index: 11;
  pointer-events: none;
  color: #ff4d4d;
  text-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
}

.restricted-option {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.restricted-option::after {
  content: '🔒';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #ff4d4d;
}

.lock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ff4d4d;
  font-size: 12px;
  margin-left: 8px;
}

.visibility-warning {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  color: #ff9999;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visibility-warning::before {
  content: '⚠️';
  font-size: 16px;
}

/* === Notification Animations === */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOutToRight {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.notification-enter {
  animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-exit {
  animation: slideOutToRight 0.3s ease-in;
}

.notification-pulse {
  animation: pulse 2s infinite;
}

.notification-bounce {
  animation: bounce 1s;
}

/* === Request Status Styles === */
.request-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.request-status.pending {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid #ffc107;
  color: #ffc107;
}

.request-status.cooldown {
  background: rgba(108, 117, 125, 0.1);
  border: 1px solid #6c757d;
  color: #6c757d;
}

.request-status.eligible {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid #28a745;
  color: #28a745;
}

/* === Refresh Button Animation === */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes refreshPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(255, 77, 77, 0);
  }
}

@keyframes dotBounce {
  0%, 80%, 100% { 
    transform: scale(0);
    opacity: 0.5;
  }
  40% { 
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes tooltipSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes tooltipPulse {
  0%, 100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(0) scale(1.02);
  }
}

.refresh-loading {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #666;
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

.refresh-pulsing {
  animation: refreshPulse 2s infinite;
}

.refresh-success {
  background: #00b37e !important;
  border-color: #00b37e !important;
  animation: bounce 0.6s ease-in-out;
}

.refresh-error {
  background: #e10600 !important;
  border-color: #e10600 !important;
  animation: bounce 0.6s ease-in-out;
}

/* === Refresh Tooltip === */
.refresh-tooltip {
  position: fixed;
  z-index: 10000;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.refresh-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: tooltipSlideIn 0.4s ease-out;
}

.refresh-tooltip.hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.5s ease-in;
}

.refresh-tooltip.updating {
  animation: tooltipPulse 0.3s ease-in-out;
}

.refresh-tooltip-content {
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 300px;
}

.refresh-tooltip-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.refresh-tooltip-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.refresh-tooltip-message {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.refresh-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.refresh-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffa500, #ff6b35);
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
}

.refresh-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.refresh-tooltip-dots {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.refresh-tooltip-dots span {
  width: 6px;
  height: 6px;
  background: #666;
  border-radius: 50%;
  animation: dotBounce 1.4s infinite ease-in-out both;
}

.refresh-tooltip-dots span:nth-child(1) { animation-delay: -0.32s; }
.refresh-tooltip-dots span:nth-child(2) { animation-delay: -0.16s; }
.refresh-tooltip-dots span:nth-child(3) { animation-delay: 0s; }

/* Tooltip type variations */
.refresh-tooltip-loading .refresh-tooltip-dots span {
  background: #ffa500;
}

.refresh-tooltip-success .refresh-tooltip-dots {
  display: none;
}

.refresh-tooltip-success .refresh-tooltip-content {
  background: rgba(0, 179, 126, 0.1);
  border-color: #00b37e;
}

.refresh-tooltip-error .refresh-tooltip-dots {
  display: none;
}

.refresh-tooltip-error .refresh-tooltip-content {
  background: rgba(225, 6, 0, 0.1);
  border-color: #e10600;
}

/* RSS Validation Styles */
.validation-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
}

.validation-indicator:hover {
  background: #222;
  border-color: #444;
}

.validate-btn {
  background: transparent;
  border: none;
  color: #888;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.validate-btn:hover {
  color: #fff;
}

.loading-spinner {
  color: #ffa500;
  font-size: 14px;
  animation: spin 1s linear infinite;
}

.valid-indicator {
  color: #00b37e;
  font-size: 14px;
  font-weight: bold;
}

.invalid-indicator {
  color: #e10600;
  font-size: 14px;
  font-weight: bold;
}

/* Feed row validation states */
[data-validation-state="validating"] {
  opacity: 0.8;
}

[data-validation-state="invalid"] .feed-url {
  border-color: #e10600;
  background-color: rgba(225, 6, 0, 0.05);
}

[data-validation-state="valid"] .feed-url {
  border-color: #00b37e;
  background-color: rgba(0, 179, 126, 0.05);
}

/* Location Icon Styles */
#locationIcon {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #333, #555);
  border: 2px solid #666;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#locationIcon:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #444, #666);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

#locationIcon .location-icon {
  width: 24px;
  height: 24px;
  color: #fff;
  fill: currentColor;
  transition: all 0.2s ease;
}

#locationIcon:hover .location-icon {
  transform: scale(1.1);
}

#locationIcon:disabled {
  cursor: not-allowed !important;
  opacity: 0.5 !important;
  pointer-events: none;
}

#locationIcon:disabled:hover {
  transform: none !important;
  background: linear-gradient(135deg, #333, #555) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* Mapbox Marker Styles */
.mapbox-marker {
  transition: all 0.2s ease;
}

.mapbox-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4) !important;
}

/* Mapbox Map Container */
#map {
  width: 100%;
  height: 100%;
}

/* Region Highlight Styles - Large overlays covering region areas */
.region-highlight {
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  animation: regionPulse 3s infinite;
  border: 3px solid;
}

@keyframes regionPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0.5;
  }
}

/* Region highlight color variations with stronger visibility */
.region-highlight.red {
  background: #fa0004;
  border-color: #fa0004;
  box-shadow: 0 0 60px rgba(250, 0, 4, 0.7);
  animation: redPulse 2s infinite;
}

.region-highlight.yellow {
  background: #ffee02;
  border-color: #ffee02;
  box-shadow: 0 0 50px rgba(255, 238, 2, 0.7);
  animation: yellowPulse 2.5s infinite;
}

.region-highlight.green {
  background: #2faf00;
  border-color: #2faf00;
  box-shadow: 0 0 40px rgba(47, 175, 0, 0.7);
  animation: greenPulse 3s infinite;
}

/* Different pulse animations for each severity level */
@keyframes redPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
    box-shadow: 0 0 60px rgba(250, 0, 4, 0.7);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.6;
    box-shadow: 0 0 80px rgba(250, 0, 4, 0.9);
  }
}

@keyframes yellowPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.25;
    box-shadow: 0 0 50px rgba(255, 238, 2, 0.7);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0.45;
    box-shadow: 0 0 70px rgba(255, 238, 2, 0.9);
  }
}

@keyframes greenPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.2;
    box-shadow: 0 0 40px rgba(47, 175, 0, 0.7);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.03);
    opacity: 0.4;
    box-shadow: 0 0 60px rgba(47, 175, 0, 0.9);
  }
}

/* Make highlights more visible on different zoom levels */
@media (max-width: 768px) {
  .region-highlight.red {
    width: 200px !important;
    height: 200px !important;
  }
  .region-highlight.yellow {
    width: 180px !important;
    height: 180px !important;
  }
  .region-highlight.green {
    width: 160px !important;
    height: 160px !important;
  }
}

/* Mapbox Controls */
.mapboxgl-ctrl-group {
  background: rgba(0, 0, 0, 0.8) !important;
  border: 1px solid #333 !important;
  border-radius: 8px !important;
}

.mapboxgl-ctrl-group button {
  background: transparent !important;
  color: #fff !important;
  border: none !important;
}

.mapboxgl-ctrl-group button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* RSS Validation Summary */
.rss-validation-summary {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: none;
}

.rss-validation-summary.show {
  display: block;
}

.validation-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.stat-valid {
  color: #00b37e;
}

.stat-invalid {
  color: #e10600;
}

.stat-total {
  color: #888;
}

.invalid-links-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #333;
}

.invalid-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: #e10600;
}

.invalid-link-item a {
  color: #e10600;
  text-decoration: none;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invalid-link-item a:hover {
  text-decoration: underline;
}

/* News Popup Styles (Bottom Left) */
.news-popup {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: 80vh;
  background: #0b0b0b;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.news-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.news-popup-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
  background: #111;
}

.news-popup-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.news-popup-close {
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-popup-close:hover {
  background: #333;
  color: #fff;
}

.news-popup-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  max-height: 70vh;
  scrollbar-width: thin;
  scrollbar-color: #444 #1a1a1a;
}

.news-popup-body::-webkit-scrollbar {
  width: 8px;
}

.news-popup-body::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 4px;
}

.news-popup-body::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.news-popup-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.news-popup-image-container {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.news-popup-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.news-popup-text {
  color: #ddd;
}

.news-popup-news-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.news-popup-summary {
  font-size: 14px;
  line-height: 1.5;
  color: #ccc;
  margin: 0 0 16px 0;
  white-space: pre-wrap;
}

.news-popup-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #888;
}

.news-popup-source {
  font-weight: 500;
  color: #ff4d4d;
}

.news-popup-date {
  color: #666;
}

.news-popup-actions {
  display: flex;
  gap: 8px;
}

.news-popup-read-more {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #ff4d4d;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.news-popup-read-more:hover {
  background: #ff6b6b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

/* Mobile responsiveness for news popup */
@media (max-width: 768px) {
  .news-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    bottom: auto;
    right: auto;
    z-index: 10000;
  }
  
  .news-popup.show {
    transform: translate(-50%, -50%) scale(1);
  }
  
  /* Add backdrop overlay for mobile popups */
  .news-popup::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .news-popup.show::before {
    opacity: 1;
  }
  
  .news-popup-image {
    height: 150px;
  }
  
  .news-popup-news-title {
    font-size: 16px;
  }
  
  .news-popup-summary {
    font-size: 13px;
  }
}

/* Custom Selector Styles */
.custom-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  font-size: 14px;
  position: relative;
}

.custom-selector:hover {
  background: #1a1a1a;
  border-color: #444;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.custom-selector:active {
  transform: translateY(0);
}

.custom-selector .selector-arrow {
  margin-left: 8px;
  font-size: 12px;
  color: #888;
  transition: transform 0.2s ease;
}

.custom-selector:hover .selector-arrow {
  color: #fff;
}

.custom-selector.active .selector-arrow {
  transform: rotate(180deg);
}

/* Selector Popup Styles */
.selector-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  background: #0b0b0b;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  z-index: 1001;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.selector-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.selector-popup-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.selector-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #222;
  background: #111;
}

.selector-popup-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.selector-popup-close {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selector-popup-close:hover {
  background: #333;
  color: #fff;
}

.selector-popup-body {
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
  scrollbar-width: thin;
  scrollbar-color: #444 #1a1a1a;
}

.selector-popup-body::-webkit-scrollbar {
  width: 8px;
}

.selector-popup-body::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 4px;
}

.selector-popup-body::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.selector-popup-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.selector-search {
  margin-bottom: 16px;
}

.selector-search-input {
  width: 100%;
  padding: 12px 16px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.selector-search-input:focus {
  border-color: #ff4d4d;
  box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.2);
}

.selector-search-input::placeholder {
  color: #666;
}

.selector-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
}

.selector-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ddd;
  font-size: 14px;
  overflow-x: hidden;
  white-space: nowrap;
}

.selector-item:hover {
  background: #1a1a1a;
  border-color: #333;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.selector-item.selected {
  background: #ff4d4d;
  border-color: #ff4d4d;
  color: #fff;
}

.selector-item.selected:hover {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

.selector-item-name {
  flex: 1;
  font-weight: 500;
}

.selector-item-count {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}

.selector-item.selected .selector-item-count {
  color: rgba(255, 255, 255, 0.8);
}

.selector-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #ccc;
  font-size: 14px;
  text-align: center;
}

.message-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.message-text {
  flex: 1;
  line-height: 1.4;
}

/* Professional Account Button */
#authArea .btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

#authArea .btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

#authArea .btn:hover {
  background: #1a1a1a;
  border-color: #444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#authArea .btn:hover::before {
  left: 100%;
}

#authArea .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#authArea .btn .account-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

#authArea .btn:hover .account-icon {
  transform: scale(1.1);
}

/* Account button focus state for accessibility */
#authArea .btn:focus {
  outline: 2px solid #ff4d4d;
  outline-offset: 2px;
}

/* Account button loading state */
#authArea .btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

#authArea .btn.loading .account-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* News Detail Button Layout */
.news-detail .news-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}

.news-detail .news-detail-actions .btn {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.news-detail .news-detail-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.news-detail .news-detail-actions .btn:active {
  transform: translateY(0);
}

/* Enhanced Refresh Button with Built-in Loader */
#refreshBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  color: #ddd;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  min-width: 120px;
  justify-content: center;
}

#refreshBtn:hover {
  background: #1a1a1a;
  border-color: #444;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#refreshBtn:active {
  transform: translateY(0);
}

#refreshBtn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

/* Refresh Button Loader */
#refreshBtn .refresh-loader {
  width: 16px;
  height: 16px;
  border: 2px solid #333;
  border-top: 2px solid #ff4d4d;
  border-radius: 50%;
  animation: refreshButtonSpin 1s linear infinite;
  display: none;
}

#refreshBtn.refresh-pulsing .refresh-loader {
  display: block;
}

#refreshBtn.refresh-pulsing .refresh-icon {
  display: none;
}

/* Progress Line at Bottom */
#refreshBtn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #ff4d4d;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 0 0 6px 6px;
}

#refreshBtn.refresh-pulsing::after {
  width: 100%;
  animation: refreshProgress 5s linear forwards;
}

/* Success/Error States */
#refreshBtn.refresh-success::after {
  background: #00b37e;
  width: 100%;
}

#refreshBtn.refresh-error::after {
  background: #e10600;
  width: 100%;
}

@keyframes refreshButtonSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes refreshProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* Success message animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Admin RSS Validation Styles */
.rss-alert {
  animation: slideInFromTop 0.3s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Action Buttons Row */
.action-buttons-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.action-buttons-row button {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-buttons-row .primary {
  background: linear-gradient(135deg, #ff4d4d, #ff6b6b);
  border: none;
  color: #fff;
}

.action-buttons-row .primary:hover {
  background: linear-gradient(135deg, #e63e3e, #ff5555);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.action-buttons-row .btn-validate {
  background: linear-gradient(135deg, #4d79ff, #6b8cff);
  border: 1px solid #4d79ff;
  color: #fff;
}

.action-buttons-row .btn-validate:hover {
  background: linear-gradient(135deg, #3d69ef, #5b79ef);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(77, 121, 255, 0.3);
}

.action-buttons-row .btn {
  background: #333;
  border: 1px solid #555;
  color: #fff;
}

.action-buttons-row .btn:hover {
  background: #444;
  border-color: #666;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* RSS Validation Summary */
.rss-validation-summary {
  margin: 12px 0;
  padding: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 14px;
}

.validation-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}

.stat-total {
  color: #888;
}

.stat-valid {
  color: #00b37e;
}

.stat-invalid {
  color: #e10600;
}

.invalid-links-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #333;
}

.invalid-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
}

.invalid-link-item a {
  color: #e10600;
  text-decoration: none;
  word-break: break-all;
}

.invalid-link-item a:hover {
  text-decoration: underline;
}

/* RSS Feed Row Validation States */
.feed-row {
  transition: all 0.2s ease;
}

.feed-row[data-validation-state="invalid"] {
  border-left: 3px solid #e10600;
  background: rgba(225, 6, 0, 0.05);
}

.feed-row[data-validation-state="valid"] {
  border-left: 3px solid #00b37e;
  background: rgba(0, 179, 126, 0.05);
}

.feed-row[data-validation-state="validating"] {
  border-left: 3px solid #ff6b35;
  background: rgba(255, 107, 53, 0.05);
}

/* Validation Indicators */
.validate-btn {
  background: #333;
  border: 1px solid #555;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.validate-btn:hover {
  background: #444;
  border-color: #666;
}

.valid-indicator {
  color: #00b37e;
  font-weight: bold;
  font-size: 14px;
}

.invalid-indicator {
  color: #e10600;
  font-weight: bold;
  font-size: 14px;
}

.loading-spinner {
  color: #ff6b35;
  animation: spin 1s linear infinite;
  font-size: 14px;
}

/* Mobile Responsiveness for Action Buttons */
@media (max-width: 768px) {
  .action-buttons-row {
    flex-direction: column;
  }
  
  .action-buttons-row button {
    width: 100%;
    min-width: unset;
  }
}

/* Regions Overview Styles */
.regions-overview {
  animation: slideInFromTop 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.regions-overview-content {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.region-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.region-status-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.region-status-item.valid {
  background: rgba(0, 179, 126, 0.1);
  border-color: rgba(0, 179, 126, 0.3);
  color: #00b37e;
}

.region-status-item.invalid {
  background: rgba(225, 6, 0, 0.1);
  border-color: rgba(225, 6, 0, 0.3);
  color: #e10600;
}

.region-status-item.unknown {
  background: rgba(255, 107, 53, 0.1);
  border-color: rgba(255, 107, 53, 0.3);
  color: #ff6b35;
}

.region-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.region-status-indicator.valid {
  background: #00b37e;
  box-shadow: 0 0 4px rgba(0, 179, 126, 0.5);
}

.region-status-indicator.invalid {
  background: #e10600;
  box-shadow: 0 0 4px rgba(225, 6, 0, 0.5);
}

.region-status-indicator.unknown {
  background: #666;
  box-shadow: 0 0 4px rgba(102, 102, 102, 0.5);
}

.region-status-indicator.partial {
  background: #ff6b35;
  box-shadow: 0 0 4px rgba(255, 107, 53, 0.5);
}

.region-status-indicator.no-feeds {
  background: #888;
  box-shadow: 0 0 4px rgba(136, 136, 136, 0.5);
}

.region-status-indicator.error {
  background: #ff4444;
  box-shadow: 0 0 4px rgba(255, 68, 68, 0.5);
}

.region-name {
  font-weight: 600;
  white-space: nowrap;
}

.region-stats {
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: #444;
  border-color: #666;
  transform: translateY(-1px);
}

/* Regions Refresh Button with Loader */
.regions-refresh-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.regions-refresh-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff6b35, #00b37e);
  width: 0%;
  transition: width 0.3s ease;
}

.regions-refresh-btn.loading::after {
  width: 100%;
  animation: regionsProgressLine 3s ease-in-out;
}

.regions-refresh-content {
  display: flex;
  align-items: center;
  gap: 4px;
}

.regions-refresh-loader {
  display: flex;
  align-items: center;
  gap: 4px;
}

.regions-refresh-loader.hidden {
  display: none;
}

.regions-refresh-content.hidden {
  display: none;
}

.regions-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid #555;
  border-top: 2px solid #ff6b35;
  border-radius: 50%;
  animation: regionsSpin 1s linear infinite;
}

.regions-refresh-icon {
  transition: transform 0.3s ease;
}

.regions-refresh-btn.loading .regions-refresh-icon {
  animation: regionsSpin 1s linear infinite;
}

.regions-refresh-btn.loading {
  background: #1a1a1a;
  border-color: #ff6b35;
  cursor: not-allowed;
}

.regions-refresh-btn.success {
  background: #0a2a0a;
  border-color: #00b37e;
}

.regions-refresh-btn.error {
  background: #2a0a0a;
  border-color: #e10600;
}

@keyframes regionsSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes regionsProgressLine {
  0% { width: 0%; }
  25% { width: 25%; }
  50% { width: 50%; }
  75% { width: 75%; }
  100% { width: 100%; }
}

/* Mobile responsiveness for regions overview */
@media (max-width: 768px) {
  .regions-overview-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .region-status-item {
    justify-content: space-between;
    width: 100%;
  }
}


/* Refresh Button Loading Animation */
#refreshBtn.refresh-pulsing {
  background: #1a1a1a;
  border-color: #555;
  color: #fff;
}


#refreshBtn .refresh-icon {
  transition: transform 0.3s ease;
}

#refreshBtn.refresh-pulsing .refresh-icon {
  animation: refreshIconSpin 1s linear infinite;
}

@keyframes refreshIconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#refreshBtn.refresh-success {
  background: #0d4f3c;
  border-color: #00b37e;
  color: #00d4aa;
}

#refreshBtn.refresh-error {
  background: #4f0d0d;
  border-color: #e10600;
  color: #ff4444;
}

/* Refresh Button Animations */
@keyframes refreshPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(255, 77, 77, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.5);
  }
}

@keyframes refreshShimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes refreshSuccess {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes refreshError {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Modern Refresh Popup */
.refresh-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 24px 32px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  text-align: center;
  min-width: 280px;
  backdrop-filter: blur(10px);
}

.refresh-tooltip.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.refresh-tooltip-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.refresh-tooltip-loader {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top: 3px solid #ff4d4d;
  border-radius: 50%;
  animation: refreshLoaderSpin 1s linear infinite;
}

.refresh-tooltip-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

.refresh-tooltip.loading .refresh-tooltip-icon {
  display: none;
}

.refresh-tooltip.success .refresh-tooltip-icon {
  background: #00b37e;
  color: #fff;
}

.refresh-tooltip.error .refresh-tooltip-icon {
  background: #e10600;
  color: #fff;
}

.refresh-tooltip.warning .refresh-tooltip-icon {
  background: #ffc107;
  color: #000;
}

.refresh-tooltip-message {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

@keyframes refreshLoaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes refreshTooltipPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* RSS Status Classes */
.rss-unknown {
  color: #888;
}

.rss-info {
  color: #3ea6ff;
}

.rss-valid {
  color: #00b37e;
  font-weight: 600;
}

.rss-partial {
  color: #ff6b35;
  font-weight: 600;
}

.rss-invalid {
  color: #e10600;
  font-weight: 600;
}

/* ===== AUTH LINK STYLES ===== */
.auth-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #ff6b35;
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.auth-link:hover {
  background: #e55a2b;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.auth-link i {
  font-size: 1rem;
}




.header-right {
  display: flex;
  gap: 0.5rem;
}

.search-btn, .new-message-btn, .admin-btn {
  background: #ff6b35;
  border: none;
  color: #fff;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-btn:hover, .new-message-btn:hover, .admin-btn:hover {
  background: #e55a2b;
}

.admin-btn {
  background: #3ea6ff;
}

.admin-btn:hover {
  background: #2d8ceb;
}

.search-container {
  padding: 1rem 1.5rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

.search-input-container {
  display: flex;
  align-items: center;
  background: #333;
  border-radius: 25px;
  padding: 0.5rem 1rem;
}

.search-input-container input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  outline: none;
  font-size: 1rem;
}

.search-cancel-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.25rem;
}

.search-results {
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background: #333;
}

.user-avatar {
  position: relative;
}

.user-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
}

.online-indicator.online {
  background: #00ff00;
}

.online-indicator.offline {
  background: #666;
}

.user-info h4 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.user-info p {
  margin: 0;
  font-size: 0.875rem;
  color: #999;
}

.start-chat-btn {
  background: #ff6b35;
  border: none;
  color: #fff;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.start-chat-btn:hover {
  background: #e55a2b;
}

.messaging-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.conversations-sidebar {
  width: 350px;
  background: #1a1a1a;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #2a2a2a;
}

.conversation-item:hover {
  background: #2a2a2a;
}

.conversation-item.active {
  background: #333;
}

.conversation-avatar {
  position: relative;
}

.conversation-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

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

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.conversation-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 0.75rem;
  color: #999;
}

.conversation-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conversation-preview p {
  margin: 0;
  font-size: 0.875rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.unread-badge {
  background: #ff6b35;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.5rem;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.welcome-content i {
  font-size: 4rem;
  color: #666;
  margin-bottom: 1rem;
}

.welcome-content h2 {
  margin: 0 0 0.5rem 0;
  color: #fff;
}

.welcome-content p {
  margin: 0;
  color: #999;
}

.chat-interface {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-user-info img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-details h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.user-details span {
  font-size: 0.875rem;
  color: #999;
}

.chat-actions {
  display: flex;
  gap: 0.5rem;
}

.chat-action-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.chat-action-btn:hover {
  background: #333;
  color: #fff;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.messages-list {
  flex: 1;
}

.message {
  margin-bottom: 1rem;
  display: flex;
}

.message.own {
  justify-content: flex-end;
}

.message.other {
  justify-content: flex-start;
}

.message-content {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  position: relative;
}

.message.own .message-content {
  background: #ff6b35;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.other .message-content {
  background: #333;
  color: #fff;
  border-bottom-left-radius: 4px;
}

.message-text {
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

.edited-indicator {
  font-style: italic;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: #999;
  font-size: 0.875rem;
}

.typing-dots {
  display: flex;
  gap: 0.25rem;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.message-input-container {
  padding: 1rem 1.5rem;
  background: #1a1a1a;
  border-top: 1px solid #333;
}

.message-form {
  width: 100%;
}

.input-group {
  display: flex;
  align-items: center;
  background: #333;
  border-radius: 25px;
  padding: 0.5rem;
}

.input-group input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  outline: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

.attach-btn, .send-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: color 0.2s;
}

.attach-btn:hover, .send-btn:hover {
  color: #fff;
}

.send-btn {
  color: #ff6b35;
}

.send-btn:hover {
  background: #ff6b35;
  color: #fff;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #333;
  border-top: 4px solid #ff6b35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.toast-info {
  background: #3ea6ff;
}

.toast-success {
  background: #00b37e;
}

.toast-error {
  background: #e10600;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #999;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #666;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: #fff;
}

.empty-state p {
  margin: 0;
  color: #999;
}

/* Mobile Responsiveness for Messaging */
@media (max-width: 768px) {
  .messaging-content {
    flex-direction: column;
  }
  
  .conversations-sidebar {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid #333;
  }
  
  .conversations-list {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem;
  }
  
  .conversation-item {
    min-width: 200px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid #2a2a2a;
  }
  
  .chat-area {
    flex: 1;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .messaging-header {
    padding: 0.75rem 1rem;
  }
  
  .header-left h1 {
    font-size: 1.25rem;
  }
}

/* Refresh button update indicator */
.refresh-btn.has-update {
  position: relative;
  animation: pulseUpdate 2s infinite;
}

.refresh-btn.has-update::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border-radius: 50%;
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseUpdate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}


