@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f0f2f5;
  color: #333;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  flex: 1 1 100%;
}

.header-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.icon {
  background-color: #fff;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

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

.logout-btn {
  background-color: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background-color: #c53030;
}

/* Main layout */
.main-container {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Q/R à gauche 2/3, classement 1/3 */
  gap: 1.5rem;
  align-items: start; /* aligne le haut des blocs */
}

/* Game area (bloc Q/R) */
.game-area {
  background-color: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  min-height: 80vh; /* prend presque toute la hauteur de l'écran */
}

/* Classement */
.ranking {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  min-height: 80vh; /* étend le classement en hauteur */
  overflow-y: auto; /* permet de scroller si le classement est long */
}


.event {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.input-area {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#inputYear {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s;
}

#inputYear:focus {
  outline: none;
  border-color: #4a90e2;
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #357abd;
}

.feedback {
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  text-align: center;
}

.history {
  margin-top: 1.5rem;
}


h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a202c;
}

#rankingList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#rankingList li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f2f5;
}

#rankingList li:last-child {
  border-bottom: none;
}



.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 400px;
  text-align: center;
}

.modal-content button {
  margin: 10px;
  padding: 8px 16px;
  cursor: pointer;
}




/* --- Bandeau de consentement --- */
.consent-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 600px;
  width: 90%;
  z-index: 2000;
  font-family: 'Poppins', sans-serif;
  color: #333;
  display: none; /* masqué par défaut, visible via JS */
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 40px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.consent-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.consent-content p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  color: #444;
}

.consent-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.consent-buttons button {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#acceptAllConsent {
  background-color: #4a90e2;
  color: #fff;
}

#acceptAllConsent:hover {
  background-color: #357abd;
}

#declineAnalyticsConsent {
  background-color: #e2e8f0;
  color: #333;
}

#declineAnalyticsConsent:hover {
  background-color: #cbd5e0;
}

#settingsConsent {
  background-color: transparent;
  color: #4a90e2;
  text-decoration: underline;
  padding: 0.6rem;
}

#settingsConsent:hover {
  color: #357abd;
}

/* Responsive */
@media (max-width: 600px) {
  .consent-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}





/* --- Footer banner --- */
.footer-banner {
  background-color: #fff;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #555;
  border-top: 1px solid #e0e0e0;
  margin-top: 2rem;
}

.footer-banner a {
  color: #4a90e2;
  text-decoration: none;
  margin: 0 0.5rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-banner a:hover {
  color: #357abd;
}





.question-card {
  background: #f9f9f9;
  border-radius: 15px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.question-card:hover {
  transform: scale(1.02);
}

.question-card.selected {
  background: #e8fce8;           /* léger vert clair */
  border: 3px solid #4CAF50;     /* bordure verte */
  box-shadow: 0 0 10px #6fd86f;  /* halo vert doux */
  transform: scale(1.03);
}

.choose-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: #4CAF50;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.choose-btn:hover {
  background: #45a049;
}


@media (max-width: 900px) {
  .main-container {
    grid-template-columns: 1fr;
  }
  .game-area, .ranking {
    min-height: auto;
    margin-left: auto;   
    margin-right: auto;  
    width: 100%;         
    max-width: 500px;   
    margin-bottom: 1.5rem;
    padding : 0rem !important;
    align-items: center;
  }

  .input-area {
    flex-direction: column;  
    align-items: center;   
    gap: 1rem;               
  }

  .input-area input,
  .input-area button {
    width: 100%;             
    max-width: 300px;       
  }

  .game-area > div {
    padding-left: 1% !important;
    padding-right: 1% !important;
  }
}

