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

:root {
  --primary-navy: #0a1428;
  --secondary-navy: #1a2332;
  --accent-blue: #4a9eff;
  --accent-orange: #ff6b35;
  --text-primary: #ffffff;
  --text-secondary: #a8b3c1;
  --border-subtle: #2a3441;
  --card-bg: #151b26;
  --hover-bg: #1e2530;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--primary-navy);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

.headline {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text-primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  transition: 0.3s;
}

/* Breaking News Ticker */
.breaking-ticker {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #ff5722 100%);
  color: white;
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-content {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 60s linear infinite;
  cursor: pointer;
}

.ticker-item {
  display: inline-block;
  margin-right: 4rem;
  font-weight: 500;
  font-size: 0.9rem;
}

@keyframes scroll-left {
  0% { transform: translate3d(100%, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Main Layout */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2rem;
}

.content {
  min-width: 0; /* Prevent grid overflow */
}

/* Category Filter */
.category-filter {
  background: var(--secondary-navy);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 80px;
  z-index: 50;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.filter-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: 0 8px 32px rgba(74, 158, 255, 0.15);
}

.news-card.breaking {
  border-left: 4px solid var(--accent-orange);
}

.card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.source-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.card-content {
  padding: 1.25rem;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.card-title:hover {
  color: var(--accent-blue);
}

.card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-date {
  font-weight: 500;
}

.read-more {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.read-more:hover {
  color: var(--text-primary);
}

/* Load More Button */
.load-more {
  text-align: center;
  margin: 2rem 0;
}

.load-more-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.load-more-btn:hover {
  background: #3a8de8;
  transform: translateY(-2px);
}

.load-more-btn:disabled {
  background: var(--border-subtle);
  cursor: not-allowed;
  transform: none;
}

/* Sidebar */
.sidebar {
  padding: 1rem 0;
}

.sidebar-section {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--accent-blue);
}

.trending-list {
  list-style: none;
}

.trending-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.trending-item:last-child {
  border-bottom: none;
}

.about-blurb {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.cta-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.cta-link:hover {
  color: var(--text-primary);
}

/* Footer */
.footer {
  background: var(--secondary-navy);
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Loading States */
.skeleton {
  animation: skeleton-loading 1s infinite alternate;
}

.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.skeleton-image {
  height: 200px;
  background: var(--border-subtle);
}

.skeleton-content {
  padding: 1.25rem;
}

.skeleton-text {
  height: 1rem;
  background: var(--border-subtle);
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.skeleton-text.short {
  width: 70%;
}

.skeleton-text.medium {
  width: 85%;
}

@keyframes skeleton-loading {
  0% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Blog Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
}

.blog-content {
  padding: 1.5rem;
}

.blog-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Article Styles */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.article-meta {
  color: var(--text-secondary);
  font-size: 1rem;
}

.article-content {
  line-height: 1.8;
  font-size: 1.1rem;
}

.article-content h2 {
  margin: 2rem 0 1rem;
  color: var(--accent-blue);
}

.article-content h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0 1.5rem 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.share-btn {
  background: var(--secondary-navy);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }
  
  .nav {
    display: none;
  }
  
  .hamburger {
    display: flex;
  }
  
  .main-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .sidebar {
    order: -1;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .filter-btn {
    flex: 1;
    text-align: center;
    min-width: 80px;
  }
  
  .ticker-content {
    animation: scroll-left 30s linear infinite;
  }
  
  .article-container {
    padding: 1rem;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .news-grid {
    gap: 1rem;
  }
  
  .filter-buttons {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }
  
  .share-buttons {
    flex-wrap: wrap;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-subtle: #4a5568;
    --text-secondary: #e2e8f0;
  }
  
  .news-card {
    border-width: 2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .ticker-content {
    animation: none;
  }
}