/* ==========================================================================
   NEXUS NEWS WIRE — MODERN FUTURISTIC BLACK & MOBILE RESPONSIVE SYSTEM
   100% Standalone Design System with Glassmorphism, Neon Glow & Touch UX
   ========================================================================== */

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

:root {
  --bg-deep: #06070a;
  --bg-surface: #0b0e17;
  --bg-card: rgba(13, 17, 28, 0.82);
  --bg-card-hover: rgba(18, 24, 40, 0.95);
  
  --cyan-glow: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.12);
  --purple-glow: #a855f7;
  --purple-dim: rgba(168, 85, 247, 0.12);
  --emerald-glow: #00ffaa;
  --emerald-dim: rgba(0, 255, 170, 0.12);
  --crimson-glow: #ff2a5f;
  --crimson-dim: rgba(255, 42, 95, 0.12);

  --text-main: #f0f4fc;
  --text-muted: #8e9db5;
  --text-dim: #546479;
  
  --border-neon: rgba(0, 240, 255, 0.28);
  --border-subtle: rgba(255, 255, 255, 0.08);

  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-tech: 'Rajdhani', monospace, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --glow-cyan-box: 0 0 25px rgba(0, 240, 255, 0.2);
  --glow-cyan-text: 0 0 10px rgba(0, 240, 255, 0.6);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

/* Subtle scanlines effect */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12),
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.3;
  z-index: 9999;
}

/* Responsive Main Container */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   NAVIGATION HEADER
   ========================================================================== */
.cyber-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(6, 8, 14, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  transition: var(--transition);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.25));
  border: 1px solid var(--cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
  font-size: 1.35rem;
  color: var(--cyan-glow);
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #fff, var(--cyan-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-sub {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.nav-tab {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  color: #fff;
  border: 1px solid var(--border-neon);
  background: var(--cyan-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  text-transform: uppercase;
  min-height: 38px;
}

.nav-tab:hover {
  background: rgba(0, 240, 255, 0.25);
  box-shadow: var(--glow-cyan-box);
}

.nav-refresh-btn {
  border-color: rgba(0, 255, 170, 0.4);
  background: var(--emerald-dim);
  color: var(--emerald-glow);
}

.nav-refresh-btn:hover {
  background: rgba(0, 255, 170, 0.25);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-glow);
  box-shadow: 0 0 10px var(--emerald-glow);
  animation: livePulse 1.8s infinite;
  display: inline-block;
}

@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 170, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(0, 255, 170, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 170, 0); }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
}

.hero-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-title-group {
  max-width: 720px;
}

.hero-title-group h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero-title-group h1 span {
  background: linear-gradient(90deg, var(--cyan-glow), var(--purple-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(13, 17, 28, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.stat-label {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.stat-val {
  font-family: var(--font-tech);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cyan-glow);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   CHANNEL FILTERS & ACTION TOOLS BAR
   ========================================================================== */
.filter-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 12px 16px;
  background: rgba(13, 17, 28, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.source-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  padding: 4px 0;
  max-width: 100%;
}

.source-filters::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.filter-label {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  margin-right: 4px;
}

.filter-tab {
  font-family: var(--font-tech);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 38px;
}

.filter-tab:hover {
  color: var(--cyan-glow);
  border-color: rgba(0, 240, 255, 0.4);
  background: var(--cyan-dim);
}

.filter-tab.active {
  color: #fff;
  border-color: var(--cyan-glow);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.18), rgba(168, 85, 247, 0.18));
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}

.action-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.action-tab-cyan {
  border-color: rgba(0, 240, 255, 0.45);
  color: var(--cyan-glow);
  background: var(--cyan-dim);
}

.action-tab-cyan:hover {
  background: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
}

.action-tab-green {
  border-color: rgba(0, 255, 170, 0.45);
  color: var(--emerald-glow);
  background: var(--emerald-dim);
}

.action-tab-green:hover {
  background: rgba(0, 255, 170, 0.25);
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.35);
}

.action-tab-purple {
  border-color: rgba(168, 85, 247, 0.45);
  color: var(--purple-glow);
  background: var(--purple-dim);
}

.action-tab-purple:hover {
  background: rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.35);
}

/* ==========================================================================
   NEWS CARDS GRID
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

/* Cyber Card */
.cyber-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.cyber-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-neon);
  box-shadow: 0 12px 35px rgba(0, 240, 255, 0.18), 0 0 1px 1px rgba(0, 240, 255, 0.3);
  background: var(--bg-card-hover);
}

/* Card Visual Media */
.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background: #04060b;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.cyber-card:hover .card-img {
  transform: scale(1.05);
}

.media-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(13, 17, 28, 0.95) 0%, rgba(13, 17, 28, 0.2) 60%, transparent 100%);
  pointer-events: none;
}

.source-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(6, 8, 14, 0.88);
  border: 1px solid var(--border-subtle);
  color: #fff;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.source-tag.badge-sinhala {
  border-color: rgba(255, 183, 3, 0.5);
  color: #ffb703;
  background: rgba(20, 16, 5, 0.88);
}

/* Card Body */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-time {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
  color: #fff;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

.card-title a:hover {
  color: var(--cyan-glow);
  text-shadow: var(--glow-cyan-text);
}

.card-title.sinhala-title {
  font-family: 'Noto Sans Sinhala', sans-serif;
  font-size: 1.12rem;
  line-height: 1.6;
}

.subtitle-en {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  color: var(--cyan-glow);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-desc.sinhala-body {
  font-family: 'Noto Sans Sinhala', sans-serif;
  line-height: 1.75;
}

/* Card Footer Buttons */
.card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Buttons */
.btn {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  padding: 9px 16px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-transform: uppercase;
  min-height: 40px;
  flex: 1;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.22), rgba(0, 240, 255, 0.35));
  border: 1px solid var(--cyan-glow);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.btn-primary:hover {
  background: var(--cyan-glow);
  color: #05070d;
  box-shadow: 0 0 25px var(--cyan-glow);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-outline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   PAGINATION SECTION
   ========================================================================== */
.load-more-section {
  text-align: center;
  padding: 24px 0 50px;
}

.load-more-btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.btn-load-more {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  padding: 12px 24px;
  border-radius: 4px;
  border: 1px solid var(--cyan-glow);
  background: rgba(0, 240, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-transform: uppercase;
  min-height: 44px;
}

.btn-load-more:hover:not(:disabled) {
  background: var(--cyan-glow);
  color: #05070d;
  box-shadow: 0 0 25px var(--cyan-glow);
}

.btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.btn-load-all-style {
  background: rgba(168, 85, 247, 0.18);
  border-color: var(--purple-glow);
}

.btn-load-all-style:hover:not(:disabled) {
  background: var(--purple-glow);
  color: #fff;
  box-shadow: 0 0 25px var(--purple-glow);
}

.btn-reload-api-style {
  background: rgba(0, 255, 170, 0.15);
  border-color: var(--emerald-glow);
  color: #fff;
  text-decoration: none;
}

.btn-reload-api-style:hover {
  background: var(--emerald-glow);
  color: #05070d;
  box-shadow: 0 0 25px var(--emerald-glow);
}

.load-more-meta {
  font-family: var(--font-tech);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ==========================================================================
   ARTICLE POPUP MODAL (100% RESPONSIVE)
   ========================================================================== */
.cyber-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cyber-modal-backdrop {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(4, 6, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cyber-modal-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: #0d111c;
  border: 1px solid var(--border-neon);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 240, 255, 0.2);
  border-radius: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-modal-overlay.active .cyber-modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--crimson-glow);
  border-color: var(--crimson-glow);
  box-shadow: 0 0 15px var(--crimson-glow);
  transform: rotate(90deg);
}

.modal-header-image {
  position: relative;
  width: 100%;
  height: 280px;
  background: #05070d;
  overflow: hidden;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-image-gradient {
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 55%;
  background: linear-gradient(to top, #0d111c 0%, rgba(13, 17, 28, 0.4) 60%, transparent 100%);
}

.modal-header-image .source-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
}

.modal-body-content {
  padding: 24px 30px 32px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--font-tech);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
  margin-bottom: 8px;
}

.modal-title.sinhala-title {
  font-family: 'Noto Sans Sinhala', sans-serif;
  font-size: 1.38rem;
  line-height: 1.6;
}

.modal-subtitle {
  font-family: var(--font-tech);
  font-size: 1rem;
  color: var(--cyan-glow);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.modal-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--border-neon) 0%, rgba(255, 255, 255, 0.05) 100%);
  margin: 16px 0 20px;
}

.modal-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  color: #d8e2f0;
}

.modal-text.sinhala-body {
  font-family: 'Noto Sans Sinhala', sans-serif;
  font-size: 1.08rem;
  line-height: 2;
  color: #e4ecf7;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-action-btn {
  min-height: 44px;
  padding: 10px 22px;
  font-size: 0.95rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin: 20px 0;
}

.empty-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 8px;
}

.empty-text {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 20px;
  font-size: 0.95rem;
}

/* Clean Footer */
.cyber-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  background: rgba(6, 8, 14, 0.95);
  font-family: var(--font-tech);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.docker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--cyan-glow);
  font-size: 0.82rem;
}

.animate-fade-in {
  animation: cardFadeIn 0.35s ease forwards;
}

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

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE OPTIMIZATIONS)
   ========================================================================== */

/* Medium Devices (Tablets, 768px - 1024px) */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .hero-title-group h1 {
    font-size: 1.9rem;
  }
}

/* Small Devices (Landscape Phones / Tablets, 641px - 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .nav-wrap {
    height: auto;
    padding: 14px 0;
  }
  .hero-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .hero-title-group h1 {
    font-size: 1.65rem;
  }
  .filter-container {
    padding: 10px 12px;
  }
  .action-tools {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .modal-header-image {
    height: 220px;
  }
  .modal-body-content {
    padding: 20px 18px;
  }
  .modal-title {
    font-size: 1.25rem;
  }
}

/* Extra Small Devices (Mobile Phones, <= 640px) */
@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }
  .cyber-header {
    padding: 2px 0;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
  .brand-title {
    font-size: 1.1rem;
  }
  .brand-sub {
    font-size: 0.65rem;
  }
  .nav-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 34px;
  }

  .hero-section {
    padding: 24px 0 18px;
    margin-bottom: 20px;
  }
  .hero-title-group h1 {
    font-size: 1.45rem;
    line-height: 1.3;
  }
  .hero-desc {
    font-size: 0.9rem;
  }
  .hero-meta {
    width: 100%;
  }
  .stat-pill {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
  }

  /* Horizontal touch swipe for channels on mobile */
  .source-filters {
    width: 100%;
    gap: 6px;
  }
  .filter-tab {
    padding: 7px 12px;
    font-size: 0.82rem;
    min-height: 36px;
  }
  .action-tools {
    width: 100%;
    gap: 6px;
  }
  .action-tools .filter-tab {
    flex: 1;
    justify-content: center;
  }

  /* Mobile News Card */
  .card-media-wrapper {
    height: 190px;
  }
  .card-body {
    padding: 16px 14px;
  }
  .card-title {
    font-size: 1.08rem;
  }
  .card-title.sinhala-title {
    font-size: 1.05rem;
  }
  .card-desc {
    font-size: 0.88rem;
    margin-bottom: 14px;
  }
  .card-footer {
    gap: 8px;
    padding-top: 12px;
  }
  .btn {
    min-height: 42px;
    font-size: 0.84rem;
    padding: 8px 12px;
  }

  /* Mobile Load More Buttons */
  .load-more-btn-group {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .btn-load-more {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.88rem;
    min-height: 44px;
  }

  /* Mobile Popup Modal */
  .cyber-modal-overlay {
    padding: 10px;
  }
  .cyber-modal-dialog {
    max-height: 94vh;
    border-radius: 8px;
  }
  .modal-close-btn {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    top: 10px;
    right: 10px;
  }
  .modal-header-image {
    height: 180px;
  }
  .modal-body-content {
    padding: 16px 14px 22px;
  }
  .modal-title {
    font-size: 1.15rem;
  }
  .modal-title.sinhala-title {
    font-size: 1.15rem;
  }
  .modal-subtitle {
    font-size: 0.88rem;
  }
  .modal-text {
    font-size: 0.95rem;
    line-height: 1.75;
  }
  .modal-footer-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
  }
  .modal-action-btn {
    width: 100%;
    text-align: center;
  }
  
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }
}
