/* Import modern Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-family-title: 'Outfit', sans-serif;
  --font-family-body: 'Inter', sans-serif;
  
  /* Light Mode Colors (Clean Google Palette) */
  --bg-primary: #f6f8fc;
  --bg-card: #ffffff;
  --bg-sidebar-active: #e8f0fe;
  --bg-nav: #ffffff;
  --text-primary: #1f2124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border-color: #dadce0;
  --hover-bg: #f1f3f4;
  --accent-color: #1a73e8;
  --accent-hover: #1557b0;
  --accent-light: #e8f0fe;
  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.1), 0 1px 3px 1px rgba(60, 64, 67, 0.05);
  --shadow-md: 0 4px 12px 0 rgba(60, 64, 67, 0.08), 0 1px 2px 0 rgba(60, 64, 67, 0.15);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --card-radius: 16px;
  --btn-radius: 24px;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --danger-color: #d93025;
  --nav-link-color: #000000;
}

[data-theme="dark"] {
  /* Dark Mode Colors (Sleek Slate/Navy Palette) */
  --bg-primary: #0a0f1d;
  --bg-card: #151d33;
  --bg-sidebar-active: #233154;
  --bg-nav: #111827;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: #2e3b5e;
  --hover-bg: #1f2937;
  --accent-color: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-light: rgba(56, 189, 248, 0.15);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --danger-color: #ef4444;
  --nav-link-color: #ffffff;
}

/* Global Reset & Base Styles */
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-title);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition-smooth);
}
a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

/* Header & Navbar Styles */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
  gap: 16px;
}

.header-nav-bottom {
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.header-nav-bottom::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.nav-links-scrollable {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}

.nav-link-item {
  color: var(--nav-link-color) !important;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-link-item:hover {
  color: var(--accent-color) !important;
}

.nav-link-item.active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.menu-toggle:hover {
  background-color: var(--hover-bg);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-family: var(--font-family-title);
  font-weight: 700;
  color: var(--text-primary);
}

.logo-g { color: #4285f4; }
.logo-n { color: var(--text-secondary); font-weight: 400; }

.header-center {
  flex: 1;
  max-width: 720px;
  position: relative;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 12px 100px 12px 48px;
  border: 1px solid transparent;
  border-radius: 28px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-family-body);
  transition: var(--transition-smooth);
}
.search-input:focus {
  outline: none;
  background-color: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 1px 1px 0 rgba(65,69,73,0.3), 0 1px 3px 1px rgba(65,69,73,0.15);
}

.search-clear {
  position: absolute;
  right: 70px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}
.search-clear:hover {
  background-color: var(--hover-bg);
}
.lang-toggle-wrapper {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  display: flex;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  border-radius: 0 28px 28px 0;
  overflow: hidden;
}
.lang-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.2s;
  height: 100%;
}
.lang-toggle-btn:hover:not(.active) {
  background: var(--hover-bg);
}
.lang-toggle-btn.active {
  background: #4285f4;
  color: #fff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.theme-toggle-btn:hover {
  background-color: var(--hover-bg);
}

.user-profile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* Page Layout Structure */
.app-container {
  display: flex;
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 256px;
  padding: 24px 12px;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  background-color: transparent;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .app-sidebar.desktop-closed {
    display: none;
  }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 12px 16px 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-smooth);
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}

.sidebar-nav-item:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background-color: var(--bg-sidebar-active);
  color: var(--accent-color);
  font-weight: 600;
}

.sidebar-nav-item svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Main Content Area */
.app-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

/* Grid Layout for News and Widgets */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.feed-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
}

.feed-date {
  font-size: 14px;
  color: var(--text-secondary);
}

/* News Cards & Items */
.news-card-hero {
  background-color: var(--bg-card);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
}

.news-card-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-image-wrapper {
  height: 280px;
  width: 100%;
  position: relative;
  background-color: var(--hover-bg);
}

.hero-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-family-title);
  background-size: cover;
  background-position: center;
}

.hero-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}

.hero-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background-color: var(--accent-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.news-card-hero-body {
  padding: 24px;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.hero-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-primary);
}

.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.meta-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.meta-action {
  background: none;
  border: none;
  padding: 4px 8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 12px;
  transition: var(--transition-smooth);
}
.meta-action:hover {
  background-color: var(--hover-bg);
  color: var(--accent-color);
}

/* Secondary & List News Items */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-list-item {
  background-color: var(--bg-card);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 20px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.news-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 576px) {
  .news-list-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.item-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.item-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.item-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.item-thumbnail {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background-color: var(--hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 700;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-color);
}

/* Sidebar Widgets Column */
.widgets-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Weather Widget */
.weather-card {
  background: linear-gradient(135deg, #1877F2 0%, #105bb5 100%);
  color: white;
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: none;
  transition: var(--transition-smooth);
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.weather-city {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-family-title);
  margin: 0;
  color: white !important;
}

.weather-desc {
  font-size: 14px;
  opacity: 0.9;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.weather-temp {
  font-size: 36px;
  font-weight: 700;
  font-family: var(--font-family-title);
  line-height: 1;
}

.weather-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
}

.weather-details {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 12px;
  font-size: 15px;
  opacity: 0.9;
}

.weather-forecast {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.forecast-name {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.85;
}

.forecast-icon {
  font-size: 18px;
}

.forecast-temp {
  font-size: 14px;
  font-weight: 600;
}

/* Compact Widget Layouts */
.widget-panel {
  background-color: var(--bg-card);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--hover-bg);
  padding-bottom: 8px;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trending-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 6px 0;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.trending-item:hover .trending-title {
  color: var(--accent-color);
}

.trending-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-color);
  opacity: 0.7;
  width: 24px;
  text-align: center;
}

.trending-details {
  flex: 1;
}

.trending-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  transition: var(--transition-smooth);
}

.trending-source {
  font-size: 11px;
  color: var(--text-muted);
}

/* Tag Cloud Widget */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background-color: var(--hover-bg);
  color: var(--text-primary);
  border: none;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.tag-btn:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Modal detail dialog (Google News Reader Style) */
.article-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 15, 29, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content-card {
  background-color: var(--bg-card);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.modal-close-btn:hover {
  background-color: var(--hover-bg);
}

.modal-body-scroll {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 16px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.modal-article-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.modal-article-text p {
  margin-bottom: 16px;
}

/* Likes and Comments section inside Modal */
.modal-interactive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  margin-bottom: 24px;
}

.like-action-btn {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.like-action-btn:hover {
  background-color: var(--accent-color);
  color: white;
}

.comments-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.comment-bubble {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
}

.comment-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.comment-username {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  color: var(--text-muted);
}

.comment-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-input-user {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
}
.comment-input-user:focus {
  outline: none;
  border-color: var(--accent-color);
}

.comment-input-text {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}
.comment-input-text:focus {
  outline: none;
  border-color: var(--accent-color);
}

.comment-submit-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  align-self: flex-end;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.comment-submit-btn:hover {
  background-color: var(--accent-hover);
}

/* Footer Section */
.main-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-nav);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

/* Custom Scrollbar for modern feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Comprehensive Professional Responsive Device System (Desktop, Tablet, Mobile)
   ========================================================================== */

/* Touch Ergonomics & Smooth Scrolling Base */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

/* 1. Desktop Large Displays (≥ 1200px) */
@media (min-width: 1200px) {
  .app-container {
    max-width: 1600px;
    margin: 0 auto;
  }
  .news-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
  }
}

/* 2. Tablet / iPad View (768px – 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .main-header {
    padding: 10px 18px;
  }

  .header-container {
    padding: 0;
    gap: 14px;
  }

  .brand-text {
    font-size: 1.9rem !important;
  }

  .header-dates {
    font-size: 15px !important;
  }

  .news-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
  }

  .app-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 1050;
    width: 260px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
  }

  .app-sidebar.open {
    left: 0;
  }

  .nav-links-scrollable {
    gap: 18px;
  }

  .nav-link-item {
    font-size: 16.5px;
  }
}

/* 3. Mobile Phones & Compact Screens (max-width: 767px) */
@media (max-width: 767px) {
  .main-header {
    padding: 8px 12px;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-left {
    flex: 1;
    justify-content: flex-start;
  }

  .brand-text {
    font-size: 1.55rem !important;
  }

  .header-right {
    gap: 8px !important;
  }

  .header-dates {
    font-size: 12.5px !important;
    gap: 6px !important;
  }

  #engDateWrapper, #bngDateDisplay {
    font-size: 12.5px !important;
  }

  .header-center {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
  }

  .search-input {
    font-size: 13.5px;
    padding: 8px 34px 8px 36px;
  }

  .header-nav-bottom {
    margin-top: 6px;
    padding-top: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links-scrollable {
    gap: 14px;
  }

  .nav-link-item {
    font-size: 15px;
    padding: 6px 2px;
  }

  .app-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 1050;
    width: 260px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-nav);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border-color);
  }

  .app-sidebar.open {
    left: 0;
  }

  .news-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 10px 0;
  }

  .widgets-column {
    order: 2;
  }

  .news-card {
    border-radius: 12px;
    padding: 14px;
  }

  .news-title {
    font-size: 1.05rem;
    line-height: 1.4;
  }

  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .feed-title {
    font-size: 1.35rem;
  }

  .feed-tabs {
    gap: 6px !important;
  }

  .feed-tabs .btn {
    font-size: 12px !important;
    padding: 5px 12px !important;
  }

  /* Responsive Article Modal Popup for Mobile */
  .article-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-content-card {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header-row {
    padding: 12px 16px;
  }

  .modal-body-scroll {
    padding: 16px;
  }

  .modal-title {
    font-size: 1.15rem;
    line-height: 1.35;
  }

  .modal-meta {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
  }

  .modal-article-text {
    font-size: 14.5px;
    line-height: 1.55;
  }

  .comment-input-user {
    width: 100%;
  }

  /* Admin Responsiveness */
  .admin-container {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* 4. Ultra Compact Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  .brand-text {
    font-size: 1.35rem !important;
  }

  .header-dates {
    display: none; /* Hide date text on tight screens to preserve clean layout */
  }

  .news-category-section {
    padding: 12px !important;
  }

  .news-category-section div[style*="grid-template-columns"] {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)) !important;
    gap: 8px !important;
  }
}

/* Custom Calendar Popout Styles */
.calendar-dropdown-menu {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    min-width: 280px;
    color: var(--text-primary);
    z-index: 9999;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
}

.calendar-nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.calendar-nav-btn:hover {
    color: var(--text-primary);
}

.calendar-grid {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 5px;
}

.calendar-grid th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
}

/* First column (Friday) in accent color */
.calendar-grid th:first-child {
    color: var(--accent-color);
}

.calendar-grid td {
    text-align: center;
    vertical-align: middle;
}

.calendar-date-cell {
    width: 32px;
    height: 32px;
    line-height: 32px;
    margin: 0 auto;
    border-radius: 50%;
    cursor: default;
}

.calendar-date-cell:hover {
    background-color: var(--hover-bg);
}

.calendar-date-cell.today {
    background-color: var(--accent-color);
    color: var(--bg-card);
    font-weight: 700;
    border-radius: 8px;
}

.calendar-date-cell.holiday {
    color: var(--danger-color);
    font-weight: bold;
}

.calendar-divider {
    border-top: 1px solid var(--border-color);
    margin: 15px 0 10px 0;
}

.calendar-holidays {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.calendar-holidays li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.calendar-holidays .dot {
    color: var(--danger-color);
    font-size: 18px;
    margin-right: 8px;
    line-height: 1;
}

.calendar-holidays .date-num {
    color: var(--text-primary);
    font-weight: bold;
    margin-right: 8px;
}

