/**
 * TechFlash.fr - Fichier CSS Principal
 * Version 1.0
 */

/* ===== Variables ===== */
:root {
  /* Couleurs principales */
  --primary-color: #0D47A1;
  --secondary-color: #00BFA5;
  --dark-color: #212121;
  --light-color: #f8f9fa;
  --grey-color: #f0f2f5;
  --text-color: #333333;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  
  /* Couleurs de marque */
  --facebook-color: #3b5998;
  --twitter-color: #1da1f2;
  --instagram-color: #e1306c;
  --youtube-color: #ff0000;
  
  /* Police */
  --font-primary: 'Roboto', sans-serif;
  --font-headings: 'Montserrat', sans-serif;
  
  /* Ombres */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  /* Transitions */
  --transition: all 0.3s ease;
  
  /* Arrondis */
  --border-radius-sm: 0.25rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: #FFFFFF;
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

img {
  max-width: 100%;
  height: auto;
}

button, .btn {
  transition: var(--transition);
}

/* ===== Utilities ===== */
.section-title {
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
}

.section-title.with-line::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
}

.widget-title {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.widget-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 50px;
  height: 2px;
  background-color: var(--primary-color);
}

/* ===== Header ===== */
.site-header {
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
}

.logo {
  display: inline-block;
  max-width: 200px;
}

.navbar {
  padding: 0;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 1rem 1.25rem;
  color: var(--text-color);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color);
}

.dropdown-menu {
  border-radius: var(--border-radius-sm);
  padding: 0.5rem;
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(13, 71, 161, 0.1);
  color: var(--primary-color);
}

.search-form {
  position: relative;
}

.search-form .form-control {
  border-radius: 50px;
  padding-right: 45px;
  border: 1px solid var(--border-color);
  background-color: var(--light-color);
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  z-index: 5;
}

.search-btn:hover {
  color: var(--primary-color);
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-color);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}


.theme-toggle .light-icon {
  display: none;
}

.theme-toggle .dark-icon {
  display: inline-block;
}

/* ===== Hero Section ===== */
.hero-section {
  padding: 2rem 0;
}

.carousel-item {
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 400px;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  text-align: left;
}

.carousel-caption h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}

.article-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.article-meta .date,
.article-meta .views,
.article-meta .category {
  margin-right: 1rem;
}

/* Popular Articles Sidebar */
.popular-articles-sidebar {
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  height: 100%;
}

.popular-article-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.popular-article-item:last-child {
  border-bottom: none;
}

.popular-article-index {
  width: 30px;
  height: 30px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 1rem;
  flex-shrink: 0;
}

.popular-article-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ===== Articles Section ===== */
.articles-filters {
  margin-bottom: 2rem;
}

.article-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 100%;
  transition: var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.article-image {
  display: block;
  position: relative;
  overflow: hidden;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.article-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-image:hover img {
  transform: scale(1.05);
}

.article-image .category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
}

.article-content {
  padding: 1.25rem;
}

.article-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.4;
}

.article-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
}

.read-more i {
  margin-left: 0.25rem;
  transition: transform 0.3s ease;
}

.read-more:hover i {
  transform: translateX(5px);
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky;
  top: 20px;
}

.sidebar-widget {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Survey Widget */
.survey-container {
  margin-top: 1rem;
}

.survey-question h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.survey-result-item {
  margin-bottom: 0.75rem;
}

.progress {
  height: 0.5rem;
  background-color: var(--border-color);
}

.progress-bar {
  background-color: var(--primary-color);
}

/* Categories Widget */
.categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.categories-list li {
  margin-bottom: 0.5rem;
}

.categories-list a {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.categories-list a:hover {
  color: var(--primary-color);
}

.categories-list .count {
  background-color: var(--light-color);
  color: var(--text-muted);
  padding: 0.1rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
}

/* Tags Widget */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--light-color);
  color: var(--text-color);
  font-size: 0.75rem;
  border-radius: 50px;
}

.tag-item:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ===== Category Showcase ===== */
.category-block {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  height: 100%;
}

.category-featured-article {
  margin-bottom: 1.5rem;
}

.category-article-image {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
}

.category-article-image img {
  width: 100%;
  transition: transform 0.5s ease;
}

.category-article-image:hover img {
  transform: scale(1.05);
}

.category-article-item h4 {
  font-size: 0.9rem;
  margin: 0.5rem 0 0.25rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ===== Subscription Section ===== */
.subscription-section {
  padding: 3rem 0;
}

.subscription-box {
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.subscription-box h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.subscription-form .form-check-label a {
  color: white;
  text-decoration: underline;
}

/* ===== Footer ===== */
.site-footer {
  background-color: var(--dark-color);
  color: #fff;
  padding-top: 3rem;
}

.footer-heading {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.newsletter-container {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: #fff;
  padding-left: 5px;
}

.footer-latest-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-latest-posts li {
  margin-bottom: 1rem;
}

.footer-latest-posts a {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  margin-bottom: 0.25rem;
}

.footer-latest-posts a:hover {
  color: #fff;
}

.footer-latest-posts .post-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.footer-legal {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.5rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

.footer-legal a:hover {
  color: #fff;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-5px);
}

/* ===== Ad Containers ===== */
.ad-container {
  margin: 1.5rem 0;
  text-align: center;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
}

.ad-horizontal {
  height: 90px;
}

.ad-in-feed {
  min-height: 280px;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
  
  .carousel-item {
    height: 350px;
  }
  
  .carousel-caption h2 {
    font-size: 1.5rem;
  }
  
  .sidebar {
    margin-top: 2rem;
    position: static;
  }
}

@media (max-width: 767.98px) {
  .carousel-item {
    height: 300px;
  }
  
  .carousel-caption h2 {
    font-size: 1.25rem;
  }
  
  .popular-articles-sidebar {
    margin-top: 1.5rem;
  }
  
  .footer-heading {
    margin-top: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .carousel-item {
    height: 250px;
  }
  
  .carousel-caption {
    padding: 1rem;
  }
  
  .carousel-caption h2 {
    font-size: 1.1rem;
  }
  
  .article-title {
    font-size: 1.1rem;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}

/* Styles pour les liens d'affiliation */
.article-body a[rel*="sponsored"] {
    color: #007bff;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    padding-right: 16px;
}

.article-body a[rel*="sponsored"]:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Indicateur visuel pour les liens d'affiliation */
.article-body a[rel*="sponsored"]::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007bff"><path d="M19.9 12.6c.1-.1.1-.1.1-.2v-.6L16.2 2c-.2-.6-.8-1-1.4-1h-5.6c-.6 0-1.2.4-1.4 1L4 11.8v.6c0 .1 0 .2.1.2l7.9 9.3c.2.2.4.1.6 0l7.3-9.3zM12 17c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    opacity: 0.7;
}

/* Message d'information sur les liens d'affiliation */
.affiliation-disclaimer {
    margin: 2rem 0;
    padding: 0.8rem 1rem;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Animation de transition au survol */
.article-body a[rel*="sponsored"]:hover::after {
    opacity: 1;
}