/* NoFatNews - Web Styles */

/* Light Mode (default) */
:root {
  --primary: #1E88E5;
  --primary-dark: #1565C0;
  --secondary: #FF6F00;
  --bg-main: #FFFFFF;
  --bg-card: #F5F5F5;
  --bg-card-hover: #EBEBEB;
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #E0E0E0;
  --success: #4CAF50;
  --shadow: rgba(0,0,0,0.1);
  --max-width: 1200px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #1A1A1A;
    --bg-card: #222222;
    --bg-card-hover: #2a2a2a;
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --text-muted: #888888;
    --border: #333333;
    --shadow: rgba(0,0,0,0.3);
  }
}

/* Manual theme override */
[data-theme="light"] {
  --bg-main: #FFFFFF;
  --bg-card: #F5F5F5;
  --bg-card-hover: #EBEBEB;
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #E0E0E0;
  --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --bg-main: #1A1A1A;
  --bg-card: #222222;
  --bg-card-hover: #2a2a2a;
  --text-primary: #E0E0E0;
  --text-secondary: #B0B0B0;
  --text-muted: #888888;
  --border: #333333;
  --shadow: rgba(0,0,0,0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

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

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

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

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
}

.header-cta {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #e65100;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Hero Section */
.hero {
  padding: 80px 20px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-main) 100%);
}

.cta-section {
  padding: 60px 20px;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-image {
  margin-top: 60px;
}

.hero-image img {
  max-width: 300px;
  border-radius: 20px;
  box-shadow: 0 20px 60px var(--shadow);
}

/* Features Section */
.features {
  padding: 80px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 60px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  transition: transform 0.2s;
  border: 1px solid var(--border);
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 22px;
  margin-bottom: 15px;
}

.feature-card p {
  color: var(--text-secondary);
}

/* News Section */
.news-section {
  padding: 60px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Categories */
.categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  justify-content: center;
}

.category-btn {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.category-btn:hover,
.category-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.news-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 1px solid var(--border);
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow);
}

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

.news-card-content {
  padding: 20px;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.news-card-source {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
}

.news-card-category {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.news-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card p {
  color: var(--text-secondary);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.news-card-stats {
  display: flex;
  gap: 15px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

/* Load More */
.load-more {
  text-align: center;
  margin-top: 40px;
}

/* Article Page */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-header {
  margin-bottom: 30px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 14px;
  color: var(--text-muted);
}

.article-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

.article-image {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 30px;
}

.article-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-content p {
  margin-bottom: 20px;
}

.article-cta {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  margin-top: 40px;
  border: 1px solid var(--border);
}

.article-cta h3 {
  margin-bottom: 15px;
}

.article-cta p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  margin-top: 80px;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 30px;
}

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

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

.footer-copy {
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: 15px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 20px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .article-title {
    font-size: 28px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .header-content {
    padding: 10px 15px;
  }

  .logo {
    font-size: 18px;
  }

  .logo img {
    width: 32px;
    height: 32px;
  }

  .nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .header-cta .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .header-cta .btn span {
    display: inline;
  }
}
