@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

/* ===========================
   RESET & BASE
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Corps en mode sombre */
body {
  font-family: "Roboto", sans-serif;
  background-color: #2c3e50; /* Fond sombre */
  color: #ecf0f1;              /* Texte clair */
  min-height: 100vh;
}

/* ===========================
   HEADER
   =========================== */
header {
  background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(255,255,255,0.05);
}

/* Titre avec la font “Lobster” */
#app-title {
  font-family: "Roboto", cursive;
  font-size: 2rem;
  font-weight: normal;
  color: #1abc9c;
  font-variant: all-small-caps;
}

/* Sélecteur de langue stylé */
.language-selector {
  display: flex;
  align-items: center;
}

.language-selector label {
  margin-right: 0.5rem;
  font-size: 1rem;
  color: #1abc9c;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "Anton", sans-serif;
  font-weight: lighter;
}

.language-selector select {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: linear-gradient(90deg, #444 0%, #666 100%);
  font-family: "Anton", sans-serif;
  color: #ecf0f1;
  cursor: pointer;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  transition: filter 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: lighter;
}
.language-selector select:hover {
  filter: brightness(1.1);
}

.language-selector option  {
  color: #1abc9c;
}

/* ===========================
   NAV (thèmes + refresh)
   =========================== */
nav {
  background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
  padding: 0.5rem 2rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #333;
}

.theme-buttons {
  flex: 1;
}

/* ===========================
   BOUTONS THÈMES
   =========================== */
.theme-btn {
  font-family: "Anton", sans-serif;
  color: #ecf0f1;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  transition: filter 0.3s ease;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: lighter;
}

.theme-btn i {
  margin-right: 0.3rem;
}

/* Politique (rouge) */
.theme-btn-politique {
  background: linear-gradient(90deg, #f44336 0%, #ff7961 100%);
}
.theme-btn-politique:hover {
  filter: brightness(0.9);
}

/* Sport (vert) */
.theme-btn-sport {
  background: linear-gradient(90deg, #4caf50 0%, #81c784 100%);
}
.theme-btn-sport:hover {
  filter: brightness(0.9);
}

/* Technologie (bleu) */
.theme-btn-technologie {
  background: linear-gradient(90deg, #2196f3 0%, #64b5f6 100%);
}
.theme-btn-technologie:hover {
  filter: brightness(0.9);
}

/* Musique (violet) */
.theme-btn-musique {
  background: linear-gradient(90deg, #9c27b0 0%, #ce93d8 100%);
}
.theme-btn-musique:hover {
  filter: brightness(0.9);
}

/* Bouton sélectionné => border visible */
.theme-btn.selected {
  filter: brightness(1);
  border: 2px solid #1abc9c;
  color: #ecf0f1;
}

/* ===========================
   BOUTON "RAFRAÎCHIR"
   =========================== */
.refresh-btn {
  background: linear-gradient(90deg, #ff9800 0%, #ffc107 100%);
  font-family: "Anton", sans-serif;
  color: #ecf0f1;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  transition: filter 0.3s ease;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: lighter;
}
.refresh-btn:hover {
  filter: brightness(0.9);
}

/* ===========================
   MAIN & LOADING
   =========================== */
main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 75vh;
}

.loading-indicator {
  text-align: center;
  margin-bottom: 2rem;
  font-family: "Anton", sans-serif;
  color: #ecf0f1;
  font-size: 1.2rem;
  font-weight: lighter;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 5px solid #1abc9c;
  border-top: 5px solid #ecf0f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* ===========================
   ARTICLES : grille
   =========================== */
.articles-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ===========================
   CARTE D'ARTICLE
   =========================== */
.article-card {
  width: 100%;
  height: 400px; /* Hauteur augmentée pour intégrer la miniature */
  display: flex;
  flex-direction: column;
  background-color: #1e1e1e;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(255,255,255,0.05);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-2px);
}

/* Conteneur de la miniature */
.article-thumbnail {
  width: 100%;
  height: 150px; /* Hauteur fixe pour l'image */
  margin-bottom: 0.5rem;
  background: #444; /* Couleur de fond en l'absence d'image */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.article-thumbnail img {
  width: 100%;
  /* L'image conserve son ratio sans être déformée */
}

/* Titre tronqué (2 lignes) */
.article-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1abc9c;
  font-family: "Roboto", cursive;
  font-variant: all-small-caps;
}

/* Métadonnées */
.article-meta {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}

/* Source (domaine) plus discret */
.article-source {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

/* Description tronquée (4 lignes) */
.article-description {
  flex-grow: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ccc;
}

/* Masquage de certains liens ou images dans la description */
.article-description > p > a,
.article-description a {
  text-decoration: none !important;
  color: #ccc;
  cursor: default;
}
.article-description > p > img,
.article-description figure,
.article-description img,
.article-description br {
  display: none !important;
}
/* Afficher uniquement le premier <p> */
.article-description > p:not(:first-child) {
  display: none;
}

/* ===========================
   BOUTON "LIRE LA SUITE"
   =========================== */
.read-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: filter 0.3s ease, transform 0.3s;
  cursor: pointer;
  border: none;
  font-family: "Anton", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: lighter;
}

.read-more-btn i {
  margin-right: 0.3rem;
  transition: transform 0.3s;
}

.read-more-btn:hover {
  filter: brightness(0.9);
}
.read-more-btn:hover i {
  transform: translateX(3px);
}

/* Couleurs par thème pour le bouton "Lire la suite" */
.read-more-btn-politique {
  background: linear-gradient(90deg, #f44336 0%, #ff7961 100%);
}
.read-more-btn-sport {
  background: linear-gradient(90deg, #4caf50 0%, #81c784 100%);
}
.read-more-btn-technologie {
  background: linear-gradient(90deg, #2196f3 0%, #64b5f6 100%);
}
.read-more-btn-musique {
  background: linear-gradient(90deg, #9c27b0 0%, #ce93d8 100%);
}

/* ===========================
   FOOTER (optionnel)
   =========================== */
.site-footer {
  background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
  color: #1abc9c;
  padding: 1rem 2rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  font-family: "Anton", sans-serif;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
}

.footer-name {
  color: #1abc9c;
  font-family: "Anton", sans-serif;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: lighter;
}

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

.footer-date {
  font-style: italic;
  margin-left: 0.5rem;
}

.footer-right {
  flex-direction: column;
  align-items: flex-end;
}

.footer-stack {
  margin-top: 0.3rem;
}

.footer-stack i {
  margin-right: 0.3rem;
  color: #1abc9c;
  font-size: 1.2rem;
}

.footer-stack span {
  margin-left: 0.2rem;
  font-style: italic;
}

/* ===========================
   BACKGROUND ANIMÉ
   =========================== */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  background: radial-gradient(circle at center, #121212, #1a1a1a);
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
}

.circle.one {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #9c27b0, #ff4081);
  top: -100px;
  left: -100px;
  animation: moveCircleOne 8s ease-in-out infinite;
}

.circle.two {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #2196f3, #00bcd4);
  bottom: -150px;
  right: -100px;
  animation: moveCircleTwo 9s ease-in-out infinite;
  animation-delay: 2s;
}

.circle.three {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #ff9800, #ffeb3b);
  bottom: 10%;
  left: 20%;
  animation: moveCircleThree 10s ease-in-out infinite;
  animation-delay: 3s;
}

.circle.four {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #4caf50, #8bc34a);
  top: 20%;
  right: 25%;
  animation: moveCircleFour 8.5s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes moveCircleOne {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(150px, -100px) rotate(80deg) scale(1.2); }
  50% { transform: translate(200px, 100px) rotate(180deg) scale(0.8); }
  75% { transform: translate(-50px, 150px) rotate(260deg) scale(1.1); }
  100% { transform: translate(100px, 200px) rotate(360deg) scale(1); }
}

@keyframes moveCircleTwo {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  20% { transform: translate(-100px, 50px) rotate(45deg) scale(1.1); }
  40% { transform: translate(100px, 150px) rotate(135deg) scale(0.9); }
  60% { transform: translate(150px, -100px) rotate(225deg) scale(1.2); }
  80% { transform: translate(-150px, 100px) rotate(315deg) scale(0.8); }
  100% { transform: translate(0, 0) rotate(360deg) scale(1); }
}

@keyframes moveCircleThree {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  30% { transform: translate(100px, -50px) rotate(90deg) scale(1.3); }
  50% { transform: translate(200px, 50px) rotate(180deg) scale(0.7); }
  70% { transform: translate(-100px, 100px) rotate(270deg) scale(1.1); }
  100% { transform: translate(50px, 200px) rotate(360deg) scale(1); }
}

@keyframes moveCircleFour {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(-120px, 80px) rotate(60deg) scale(1.2); }
  50% { transform: translate(180px, 120px) rotate(180deg) scale(0.9); }
  75% { transform: translate(50px, -150px) rotate(300deg) scale(1.3); }
  100% { transform: translate(0, 0) rotate(360deg) scale(1); }
}

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