:root {
  /* Light theme */
  --primary-color: #2563eb;
  --secondary-color: #3b82f6;
  --text-color: #1f2937;
  --background-color: #f3f4f6;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --border-color: #e5e7eb;
  --muted-text: #6b7280;
}

[data-theme="dark"] {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --text-color: #f3f4f6;
  --background-color: #111827;
  --card-bg: #1f2937;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --border-color: #374151;
  --muted-text: #9ca3af;
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  margin: 0;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 6rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  text-decoration: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
  color: white;
}

/* Dark mode adjustments for buttons */
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .back-to-top {
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .back-to-top:hover {
  background: var(--primary-dark);
}

/* HEADER */
header {
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

/* SEARCH BAR */
.search-container {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 0.8rem 1rem;
  padding-right: 3rem;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-box button:hover {
  background: var(--secondary-color);
  transform: translateY(-50%) scale(1.1);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  margin-top: 0.5rem;
}

.search-results.show {
  display: block;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
  color: var(--text-color);
}

.search-result-item:hover {
  background: var(--background-color);
}

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

.search-result-image {
  width: 50px;
  height: 35px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 0.8rem;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--muted-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-category {
  background: var(--primary-color);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted-text);
}

.search-loading {
  padding: 1rem;
  text-align: center;
  color: var(--muted-text);
}

.search-loading i {
  animation: spin 1s linear infinite;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  position: relative;
  padding: 0.3rem 0;
}

.logo::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), #f97316);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.logo:hover::before {
  transform: scaleX(1);
}

.logo span {
  background: linear-gradient(45deg, var(--primary-color), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.logo .emoji {
  font-size: 1.4rem;
  color: #f97316;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

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

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

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.2s ease;
}

nav a:hover::after {
  width: 100%;
}

nav a.contact {
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

nav a.contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

nav a.contact::after {
  display: none;
}

/* FEATURED ARTICLE */
.featured-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.featured-article {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  transition: transform 0.3s ease;
}

.featured-article:hover {
  transform: translateY(-5px);
}

.featured-image {
  position: relative;
  height: 400px;
}

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

.featured-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-category {
  font-size: 0.8rem;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.featured-title {
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 0.8rem;
  color: var(--text-color);
}

.featured-description {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.featured-meta img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.featured-meta-info {
  display: flex;
  flex-direction: column;
}

.featured-author {
  font-weight: bold;
  color: var(--text-color);
  font-size: 0.8rem;
}

.featured-date {
  font-size: 0.8rem;
  color: #888;
}

/* GRID ARTICLES */
.container {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

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

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

.card .category {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--muted-text);
  padding: 0.8rem 1rem 0 1rem;
  text-transform: uppercase;
}

.card h2 {
  font-size: 1.1rem;
  margin: 0.4rem 1rem;
}

.card p {
  font-size: 0.95rem;
  margin: 0.5rem 1rem 1rem;
  color: var(--muted-text);
}

.read-more {
  color: var(--primary-color);
  font-weight: bold;
  margin: 0 1rem 1rem;
  text-decoration: none;
  display: inline-block;
}

.read-more:hover {
  text-decoration: underline;
  color: #003acc;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted-text);
  border-top: 1px solid var(--border-color);
  padding: 1rem;
}

.footer-meta img {
  border-radius: 50%;
  width: 24px;
  height: 24px;
}

/* FOOTER */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

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

.footer-section h3 {
  color: var(--text-color);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

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

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  color: var(--muted-text);
  font-size: 1.5rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
  color: var(--primary-color);
  transform: translateY(-3px);
}

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

/* Mobile Menu Styles */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  visibility: hidden;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .header-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .search-container {
    order: -1;
    max-width: 100%;
    width: 100%;
  }

  .search-box input {
    font-size: 16px; /* Évite le zoom sur iOS */
  }

  nav#mainNav {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  nav#mainNav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  nav#mainNav {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
  }

  nav#mainNav a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    white-space: nowrap;
    background: var(--card-bg);
    transition: all 0.3s ease;
  }

  nav#mainNav a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
  }

  nav#mainNav a.contact {
    background: var(--primary-color);
    color: white;
    border: none;
  }

  nav#mainNav a.contact:hover {
    background: var(--secondary-color);
  }

  .menu-overlay {
    display: none;
  }

  .container {
    margin: 2rem auto;
    gap: 1.5rem;
  }

  .featured-image {
    height: 250px;
  }

  .theme-toggle {
    bottom: 1rem;
    left: 1rem;
  }

  .footer-container {
    gap: 2rem;
  }

  .footer {
    padding: 3rem 0 1.5rem;
  }
}

/* Responsive Featured Article */
@media (max-width: 768px) {
  .featured-article {
    flex-direction: column;
  }

  .featured-image {
    width: 100%;
    height: 250px;
  }

  .featured-content {
    width: 100%;
    padding: 1.5rem;
  }

  .featured-title {
    font-size: 1.5rem;
  }
}

/* Responsive Grid Articles */
@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .article-card {
    max-width: 100%;
  }
}

/* Responsive Footer */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

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

  .footer-links {
    text-align: center;
  }
}

/* Responsive Theme Toggle and Back to Top */
@media (max-width: 768px) {
  .theme-toggle,
  .back-to-top {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
  }

  .back-to-top {
    bottom: 1rem;
    right: 4rem;
  }
}

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

  .featured-image {
    height: 300px;
  }
}

/* About Page Styles */
.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.about-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.about-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about-hero .subtitle {
    font-size: 1.2rem;
    color: var(--muted-text);
}

.about-section {
    margin-bottom: 4rem;
}

.about-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

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

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

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

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
}

.team-member h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.team-member p {
    color: var(--muted-text);
}

/* Contact Page Styles */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.contact-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.contact-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-hero .subtitle {
    font-size: 1.2rem;
    color: var(--muted-text);
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.info-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Contact Form Styles */
.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.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(37, 99, 235, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted-text);
}

.error-message {
    display: none;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #ef4444;
}

.form-group.error .error-message {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.submit-btn,
.reset-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

.submit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.reset-btn {
    background: var(--background-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.reset-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

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

    .form-actions {
        flex-direction: column;
    }

    .submit-btn,
    .reset-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-info {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .info-card {
        min-width: 200px;
    }

    .about-hero h1,
    .contact-hero h1 {
        font-size: 2rem;
    }
}

/* Resources Page Styles */
.resources-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.resources-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.resources-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.resources-hero .subtitle {
    font-size: 1.2rem;
    color: var(--muted-text);
}

.resources-grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 4rem;
}

.resource-category h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-category h2 i {
    color: var(--primary-color);
}

.resource-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

.resource-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.resource-icon i {
    font-size: 1.8rem;
    color: white;
}

.resource-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.resource-card p {
    color: var(--muted-text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.resource-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.resource-tag:not(:empty) {
    background: var(--primary-color);
    color: white;
}

/* Newsletter Section */
.resources-newsletter {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.newsletter-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.newsletter-content p {
    color: var(--muted-text);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 1rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.newsletter-form button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .resource-cards {
        grid-template-columns: 1fr;
    }

    .resources-hero h1 {
        font-size: 2rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }
}

/* PAGINATION STYLES */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.pagination nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    color: var(--muted-text);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--card-bg);
    transition: all 0.2s ease;
    min-width: 2.5rem;
    height: 2.5rem;
}

.pagination .page-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination .page-item.disabled .page-link:hover {
    color: var(--border-color);
    border-color: var(--border-color);
    background-color: var(--card-bg);
}

/* Loading states */
.card img {
    background: var(--border-color);
    transition: opacity 0.3s ease;
}

.card img.lazy {
    opacity: 0.7;
}

/* Improved animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

/* Focus states for accessibility */
.card:focus-within,
.read-more:focus,
.page-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* READING MODE */
.reading-controls {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.reading-controls:hover {
    opacity: 1;
}

.reading-control-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.reading-control-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.reading-control-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reading-progress.visible {
    opacity: 1;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 0 2px 2px 0;
}

/* Focus Mode */
body.focus-mode {
    background: var(--card-bg);
}

body.focus-mode header,
body.focus-mode footer,
body.focus-mode .reactions-widget,
body.focus-mode .related-articles,
body.focus-mode .comments-section,
body.focus-mode .article-footer {
    opacity: 0.3;
    pointer-events: none;
    transition: all 0.3s ease;
}

body.focus-mode .article-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.focus-mode .article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Font Size Controls */
.font-size-small { font-size: 0.9rem !important; }
.font-size-normal { font-size: 1rem !important; }
.font-size-large { font-size: 1.1rem !important; }
.font-size-xlarge { font-size: 1.2rem !important; }

/* Reading Time Estimate */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-text);
    font-size: 0.9rem;
    margin-left: 1rem;
}

.reading-time i {
    color: var(--primary-color);
}

/* Table of Contents */
.toc {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    max-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--card-shadow);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toc.visible {
    opacity: 1;
    visibility: visible;
}

.toc h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--muted-text);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

/* Mobile adaptations */
@media (max-width: 768px) {
    .reading-controls {
        right: 10px;
        gap: 0.3rem;
    }
    
    .reading-control-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .toc {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 80px;
        transform: none;
        max-width: none;
        max-height: 250px;
    }
    
    body.focus-mode .article-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .reading-time {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Print styles for reading mode */
@media print {
    .reading-controls,
    .reading-progress,
    .toc,
    header,
    footer,
    .reactions-widget,
    .comments-section,
    .article-footer {
        display: none !important;
    }
    
    .article-container {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
}

/* COMMENTS SYSTEM */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.comments-header h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-header i {
    color: var(--primary-color);
}

.comments-stats {
    color: var(--muted-text);
    font-size: 0.9rem;
}

/* Comment Form */
.comment-form-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.comment-form-container h4 {
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
}

.comment-form .form-group {
    margin-bottom: 1.5rem;
}

.comment-form label {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.comment-form textarea,
.comment-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.comment-form textarea:focus,
.comment-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.char-counter {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted-text);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1.5rem;
}

.form-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--muted-text);
    font-size: 0.85rem;
    flex: 1;
    margin-right: 1rem;
}

.form-info i {
    color: var(--primary-color);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-submit:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Comment Messages */
.comment-messages {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.comment-messages.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.comment-messages.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Comments List */
.comments-loading {
    text-align: center;
    padding: 2rem;
    color: var(--muted-text);
}

.comments-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.no-comments {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--muted-text);
}

.no-comments i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.no-comments p {
    margin: 0.5rem 0;
}

/* Individual Comment */
.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.comment:hover {
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow);
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar i {
    font-size: 2.5rem;
    color: var(--muted-text);
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--muted-text);
}

.comment-actions-menu {
    position: relative;
}

.comment-menu-btn {
    background: none;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-menu-btn:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.comment-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-width: 120px;
}

.comment-menu button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.comment-menu button:hover {
    background: var(--border-color);
}

.comment-text {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.comment-action {
    background: none;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.comment-action:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.comment-action.liked {
    color: var(--primary-color);
}

/* Reply Form */
.reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.comment-reply-form textarea {
    min-height: 80px;
    margin-bottom: 1rem;
}

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

.reply-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-cancel,
.btn-reply {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: var(--border-color);
    color: var(--text-color);
}

.btn-cancel:hover {
    background: var(--muted-text);
}

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

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

/* Nested Replies */
.comment-replies {
    margin-top: 1rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1rem;
}

.comment-replies .comment {
    margin-bottom: 1rem;
}

/* Report Modal */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.report-modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.report-modal-header h4 {
    margin: 0;
    color: var(--text-color);
}

.close-modal {
    background: none;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.radio-option:hover {
    background: var(--border-color);
}

.radio-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.btn-report {
    background: #ef4444;
    color: white;
}

.btn-report:hover {
    background: #dc2626;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comment-form-container {
        padding: 1.5rem;
    }
    
    .form-row,
    .reply-form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .form-info {
        margin-right: 0;
    }
    
    .comment {
        padding: 1rem;
    }
    
    .comment-avatar i {
        font-size: 2rem;
    }
    
    .comment-actions {
        flex-wrap: wrap;
    }
    
    .report-modal-content {
        padding: 1.5rem;
    }
} 