/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --secondary: #e8f0fe;
  --dark: #202124;
  --light: #f8f9fa;
  --gray: #5f6368;
  --light-gray: #dadce0;
  --danger: #ea4335;
  --success: #34a853;
  --warning: #fbbc04;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-admin {
  background: var(--warning);
  color: var(--dark);
}

.btn-admin:hover {
  background: #e6a700;
}

/* Spinner */
.spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  font-size: 1.2rem;
  color: var(--primary);
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* Fade In Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.site-header {
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--light-gray);
}

.site-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo i {
  font-size: 1.5rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-container {
  position: relative;
  width: 300px;
}

.search-container input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border: 1px solid var(--light-gray);
  border-radius: 20px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-container input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--gray);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  color: var(--primary);
}

.user-actions {
  display: flex;
  gap: 10px;
}

.user-actions .btn {
  padding: 8px 15px;
  font-size: 0.9rem;
}

.site-nav {
  padding: 15px 0;
}

.site-nav ul {
  display: flex;
  justify-content: space-between;
}

.site-nav a {
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

.site-nav a:hover {
  color: var(--primary);
  background: var(--secondary);
}

.site-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--dark);
  cursor: pointer;
}

.sidebar-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--dark);
  cursor: pointer;
}

/* Featured Story */
.top-story {
  margin: 30px 0;
}

.featured {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.featured img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  transition: var(--transition);
}

.featured:hover img {
  transform: scale(1.03);
}

.featured-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 40px 30px 30px;
}

.featured-text h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  line-height: 1.2;
}

.featured-text p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  opacity: 0.9;
}

.featured-meta {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.category-tag {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* News Grid */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light-gray);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.view-all {
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.all-news-list .news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.news-item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.news-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* Video styles for uploaded article media */
.featured-video {
  width: 100%;
  height: 500px;
  object-fit: cover;
  background: black;
}

.news-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: black;
}

.trending-thumb {
  width: 100px;
  height: 80px;
  object-fit: cover;
  background: black;
}

.news-content {
  padding: 20px;
}

.news-content h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  line-height: 1.3;
}

.news-content p {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--gray);
}

.news-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Trending Section */
.trending-news {
  background: var(--secondary);
  padding: 40px 0;
  margin: 40px 0;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.trending-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.trending-item:hover {
  transform: translateX(5px);
}

.trending-item img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.trending-content h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.trending-content p {
  font-size: 0.85rem;
  color: var(--gray);
}

/* Newsletter */
.newsletter {
  background: var(--primary);
  color: white;
  padding: 50px 0;
  text-align: center;
  margin: 40px 0;
}

/* Layout with left sidebar */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}

.left-sidebar {
  position: relative;
}

.left-sidebar .sidebar-section {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.sidebar-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.sidebar-sections li { margin-bottom: 8px; }
.sidebar-sections a { color: var(--dark); display:block; padding:6px 4px; border-radius:4px; }
.sidebar-sections a:hover { background: var(--secondary); color: var(--primary); }

.sidebar-list .sidebar-item { display:flex; gap:10px; align-items:center; padding:8px 0; border-bottom:1px solid var(--light-gray); cursor:pointer; }
.sidebar-list .sidebar-item:last-child { border-bottom:none; }
.sidebar-thumb img { width:64px; height:44px; object-fit:cover; border-radius:4px; }
.sidebar-title-small { font-size:0.95rem; color:var(--dark); }

/* Article page styles */
.article-container { max-width:1100px; margin:30px auto; padding:0 16px; }
.article-hero { margin-bottom:18px; }
.article-hero h1 { font-size:2.2rem; line-height:1.15; margin-bottom:10px; }
.article-byline { color:var(--gray); margin-bottom:12px; }
.share-buttons { display:flex; gap:8px; margin-bottom:12px; }
.article-row { display:grid; grid-template-columns: 1fr 320px; gap:24px; align-items:start; }
.article-main .article-media img, .article-main .article-media video { width:100%; height:auto; border-radius:8px; margin-bottom:18px; }
.article-body { font-size:1.05rem; line-height:1.75; color:var(--dark); }
.article-body p { margin-bottom:1rem; }
.article-sidebar .sidebar-section { padding:12px; }
.related-item { padding:8px 0; border-bottom:1px solid var(--light-gray); cursor:pointer; }
.related-item:last-child { border-bottom:none; }


.newsletter h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.newsletter p {
  max-width: 600px;
  margin: 0 auto 25px;
  opacity: 0.9;
}

.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
}

.newsletter-form button {
  background: var(--dark);
  color: white;
  border: none;
  padding: 0 25px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.newsletter-form button:hover {
  background: #000;
}

/* Footer */
.site-footer {
  background: var(--dark);
  color: white;
  padding: 50px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #b0b3b8;
  transition: var(--transition);
  cursor: pointer;
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: #b0b3b8;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 15px;
  top: 15px;
}

.close:hover {
  color: var(--dark);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Dark Mode */
body.dark-mode {
  --light: #121212;
  --dark: #e8eaed;
  --gray: #9aa0a6;
  --light-gray: #3c4043;
  --secondary: #202124;
}

body.dark-mode .site-header,
body.dark-mode .news-item,
body.dark-mode .trending-item,
body.dark-mode .modal-content {
  background: #202124;
  color: var(--dark);
}

body.dark-mode .site-nav a:hover {
  background: #2d2e31;
}

body.dark-mode .search-container input {
  background: #303134;
  border-color: #5f6368;
  color: var(--dark);
}
/* Main layout container */
.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem; /* Space between sidebar and main content */
  margin-top: 20px;
  align-items: flex-start;
}

/* Left sidebar styling */
.left-sidebar {
  flex-basis: 250px; /* Ideal width when sidebar is sidebar */
  flex-grow: 1;
  background: #f8f8f8;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 100px; /* Adjust based on your header height */
  align-self: flex-start; /* Prevent stretching to full height */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* Main content area */
.main-column {
  flex-basis: 0;
  flex-grow: 999;
  min-inline-size: 50%; /* Wrap when sidebar stops being useful */
}

/* Sidebar sections */
.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #bb1919; /* BBC-style red accent */
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-sections {
  list-style: none;
}

.sidebar-sections li {
  margin-bottom: 0.8rem;
}

.sidebar-sections a {
  color: #333;
  text-decoration: none;
  padding: 0.5rem 0;
  display: block;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar-sections a:hover {
  color: #bb1919; /* BBC red */
  padding-left: 0.5rem;
  background: #fff;
}

.sidebar-sections a.active {
  color: #bb1919;
  font-weight: 600;
  border-left: 3px solid #bb1919;
  padding-left: 0.5rem;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Responsive behavior */
@media screen and (max-width: 768px) {
  .layout {
    flex-direction: column;
    gap: 1rem;
  }
  
  .left-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    order: 2; /* Move sidebar below content on mobile */
    display: none; /* Hidden by default on mobile */
  }
  
  .main-column {
    order: 1;
  }
}

/* Dark mode support */
body.dark-mode .left-sidebar {
  background: #2d2d2d;
  color: #e8eaed;
}

body.dark-mode .sidebar-sections a {
  color: #e8eaed;
  border-bottom-color: #444;
}

body.dark-mode .sidebar-sections a:hover {
  background: #3d3d3d;
}
/* Responsive */
@media (max-width: 992px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .layout { grid-template-columns: 1fr; }
  .left-sidebar { order: -1; }
  .article-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
    gap: 15px;
  }

  .search-container {
    width: 100%;
    order: 3;
  }

  .mobile-toggle {
    display: block;
  }

  .sidebar-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    padding: 20px;
  }

  .site-nav.active {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .site-nav a.active::after {
    display: none;
  }

  .featured-text h2 {
    font-size: 1.8rem;
  }

  .featured-text p {
    font-size: 1rem;
  }

  .newsletter-form {
    flex-direction: column;
    gap: 10px;
  }

  .newsletter-form input,
  .newsletter-form button {
    border-radius: 4px;
    width: 100%;
  }
}

@media (max-width: 576px) {
  .featured-text {
    padding: 20px 15px 15px;
  }

  .featured-text h2 {
    font-size: 1.5rem;
  }

  .featured-meta {
    flex-direction: column;
    gap: 5px;
  }

  .trending-item {
    flex-direction: column;
  }

  .trending-item img {
    width: 100%;
    height: 150px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* Toast styles (admin/use) */
.toast { font-weight:600; transition: opacity 0.3s ease; }
.toast.info { background: rgba(0,0,0,0.8); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Video control (mute/unmute) overlay */
.video-control {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}
.video-control i { font-size: 0.95rem; }
.video-container { position: relative; display: block; }

/* Global sound control (placed next to header controls) */
.global-sound-control {
  position: relative;
  top: 0;
  right: 0;
  margin-left: 8px;
  background: transparent;
  color: var(--gray);
  border: none;
  padding: 6px 8px;
  font-size: 1.05rem;
}
.global-sound-control:hover { color: var(--primary); }