/* Reset et variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #10a37f;
  --primary-dark: #0d8a6a;
  --dark-bg: #1a1a1a;
  --darker-bg: #0d1117;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --bg-color: #ffffff;
  --bg-light: #f5f5f5;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --error-color: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius: 4px;
  --radius-lg: 8px;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--text-color);
  background-color: var(--bg-light);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== NAVBAR / HEADER ===== */
.navbar {
  background: var(--dark-bg);
  padding: 1.5rem 0;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: 'Arial Black', 'Helvetica', sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  color: white;
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo:hover {
  color: var(--primary-color);
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 500px;
  display: flex;
  gap: 0;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.875rem;
  background: #2d2d2d;
  color: white;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  background: #3d3d3d;
}

.search-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.3s;
}

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

/* Nav Menu */
.nav-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-family: 'Arial', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0.5rem 0.75rem;
}

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

.nav-icon {
  display: flex;
  align-items: center;
  padding: 0.3rem;
}

.nav-icon svg {
  display: block;
}

.nav-icon .icon-bg {
  fill: white;
  transition: fill 0.3s;
}

.nav-icon .icon-stroke {
  stroke: #1a1a1a;
  fill: none;
  transition: stroke 0.3s;
}

.nav-icon:hover .icon-bg {
  fill: var(--primary-color);
}

.nav-icon:hover .icon-stroke {
  stroke: white;
}

.logout-icon {
  background: none;
  border: none;
  cursor: pointer;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-family: 'Arial', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

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

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

.btn-secondary {
  background: #4b5563;
  color: white;
}

.btn-secondary:hover {
  background: #374151;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
}

/* ===== CATEGORIES NAV ===== */
.categories-nav {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.categories-list {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.category-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-family: 'Arial', sans-serif;
  font-size: 0.8rem;
  color: var(--text-color);
  border-radius: var(--radius);
  transition: all 0.3s;
}

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

/* ===== HERO SECTION ===== */
.hero {
  background: var(--bg-color);
  padding: 2rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 420px;
}

.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-main-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: white;
}

.hero-main-title {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.hero-main-meta {
  font-size: 0.7rem;
  opacity: 0.9;
  font-family: 'Arial', sans-serif;
}

.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Top article with text left, image right */
.hero-top-article {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-top-content {
  flex: 1;
}

.hero-top-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  color: var(--text-color);
}

.hero-top-excerpt {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.hero-top-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Arial', sans-serif;
}

.hero-top-image {
  width: 140px;
  height: 100px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

/* Featured card row */
.hero-featured-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.5rem;
}

.hero-featured-meta {
  grid-column: 1 / -1;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Arial', sans-serif;
  padding-top: 0.25rem;
}

.hero-featured-card {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-featured-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero-secondary-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.hero-secondary-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-secondary-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
}

.hero-secondary-overlay h4 {
  font-size: 0.7rem;
  line-height: 1.3;
  margin: 0;
}

/* Bottom article */
.hero-bottom-article {
  padding-top: 0.75rem;
}

.hero-bottom-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--text-color);
}

.hero-bottom-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Arial', sans-serif;
  margin-bottom: 0.5rem;
}

.hero-bottom-excerpt {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Legacy hero article styles (for fallback) */
.hero-article {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.hero-article-content {
  flex: 1;
}

.hero-article-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--text-color);
}

.hero-article-excerpt {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
}

.hero-article-image {
  width: 120px;
  height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ===== MAIN CONTENT LAYOUT ===== */
.main-content {
  padding: 2rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* ===== LATEST NEWS SECTION ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Arial', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ===== POST CARD ===== */
.post-card {
  background: var(--bg-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-3px);
}

.post-image-container {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-category {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-family: 'Arial', sans-serif;
  text-transform: uppercase;
  border-radius: 2px;
}

.post-content {
  padding: 1rem;
}

.post-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  line-height: 1.4;
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Arial', sans-serif;
  margin-bottom: 0.75rem;
}

.post-description {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ===== TRENDING SIDEBAR ===== */
.trending-section {
  background: var(--bg-color);
  border-radius: var(--radius);
  padding: 1rem;
}

.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
}

.trending-title {
  font-family: 'Arial', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.view-all-btn {
  background: var(--dark-bg);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.65rem;
  text-decoration: none;
  font-family: 'Arial', sans-serif;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trending-item {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

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

.trending-image {
  width: 80px;
  height: 60px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.trending-content {
  flex: 1;
}

.trending-item-title {
  font-size: 0.85rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.trending-item-excerpt {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.trending-item-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Arial', sans-serif;
}

/* ===== VIEW MORE BUTTON ===== */
.view-more-container {
  text-align: center;
  margin-top: 2rem;
}

.view-more-btn {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: 'Arial', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-block;
  transition: background 0.3s;
}

.view-more-btn:hover {
  background: var(--primary-dark);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--darker-bg);
  color: white;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-logo {
  font-family: 'Arial Black', 'Helvetica', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: 'Arial', sans-serif;
}

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

.footer-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.footer-category {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: 'Arial', sans-serif;
}

.footer-category:hover {
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== ADMIN PAGE ===== */
.admin-page {
  padding: 2rem 0;
  min-height: 80vh;
}

.login-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card, .form-card {
  background: var(--bg-color);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 450px;
  width: 100%;
}

.login-card h2, .form-card h2 {
  margin-bottom: 1.5rem;
  color: var(--text-color);
  text-align: center;
  font-family: 'Arial', sans-serif;
  font-size: 1.5rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-family: 'Arial', sans-serif;
  font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
  background: var(--bg-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.form-group textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.admin-form-section {
  max-width: 600px;
  margin: 2rem auto;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--text-color);
  font-family: 'Arial', sans-serif;
}

/* ===== MESSAGES ===== */
.loading, .empty-message {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
  font-size: 1rem;
}

.error-message {
  color: var(--error-color);
  background: rgba(239, 68, 68, 0.1);
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.success-message {
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.message {
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

/* ===== POSTS PAGE ===== */
.posts-page {
  padding: 2rem 0;
  min-height: 80vh;
}

.posts-page .posts-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .posts-page .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    gap: 1rem;
  }

  .search-bar {
    max-width: 100%;
    width: 100%;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }

  .posts-grid,
  .posts-page .posts-grid {
    grid-template-columns: 1fr;
  }

  .hero-main {
    height: 300px;
  }

  .hero-main-title {
    font-size: 1.25rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-categories {
    justify-content: center;
  }

  .categories-list {
    gap: 0.25rem;
  }

  .category-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }
}

/* ===== ARTICLE PAGE ===== */
.article-page {
  min-height: 80vh;
}

.article-hero {
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

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

.article-category {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-family: 'Arial', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: 'Arial', sans-serif;
}

.article-author {
  font-weight: 600;
  color: var(--text-color);
}

.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-color);
}

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

.article-body p:last-child {
  margin-bottom: 0;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.article-source {
  color: var(--text-light);
  font-size: 0.9rem;
}

.article-source a {
  color: var(--primary-color);
  text-decoration: none;
}

.article-source a:hover {
  text-decoration: underline;
}

.btn-secondary:hover {
  background: #374151;
}

/* Article page responsive */
@media (max-width: 768px) {
  .article-hero {
    height: 250px;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-content-wrapper {
    padding: 1.5rem 0;
  }
}
