:root {
  --bg-color: #000000;
  --text-color: #e0e0e0;
  --text-color-secondary: #888;
  --card-bg: #0a0a0a;
  --card-border: #ffffff20;
  --card-shadow: rgba(255, 255, 255, 0.05);
  --card-hover-shadow: rgba(255, 255, 255, 0.1);
  --input-bg: #1a1a1a;
  --input-border: #ffffff30;
  --hover-bg: #2a2a2a;
  --separator-color: #ffffff20;
  --modal-bg: #1a1a1a;
  --menu-bg: rgba(26, 26, 26, 0.85);
  --svg-fill: #e0e0e0;
  --svg-fill-secondary: #666;
  --highlight-color: #f7dc46;
  
  /* Variables pour l'animation du logo */
  --target-x: 50vw;
  --target-y: 50vh;
  
  /* OPTIMISATION : Variables d'animation simplifiées pour Safari */
  --animation-duration-fast: 0.2s;
  --animation-duration-medium: 0.3s;
  --animation-easing: ease;
}

/* Suppression du préchargement d'animations - économie de ressources */

body.light-theme {
  --bg-color: #f0f2f5;
  --text-color: #1c1c1e;
  --text-color-secondary: #6e6e73;
  --card-bg: #ffffff;
  --card-border: #0000001a;
  --card-shadow: rgba(0, 0, 0, 0.05);
  --card-hover-shadow: rgba(0, 0, 0, 0.1);
  --input-bg: #e9e9eb;
  --input-border: #00000020;
  --hover-bg: #e5e5e5;
  --separator-color: #0000001a;
  --modal-bg: #fdfdfd;
  --menu-bg: rgba(255, 255, 255, 0.85);
  --svg-fill: #1c1c1e;
  --svg-fill-secondary: #888;
  --highlight-color: #1d4ed8; 
}

/* GENERAL STYLES */
html, body {
  overscroll-behavior-x: none;
}

/* === STARTUP ANIMATION REMOVED FOR APP STORE COMPLIANCE === */

html {
  font-size: 100%; 
}
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100vh;
  /* OPTIMISATION : Transition simplifiée */
  transition: background-color 0.2s, color 0.2s;
  box-sizing: border-box;
}

/* LOADING OVERLAY */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  /* OPTIMISATION : Transition simplifiée */
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
}

.octagon-loader {
  width: 80px;
  height: 80px;
  position: relative;
}

.octagon-shape {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 4px solid #f7dc46;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  /* OPTIMISATION : Animation simplifiée */
  animation: wrenchTurn 1s ease-in-out infinite;
  transform-origin: center;
  position: relative;
}

/* OPTIMISATION : Suppression du contour interne pour économiser les ressources */

@keyframes wrenchTurn {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(90deg);
  }
  50% {
    transform: rotate(90deg);
  }
  75% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.loading-text {
  font-size: 1.1rem;
  color: var(--text-color);
  font-weight: 500;
  text-align: center;
  margin: 0;
}

/* OPTIMISATION : Remettre le backdrop-filter pour l'effet visuel */
.mini-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mini-loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.mini-octagon-loader {
  width: 50px;
  height: 50px;
  position: relative;
}

.mini-octagon-shape {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 3px solid #f7dc46;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  animation: wrenchTurn 1s ease-in-out infinite;
  transform-origin: center;
}

/* Assurer que les pages ont une position relative pour les loaders */
.page {
  position: relative;
}

/* Force la transparence de la zone de la barre système */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 0px);
  background: transparent;
  z-index: -1;
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body.no-scroll {
    overflow: hidden;
}

.main-wrapper {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  /* OPTIMISATION : Maintenir l'accélération GPU pour le scroll */
  will-change: scroll-position;
  transform: translateZ(0);
}

.main-wrapper.is-dragging, 
.main-wrapper.is-dragging #pages,
.main-wrapper.is-dragging #pull-to-refresh-indicator {
    transition: none !important;
}

#pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 0;
}
.ptr-arrow, .ptr-spinner {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    fill: var(--text-color-secondary);
}
.ptr-arrow {
    transform: rotate(0deg);
}
.ptr-arrow.rotated {
    transform: rotate(180deg);
}
.ptr-spinner {
    display: none;
    animation: spin 1s linear infinite;
}
#pull-to-refresh-indicator.refreshing .ptr-arrow {
    display: none;
}
#pull-to-refresh-indicator.refreshing .ptr-spinner {
    display: block;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


.container {
  max-width: 1000px;
  margin: auto;
  padding: 2rem 1rem;
  position: relative;
  /* Protection supplémentaire pour les appareils Android avec barres de navigation */
  padding-top: max(2rem, env(safe-area-inset-top, 0px) + 1rem);
  min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

/* --- SEARCH AND DROPDOWN MENU --- */
#search-section { margin-bottom: 2rem; }
#search-bar-wrapper { position: relative; flex: 1; min-width: 0; }
#controls-container { 
  display: flex; 
  gap: 0.75rem; 
  align-items: center; 
  justify-content: space-between; /* Répartit mieux l'espace entre les éléments */
}
#banner-image { 
    height: 70px; /* Agrandi à 140% (50px * 1.4 = 70px) */
    width: auto; 
    border-radius: 8px; 
    flex-shrink: 0; 
    object-fit: contain;
    margin-left: auto; /* Pousse l'image vers la droite pour éviter le chevauchement */
}
#custom-select-wrapper { position: relative; flex-shrink: 0; }

/* Mini loader pour les changements de sport */
.mini-sport-loader {
  position: absolute;
  top: 50%;
  right: 40px; /* Positionné à côté de la flèche */
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
}

.mini-sport-loader.visible {
  opacity: 1;
  visibility: visible;
}

.mini-octagon-shape {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 2px solid #f7dc46;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  animation: miniWrenchTurn 0.8s ease-in-out infinite;
  transform-origin: center;
}

@keyframes miniWrenchTurn {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(90deg); }
  75% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

#custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 50px;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 160px;
}
#custom-select-trigger:hover { background-color: var(--hover-bg); }
#custom-select-value { font-weight: 500; }
#custom-select-arrow {
    width: 16px;
    height: 16px;
    fill: var(--text-color);
    transition: transform 0.3s ease;
}
#custom-select-wrapper.open #custom-select-arrow { transform: rotate(180deg); }
#custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    z-index: 1101;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
#custom-select-wrapper.open #custom-select-options { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-select-option {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}
.custom-select-option:hover { background-color: var(--hover-bg); }
.custom-select-option:not(:last-child) { border-bottom: 1px solid var(--separator-color); }
#search-input {
  width: 100%; /* Rallongé à 120% */
  padding: 0.8rem 1.5rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 50px;
  color: var(--text-color);
  font-size: 1rem;
  flex-grow: 1;
}
#suggestions-container {
  position: absolute;
  top: calc(100% + 8px); /* Espacement comme le menu des sports */
  left: 0; 
  right: 0;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px; /* Arrondi comme le menu des sports */
  max-height: 250px;
  overflow-y: auto;
  z-index: 1100;
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Légère ombre pour la profondeur */
}

/* Classe pour montrer les suggestions avec animation */
#suggestions-container.show {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.2rem; /* Padding identique au menu des sports */
  cursor: pointer;
  color: var(--text-color);
  transition: background-color 0.2s;
  font-weight: 500; /* Police identique au menu des sports */
}

.suggestion-item:hover { 
  background-color: var(--hover-bg); 
}

.suggestion-item:not(:last-child) { 
  border-bottom: 1px solid var(--separator-color); /* Séparateurs comme le menu des sports */
}

.recent-search .recent-icon { 
    font-size: 0.9rem; 
    opacity: 0.7; 
    margin-right: 0.5rem; 
}
#active-tags-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.75rem; 
    margin-top: 1rem;
    max-height: calc(2.4rem * 2 + 0.75rem); /* Hauteur pour 2 lignes de tags + gap */
    overflow: hidden;
    position: relative;
}
.active-tag {
  display: flex;
  align-items: center;
  background: #667eea;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  /* OPTIMISATION : Transition simplifiée pour Safari */
  transition: transform 0.2s ease;
  border: none;
  position: relative;
}

.active-tag:hover {
  transform: translateY(-1px);
}

.active-tag:active {
  transform: translateY(0);
}

.active-tag .close-tag { 
  display: none;
}

.active-tag .tag-text {
  margin-right: 0.5rem;
}

.active-tag .tag-close {
  font-size: 1.1rem;
  font-weight: bold;
  opacity: 0.8;
}

/* --- PAGE SWIPE --- */
#page-container { overflow: hidden; position: relative; width: 100%; }
#pages { 
  display: flex; 
  width: 300%; 
  /* OPTIMISATION : Transition simplifiée pour Safari */
  transition: transform 0.3s ease; 
  position: relative; 
  z-index: 1; 
}
.page { width: calc(100% / 3); flex-shrink: 0; box-sizing: border-box; padding: 0 5px; min-height: 50vh; }

/* --- SETTINGS PAGE --- */
#settings-page {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 1.5rem;
}
.settings-title { color: var(--text-color); font-size: 1.8rem; font-weight: bold; margin-bottom: 2rem; padding-left: 0.5rem; }
.settings-group {
    background-color: var(--input-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--input-border);
    margin-bottom: 1.5rem;
}
.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.settings-option:not(:first-child) { border-top: 1px solid var(--separator-color); }
.settings-option-label:hover { background-color: var(--hover-bg); }
.settings-option-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.settings-option-text span:first-child { color: var(--text-color); font-weight: 500; font-size: 1rem; }
.settings-option-text span:last-child { color: var(--text-color-secondary); font-size: 0.9rem; margin-top: 2px; }
.settings-arrow { width: 20px; height: 20px; fill: var(--text-color-secondary); transition: transform 0.3s ease; }
.settings-arrow.open { transform: rotate(90deg); }

/* --- Toggle Switch --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--hover-bg);
  transition: .4s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #2563eb;
}
input:checked + .slider:before {
  transform: translateX(22px);
}
input:disabled + .slider {
  cursor: not-allowed;
  opacity: 0.6;
}

#notification-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    border-top: 1px solid transparent; 
}
#notification-submenu.open {
    max-height: 500px; /* Increased for tennis */
    border-top-color: var(--separator-color);
    overflow-y: auto;
}
#notification-submenu .settings-option {
  padding-left: 1.2rem; 
}

/* --- ARTICLE CARDS --- */
.articles { 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem; 
  padding-bottom: 120px; 
  margin-top: 8px;
  /* OPTIMISATION : Simplification pour Safari */
  contain: layout;
}
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 4px var(--card-shadow);
  cursor: pointer;
  /* OPTIMISATION : Transition simplifiée pour Safari */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  /* Effet d'apparition initial */
  opacity: 0;
  animation: cardFadeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Conteneurs d'articles cachés pendant le chargement */
.articles.loading {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.articles.loaded {
  opacity: 1;
}

/* Animation d'apparition des cartes avec effet de rebond */
@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Délai progressif pour l'apparition des articles */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.3s; }
.card:nth-child(6) { animation-delay: 0.35s; }
.card:nth-child(7) { animation-delay: 0.4s; }
.card:nth-child(8) { animation-delay: 0.45s; }
.card:nth-child(9) { animation-delay: 0.5s; }
.card:nth-child(10) { animation-delay: 0.55s; }

/* Pour les articles suivants, on limite le délai */
.card:nth-child(n+11) { animation-delay: 0.6s; }

.card:hover { 
  /* OPTIMISATION : Hover simplifié pour Safari */
  transform: translateY(-2px); 
  box-shadow: 0 4px 8px var(--card-hover-shadow); 
}
.hot-news-label { 
  background: #ef4444; 
  color: white; 
  font-weight: bold; 
  padding: 0.3rem 0.75rem; 
  border-radius: 12px 12px 0 0; 
  text-align: center; 
  font-size: 0.8rem; 
  text-transform: uppercase; 
  margin: -1rem -1rem 1rem -1rem; 
}
.featured-label { 
  background: #fbbf24; 
  color: white; 
  font-weight: bold; 
  padding: 0.3rem 0.75rem; 
  border-radius: 12px 12px 0 0; 
  text-align: center; 
  font-size: 0.8rem; 
  text-transform: uppercase; 
  margin: -1rem -1rem 0.5rem -1rem; 
}
/* Ajustement quand featured et hot-news sont tous les deux présents */
.featured-label + .hot-news-label { margin-top: 0; border-radius: 0 0 0 0; }

/* Nouveau style pour le label groupé des articles à la une */
.featured-section-header {
    margin: 0.5rem 0 1.5rem 0; /* Réduit encore le margin-top de 0.8rem à 0.5rem */
    padding: 0;
    position: relative;
    z-index: 1; /* Assure que le header reste au-dessus des articles */
}

.featured-group-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fbbf24;
    color: white;
    font-weight: bold;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    /* OPTIMISATION : Transition simplifiée */
    transition: transform 0.2s ease;
    user-select: none;
}

.featured-group-label:hover {
    transform: translateY(-1px);
}

.featured-icon {
    font-size: 1.2rem;
}

.featured-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.featured-arrow {
    font-size: 0.8rem;
    margin-left: auto;
    /* OPTIMISATION : Suppression de l'animation complexe */
}

/* Conteneur des articles à la une avec animation optimisée */
/* === ARTICLES À LA UNE - AFFICHAGE 2 LIGNES AVEC NAVIGATION === */
.featured-articles-container {
    /* OPTIMISATION : Transitions simplifiées pour Safari */
    transition: height 0.25s ease, opacity 0.2s ease;
    opacity: 1;
    margin-bottom: 1.5rem;
    position: relative;
    display: block;
    padding: 0.5rem 0 1rem 0;
    /* OPTIMISATION : Réduction pour Safari */
    contain: layout;
    touch-action: pan-y;
}

/* Conteneur scrollable pour les articles */
.featured-articles-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-auto-flow: column;
    grid-auto-columns: 250px; /* Taille fixe pour toutes les cartes */
    gap: 1.2rem; /* Légèrement plus d'espace entre les articles */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 0.5rem;
    justify-content: start; /* Par défaut, sera ajusté par JavaScript */
    /* Masquer la barre de scroll sur PC */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Masquer la barre de scroll pour WebKit (Chrome, Safari) */
.featured-articles-grid::-webkit-scrollbar {
    display: none;
}

/* Adaptation pour 1 seul article - style carte normale centrée */
.featured-articles-grid.single-article {
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: 250px; /* Même taille que les autres cartes */
    overflow: visible;
    justify-content: center; /* Centre la carte */
}

.featured-articles-grid.single-article .featured-article {
    border: 2px solid rgba(251, 191, 36, 0.5); /* Bordure dorée distinctive */
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(245, 158, 11, 0.05)); /* Même background que les autres */
    width: 250px; /* Même largeur que les autres cartes */
    height: 200px; /* Même hauteur que les autres cartes */
    padding: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.featured-articles-grid.single-article .featured-article:hover {
    border-color: rgba(251, 191, 36, 0.7); /* Bordure dorée plus intense au hover */
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2); /* Ombre dorée */
    transform: translateY(-2px);
}

.featured-articles-grid.single-article .featured-article .card-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.featured-articles-grid.single-article .featured-article .player-image {
    width: 100%;
    height: 50%;
    object-fit: cover;
    object-position: center 25%;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.featured-articles-grid.single-article .featured-article .card-text {
    flex: 1;
    min-width: 0;
    height: 50%;
    padding: 0.6rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 0 0 8px 8px;
    box-sizing: border-box;
}

.featured-articles-grid.single-article .featured-article .title {
    font-size: 0.9rem;
    line-height: 1.3;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    margin: 0 0 0.3rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.featured-articles-grid.single-article .featured-article .card-date {
    font-size: 0.8rem;
    margin: 0;
    color: var(--text-color-secondary);
}

/* Limitation de la hauteur sur petits écrans pour les articles uniques */
@media (max-width: 768px) {
    .featured-articles-grid.single-article {
        grid-auto-columns: minmax(200px, 250px);
    }
    
    .featured-articles-grid.single-article .featured-article {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .featured-articles-grid.single-article {
        grid-auto-columns: minmax(180px, 220px);
    }
    
    .featured-articles-grid.single-article .featured-article {
        width: 100%;
        max-width: 220px;
        height: 180px;
    }
    
    .featured-articles-grid.single-article .featured-article .title {
        font-size: 0.85rem;
    }
    
    .featured-articles-grid.single-article .featured-article .card-date {
        font-size: 0.75rem;
    }
}

/* Adaptation pour 2-3 articles - une seule ligne */
.featured-articles-grid.single-row {
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    justify-content: center; /* Centre les articles s'il n'y en a pas assez */
}

/* Flèches de navigation */
.featured-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; /* Augmenté de 40px à 50px */
    height: 50px; /* Augmenté de 40px à 50px */
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex; /* Flèches affichées */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.featured-nav-arrow:hover {
    background: var(--hover-bg);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.featured-nav-arrow.left {
    left: 10px;
}

.featured-nav-arrow.right {
    right: 10px;
}

.featured-nav-arrow svg {
    width: 24px; /* Augmenté de 20px à 24px */
    height: 24px; /* Augmenté de 20px à 24px */
    fill: var(--text-color);
}

.featured-nav-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive pour les flèches */
@media (max-width: 768px) {
    .featured-nav-arrow {
        width: 42px; /* Augmenté de 35px à 42px */
        height: 42px; /* Augmenté de 35px à 42px */
    }
    
    .featured-nav-arrow.left {
        left: 5px;
    }
    
    .featured-nav-arrow.right {
        right: 5px;
    }
    
    .featured-nav-arrow svg {
        width: 18px; /* Augmenté de 16px à 18px */
        height: 18px; /* Augmenté de 16px à 18px */
    }
    
    .featured-articles-grid {
        grid-auto-columns: 220px; /* Taille légèrement réduite pour mobile */
        gap: 1rem;
        overflow-x: auto; /* Scroll activé sur mobile */
        /* Masquer la barre de scroll sur mobile aussi */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    /* Masquer la barre de scroll WebKit sur mobile */
    .featured-articles-grid::-webkit-scrollbar {
        display: none;
    }
    
    .featured-article {
        width: 220px;
        height: 180px; /* Légèrement plus petit sur mobile */
    }
    
    .featured-article .player-image {
        width: 100% !important; /* Force la largeur complète */
        height: 50% !important; /* Force la hauteur à 50% */
        object-fit: cover;
        object-position: center 25%;
    }
}

/* Règle spécifique pour les très petites fenêtres */
@media (max-width: 480px) {
    .featured-articles-grid {
        grid-auto-columns: 200px; /* Encore plus petit pour très petites fenêtres */
        gap: 0.8rem;
        overflow-x: auto; /* Scroll sur très petites fenêtres */
    }
    
    .featured-article {
        width: 200px;
        height: 160px;
    }
    
    .featured-article .player-image {
        width: 100% !important;
        height: 50% !important;
        object-fit: cover;
        object-position: center 25%;
        border-radius: 8px 8px 0 0;
    }
    
    .featured-article .card-content {
        height: 100% !important;
    }
}.featured-articles-container.collapsed {
    height: 0 !important;
    opacity: 0;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
}

/* Espacement spécifique pour les articles à la une */
.featured-articles-container .featured-article {
    margin: 0;
    width: 100%;
}

/* Assurer qu'il y a un espace après la section des articles à la une */
.featured-section-header + .featured-articles-container {
    margin-top: 0;
    padding-top: 0.5rem; /* Ajoute un padding pour éviter la superposition lors du hover */
}

/* Style pour les articles à la une - Format adaptatif */
.featured-article {
    border: 2px solid rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(245, 158, 11, 0.05));
    width: 250px;
    height: 200px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    /* OPTIMISATION : Transition simplifiée */
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.featured-article:hover {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
    /* OPTIMISATION : Hover simplifié */
    transform: translateY(-1px);
}

/* Layout des cards - Optimisé pour grille 2 lignes */
.featured-article .card-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.featured-article .player-image {
    width: 100%;
    height: 50%;
    object-fit: cover;
    object-position: center 25%;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.featured-article .card-text {
    flex: 1;
    min-width: 0;
    height: 50%;
    padding: 0.6rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 0 0 8px 8px;
    box-sizing: border-box;
}

.featured-article .title {
    font-size: 0.85rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
    flex: 1;
}

.featured-article .card-date {
    font-size: 0.75rem;
    margin: 0;
    color: var(--text-color-secondary);
    flex-shrink: 0;
    line-height: 1.1;
}

.featured-article .keywords-list {
    margin-top: 0.5rem;
}

.featured-article .keywords-list .keyword {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Responsive pour très petits écrans */
@media (max-width: 600px) {
    .featured-article .player-image {
        width: 80px;
        height: 80px;
    }
    
    .featured-article .title {
        font-size: 0.9rem;
    }
    
    .featured-article .card-date {
        font-size: 0.8rem;
    }
    
    .featured-article .keywords-list .keyword {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
    }
    
    /* Les articles uniques gardent le format standard de carte */
    .featured-articles-grid.single-article .featured-article .player-image {
        width: 100%;
        height: 50%;
    }
    
    .featured-articles-grid.single-article .featured-article .title {
        font-size: 0.85rem;
    }
    
    .featured-articles-grid.single-article .featured-article .card-date {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .featured-article .player-image {
        width: 70px;
        height: 70px;
    }
    
    .featured-article .title {
        font-size: 0.85rem;
    }
    
    .featured-articles-grid {
        grid-auto-columns: minmax(200px, 1fr);
    }
    
    /* Les articles uniques continuent à utiliser le format carte standard */
    .featured-articles-grid.single-article .featured-article .player-image {
        width: 100%;
        height: 50%;
    }
}

/* Style pour les articles normaux (ni à la une ni chauds) - plus petits */
.normal-article {
    transform: scale(0.97);
    opacity: 0.92;
    /* OPTIMISATION : Transition simplifiée */
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.normal-article:hover {
    transform: scale(1) translateY(-2px);
    opacity: 1;
}

.normal-article .title {
    font-size: 1.15rem;
}

.normal-article .player-image {
    width: 90px;
    height: 90px;
}

.normal-article .card-content {
    gap: 0.8rem;
}
.card-content { display: flex; align-items: flex-start; gap: 1rem; }
.player-image { 
  width: 100px; 
  height: 100px; 
  object-fit: cover; 
  border-radius: 12px; 
  flex-shrink: 0; 
  background-color: var(--input-bg);
  /* OPTIMISATION : Simplification pour Safari */
}
.card-text { flex: 1; }
.title { color: var(--text-color); font-size: 1.2rem; font-weight: bold; }
.card-date { font-size: 0.8rem; color: var(--text-color-secondary); margin-top: 0.5rem; }
.keywords-list { 
    margin-top: 1rem; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    max-height: 2.3rem; /* Hauteur approximative pour une ligne de tags */
    overflow: hidden;
    position: relative;
}

.keywords-list.has-overflow::after {
    content: "...";
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid var(--input-border);
    z-index: 2;
    pointer-events: none;
}

.keywords-list.has-overflow::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px; /* Largeur approximative des points + marge */
    height: 100%;
    background: linear-gradient(to left, var(--card-bg) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}
.tag { display: flex; align-items: center; background-color: var(--input-bg); color: var(--text-color); padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.85rem; border: 1px solid var(--input-border); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.club-dot { background-color: #2563eb; } .joueur-dot { background-color: #059669; } .equipe-dot { background-color: #e11d48; } .pilote-dot { background-color: #f59e0b; } .cycliste-dot { background-color: #8b5cf6; } .autre-dot { background-color: #f97316; } .joueuse-dot { background-color: #ec4899; }

/* --- DETAIL VIEW (MODIFIED) --- */
#detail-view { 
  display: flex; flex-direction: column; align-items: center; 
  position: fixed; inset: 0; 
  background: var(--card-bg); 
  z-index: 1200; padding: 1rem; overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none; 
  /* OPTIMISATION : Transition simplifiée pour Safari */
  transition: opacity 0.3s ease;
}
#detail-view.visible { opacity: 1; pointer-events: auto; }
.back-arrow { font-size: 2.5rem; cursor: pointer; color: var(--svg-fill-secondary); padding-top: 1rem; text-align: center; width: 100%; transition: color 0.3s ease; }
.back-arrow:hover { color: var(--text-color); }
.detail-title { text-align: center; font-size: 1.8rem; font-weight: bold; margin: 1rem; color: var(--text-color); }
.detail-meta-container { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.detail-date { color: var(--text-color-secondary); font-size: 0.9rem; text-align: center; }

/* Style for view counter */
.detail-views { 
    color: var(--text-color-secondary); 
    font-size: 0.9rem; 
    display: flex; 
    align-items: center; 
    gap: 0.4rem; 
}
.detail-views svg {
    width: 18px;
    height: 18px;
    fill: var(--text-color-secondary);
}

.share-button {
    background: none; border: none; cursor: pointer; padding: 0.5rem;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s;
}
.share-button svg { fill: var(--svg-fill-secondary); width: 28px; height: 28px; transition: fill 0.3s ease; }
.share-button:hover { background-color: var(--hover-bg); }
.share-button:hover svg { fill: var(--text-color); }

.detail-main-area { display: flex; flex-direction: row; align-items: flex-start; gap: 2rem; width: 100%; max-width: 950px; padding: 1rem; }
#detail-image { width: 200px; height: 200px; object-fit: cover; border-radius: 12px; flex-shrink: 0; order: 2; }
#detail-tags { 
    justify-content: center; 
    margin: 1rem 0 1.5rem 0; 
    opacity: 0; 
    transform: translateY(20px); 
    /* OPTIMISATION : Transition simplifiée */
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: none !important;
    overflow: visible !important;
}

/* Désactiver les points de suspension dans la vue détaillée */
#detail-tags.has-overflow::after,
#detail-tags.has-overflow::before {
    display: none !important;
}

#detail-tags.visible { 
    opacity: 1; 
    transform: translateY(0); 
}
.detail-resume { 
    flex: 1; min-width: 0; opacity: 0; transform: translateY(30px); order: 1;
    /* OPTIMISATION : Transition simplifiée */
    transition: transform 0.3s ease, opacity 0.3s ease;
    background-color: var(--bg-color); 
    margin: 0; padding: 1.5rem; border-radius: 12px; line-height: 1.6; font-size: 1rem; 
    color: var(--text-color); box-shadow: 0 2px 8px var(--card-shadow); white-space: pre-wrap;
}
#detail-view.visible .detail-resume { transform: translateY(0); opacity: 1; }
.detail-source {
  width: 100%; max-width: 950px; box-sizing: border-box; margin-top: 1.5rem; padding: 0 1.5rem; 
  text-align: center; font-size: 0.8rem; opacity: 0.7;
}
.detail-source a { color: var(--text-color) !important; text-decoration: none; word-break: break-all; }
.detail-source a:hover { text-decoration: underline; }

/* Styles pour la section d'article similaire */
.similar-article-section {
  width: 100%;
  max-width: 950px;
  box-sizing: border-box;
  margin: 1.5rem 0;
  padding: 0 1.5rem;
}

.similar-article-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 1rem;
  text-align: left;
}

.similar-article-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.similar-article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--card-hover-shadow);
  border-color: var(--highlight-color);
}

.similar-article-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.similar-article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.similar-article-title-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-article-date {
  font-size: 0.85rem;
  color: var(--text-color-secondary);
  margin-bottom: 0.25rem;
}

.similar-article-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.similar-article-keywords .tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--hover-bg);
  border-radius: 6px;
  color: var(--text-color);
  border: 1px solid var(--card-border);
}

@media (max-width: 768px) {
  .similar-article-card {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .similar-article-image {
    width: 100%;
    height: 120px;
    align-self: center;
  }
  
  .similar-article-section {
    padding: 0 1rem;
  }
}
.highlight-club, .highlight-ecurie, .highlight-velo, .highlight-basket, .highlight-player { color: var(--highlight-color); font-weight: bold; }
@media (max-width: 768px) { 
    .detail-main-area { flex-direction: column; align-items: center; gap: 1rem; } 
    #detail-image { order: 1; margin-bottom: 1rem; width: 150px; height: 150px; } 
    .detail-resume { order: 2; }
}

/* Responsive design pour la bannière et la barre de recherche */
@media (max-width: 600px) {
    #banner-image {
        display: none; /* Masque la bannière sur les petits écrans */
    }
    
    #controls-container {
        gap: 0.5rem; /* Réduit l'espacement */
    }
    
    #search-bar-wrapper {
        flex: 1;
        min-width: 200px; /* Assure une taille minimale pour la barre de recherche */
    }
}

/* Gestion de l'affichage des tags avec limitation à 2 lignes */
#active-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    max-height: calc(2.4rem * 2 + 0.75rem); /* Hauteur pour 2 lignes de tags + gap */
    overflow: hidden;
    position: relative;
}

#active-tags-container.has-overflow::after {
    content: "...";
    position: absolute;
    bottom: 0;
    right: 0;
    background: #667eea;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2;
    cursor: default;
    pointer-events: none;
}

#active-tags-container.has-overflow::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px; /* Largeur approximative des points + marge */
    height: 100%;
    background: linear-gradient(to left, var(--bg-color) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}
.is-transitioning { visibility: hidden !important; }

/* --- FLOATING MENU --- */
.bottom-menu { 
    position: fixed; bottom: calc(env(safe-area-inset-bottom) + 1rem); left: 50%; transform: translateX(-50%); 
    width: clamp(220px, 60vw, 280px); 
    background-color: var(--menu-bg); 
    /* OPTIMISATION : Réduction du backdrop-filter pour Safari */
    border: 1px solid var(--input-border); 
    border-radius: 50px; display: flex; justify-content: space-around; padding: 0.5rem; z-index: 500; 
}
.menu-button { background-color: transparent; border: 2px solid transparent; color: var(--text-color); padding: 0; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s, border-color 0.2s; position: relative; }
.menu-button:hover { background-color: var(--hover-bg); }
.menu-button.active { border-color: #2563eb; }
.menu-button svg { width: 24px; height: 24px; fill: var(--svg-fill); }

/* Styles removed for App Store compliance - logos disabled */

/* --- SELECTION MODAL & FONT SIZE --- */
.modal-overlay { 
  position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.7); 
  /* OPTIMISATION : Suppression du backdrop-filter pour Safari */
  z-index: 1000; display: flex; justify-content: center; align-items: center; 
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease; 
  padding: 20px; /* Ajout de padding pour éviter le découpage */
}
.modal-overlay.visible { 
  opacity: 1; 
  visibility: visible; 
}
.modal-content { 
  background-color: var(--modal-bg); border-radius: 16px; border: 1px solid var(--input-border); 
  width: 90%; max-width: 600px; display: flex; flex-direction: column; overflow: hidden; 
  transform: scale(0.95); transition: transform 0.2s ease; max-height: calc(100vh - 40px); /* Ajustement pour le padding */
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-header { padding: 1.5rem 1.5rem 1rem; text-align: center; position: relative; flex-shrink: 0; }
.modal-header h2 { margin: 0; color: var(--text-color); }
.modal-back-btn, .modal-close-btn { position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-color-secondary); font-size: 1.5rem; cursor: pointer; }
.modal-close-btn { left: auto; right: 1.5rem; font-size: 2rem; line-height: 1;}
.modal-back-btn { display: none; }
.modal-body { overflow-y: auto; padding: 0 1.5rem 1.5rem; padding-top: 0.5rem; /* Ajout d'un petit padding-top */ }
.modal-view { display: flex; flex-direction: column; gap: 0.75rem; }

/* Styles pour les boutons de choix avec logos */
.choice-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  box-shadow: 0 2px 8px var(--card-shadow);
}

.choice-btn:hover {
  background-color: var(--hover-bg);
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--card-hover-shadow);
}

.choice-btn .club-logo,
.choice-btn .team-logo {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.choice-btn .club-name {
  flex: 1;
  font-weight: 500;
}
.load-more-btn { background-color: #2563eb; color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 50px; font-size: 1rem; cursor: pointer; display: block; margin: 2rem auto 0; transition: background-color 0.2s; }

#font-size-example {
  font-size: 1.2rem;
  text-align: center;
  margin: 1.5rem 0;
  font-weight: bold;
  color: var(--text-color);
  transition: font-size 0.2s ease;
}
#font-size-slider {
  width: 100%;
  cursor: pointer;
  margin: 1rem 0;
}
#reset-font-size-btn {
  background-color: var(--hover-bg);
  color: var(--text-color);
  border: 1px solid var(--input-border);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  cursor: pointer;
  display: block;
  margin: 1.5rem auto 0;
  transition: background-color 0.2s;
}
#reset-font-size-btn:hover {
  background-color: var(--separator-color);
}

#toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 10px);
    background-color: #2563eb;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, bottom 0.3s;
    font-weight: 500;
}

#toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    bottom: calc(env(safe-area-inset-bottom) + 100px);
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-color-secondary);
    font-size: 1rem;
}

/* --- CONTEXT MENU & BLUR STYLES --- */
#blur-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.15);
    /* OPTIMISATION : Suppression du backdrop-filter pour Safari */
    z-index: 1400;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
#blur-backdrop.visible {
    display: block;
    opacity: 1;
}

#long-press-menu {
    position: fixed;
    z-index: 1500;
    width: 250px;
    background-color: var(--modal-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#long-press-menu.visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

#long-press-menu button {
    background: none;
    border: none;
    border-bottom: 1px solid var(--separator-color);
    padding: 1rem;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}
#long-press-menu button:hover { background-color: var(--hover-bg); }
#long-press-menu button:last-child { border-bottom: none; }
#long-press-menu button .ban-action-text { font-size: 1rem; font-weight: 500;}
#long-press-menu button .keywords-to-ban {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    white-space: normal;
    margin-top: 4px;
}
.card.highlighted { z-index: 1401; }

/* --- BANNED KEYWORDS MODAL STYLES --- */
#ban-keyword-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}
#ban-keyword-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
}

#ban-keyword-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
    flex-shrink: 0;
    z-index: 1;
}

#ban-suggestions-container {
  position: absolute;
  top: 100%; 
  left: 0; 
  right: 0;
  bottom: -20rem; /* Aller jusqu'en bas du modal-body */
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow-y: auto;
  z-index: 1101; /* Above modal body content */
  display: none;
}

/* Quand les suggestions sont affichées, cacher la liste des mots bannis */
#banned-keywords-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Quand les suggestions sont visibles, on peut cacher temporairement la liste */
#ban-suggestions-container.visible ~ #banned-keywords-modal-list {
    display: none;
}

/* Styles spécifiques pour les suggestions de ban de mots-clés */
#ban-suggestions-container .suggestion-item {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    min-height: 45px;
    border-bottom: 1px solid var(--separator-color);
}

#ban-suggestions-container .suggestion-item:hover {
    background-color: var(--hover-bg);
}

#ban-suggestions-container .suggestion-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Zone de construction de liste de mots-clés */
#keyword-list-builder {
    background-color: var(--card-bg);
    border: 2px solid var(--highlight-color);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    animation: slideIn 0.3s ease;
}

.list-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.list-builder-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
    flex-grow: 1;
}

.list-builder-actions {
    display: flex;
    gap: 0.5rem;
}

.validate-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    background-color: #22c55e;
    color: white;
}

.validate-btn:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
}

.current-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 60px;
    padding: 0.75rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    align-items: flex-start;
}

.current-list .placeholder-text {
    color: var(--text-color-secondary);
    font-style: italic;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    text-align: center;
    width: 100%;
}

.keyword-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #ef4444;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #dc2626;
    transition: all 0.2s ease;
    cursor: pointer;
    max-width: 200px;
}

.keyword-chip:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.keyword-chip .chip-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keyword-chip .chip-remove {
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0.8;
    margin-left: 0.3rem;
    flex-shrink: 0;
}

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

/* Suppression des styles responsive différents - même affichage partout */
.banned-keyword-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
}
.banned-keyword-modal-item span {
    flex-grow: 1;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    margin-right: 1rem;
    white-space: normal;
}
.banned-keyword-modal-item .unban-btn {
    background-color: var(--hover-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.banned-keyword-modal-item .unban-btn:hover { background-color: var(--separator-color); }
#banned-keywords-modal-list .no-banned-items {
    padding: 1rem 1.2rem;
    color: var(--text-color-secondary);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    background: none;
    border: none;
}

/* Agrandir spécifiquement la modal de ban de mots-clés */
#banned-keywords-modal .modal-content {
    width: 95%;
    max-width: 800px;
    min-height: 500px;
}

/* Désactiver le scroll sur le modal-body pour la modal de ban de mots-clés */
#banned-keywords-modal .modal-body {
    overflow: visible; /* Permettre aux suggestions de déborder */
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- WELCOME & UPDATE MESSAGE STYLES --- */
#welcome-overlay, #update-overlay {
    z-index: 9999; /* Ensure it's on top of everything */
}

/* Style to make update overlay non-closable by click */
#update-overlay .modal-content {
    pointer-events: auto;
}

/* --- COPYRIGHT NOTICE --- */
.copyright-notice {
  text-align: center;
  padding: 20px 15px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.8;
  border-top: 1px solid var(--border-color);
}

.copyright-notice span {
  display: block;
}

/* --- READ ARTICLE BADGE --- */
.read-badge {
  position: absolute;
  top: 8px;
  right: -8px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #fbbf24 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 14px 6px 10px;
  z-index: 10;
  pointer-events: none;
  transform: rotate(-2deg);
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* Position spécifique pour les news chaudes (plus bas) */
.card:has(.hot-news-label) .read-badge {
  top: 35px;
}

/* Animation d'apparition du badge avec délai (pour les nouveaux badges) */
.read-badge.new-read {
  opacity: 0;
  animation: fadeInBadge 0.5s ease-out 1s forwards;
}

/* Animation d'apparition du badge */
@keyframes fadeInBadge {
  0% {
    opacity: 0;
    transform: rotate(-2deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
  }
}

/* Corps principal du ruban avec effet de pli */
.read-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #b91c1c 0%, #dc2626 30%, #fbbf24 100%);
  transform: skew(-10deg);
  border-radius: 2px 0 0 2px;
  z-index: -1;
}

/* Effet de pli et queue du ruban */
.read-badge::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 12px;
  border-color: transparent transparent transparent #b91c1c;
  transform: translateY(-50%);
  filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.3));
}

/* Effet de pli central pour plus de réalisme */
.read-badge .fold {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, 
    rgba(255, 255, 255, 0.2) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(255, 255, 255, 0.2) 100%);
  transform: translateX(-50%);
}

/* Animation d'ondulation au survol */
.card:hover .read-badge {
  transform: rotate(-1deg) scale(1.05);
  box-shadow: 
    0 5px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* Variation pour articles à la une */
.featured-article .read-badge {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 50%, #fbbf24 100%);
}

.featured-article .read-badge::before {
  background: linear-gradient(90deg, #dc2626 0%, #ea580c 30%, #fbbf24 100%);
}

/* Styles pour les logos des clubs dans les modales de sélection */
.choice-btn {
  display: flex;
  align-items: center;
  gap: 1rem; /* Augmenté de 0.75rem à 1rem */
  width: 100%;
  padding: 1rem 1.25rem; /* Augmenté de 0.75rem à 1rem */
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px; /* Augmenté de 8px à 10px */
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem; /* Augmenté de 1rem à 1.1rem */
  margin-bottom: 0.75rem; /* Augmenté de 0.5rem à 0.75rem */
  min-height: 56px; /* Ajout d'une hauteur minimale */
}

.choice-btn:hover {
  background: var(--hover-bg);
  border-color: var(--highlight-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--card-hover-shadow);
}

.choice-btn:active {
  transform: translateY(0);
}

/* Club logo styles removed for App Store compliance */

.choice-btn .club-name {
  flex: 1;
  font-weight: 500;
}