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

/* Styles globaux */
body {
  font-family: 'Roboto', sans-serif;
  background: #f4f4f4;
  color: #333;
  line-height: 1.6;
  transition: background 0.5s, color 0.5s;
}

/* Pour coller le footer en bas */
html, body {
  height: 100%;
}

/* Conteneur principal */
#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* MAIN (React) */
main {
  flex: 1;  
  width: 90%;
  max-width: 1600px;
  margin: 20px auto;     
  padding: 30px;
  background: transparent;
}

/* HEADER + NAVBAR */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #1f2a38, #2c3e50);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo {
  width: 25px;
  height: 25px;
  object-fit: cover;
}

.site-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

/* NAVBAR MODERNE */
.navbar {
  background: rgba(44, 62, 80, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 4px 10px;
  border-radius: 10px;
  max-width: 1200px;
  margin: auto;
}

.navbar a {
  font-size: 1rem;
  font-weight: 500;
  padding: 4px 10px;
  color: #fff !important;
  transition: background 0.3s ease;
}

.navbar a:hover {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

/* Chat Container */
.chat-container {
  position: fixed;
  top: 100px;        /* 100px sous le header */
  right: 20px;
  height: calc(100vh - 200px); /* Hauteur fixe: viewport - (100px top + 100px bottom) */
  width: 300px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1500;
  display: none;     /* s'affiche uniquement si l'utilisateur est connecté */
  flex-direction: column;
  overflow: hidden;
}

body.dark-mode .chat-container {
  background: #2b2b2b;
  border: 1px solid #555;
}

/* Chat header */
.chat-header {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

body.dark-mode .chat-header {
  border-bottom: 1px solid #555;
}

/* Chat content */
.chat-content {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
}

/* Chat input */
.chat-input {
  width: calc(100% - 20px);
  margin: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

body.dark-mode .chat-input {
  background: #444;
  border: 1px solid #666;
  color: #f4f4f4;
}

/* HERO SECTION */
.hero-section {
  position: relative;
  height: 80vh;
  background: linear-gradient(
      rgba(0, 123, 255, 0.7),
      rgba(243, 156, 18, 0.7)
    ),
    url('https://source.unsplash.com/1600x900/?technology,code') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.hero-content .cta-button {
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: 30px;
  background: #e67e22;
  border: none;
  color: #fff;
  transition: background 0.3s, transform 0.3s;
}

.hero-content .cta-button:hover {
  background: #d35400;
  transform: scale(1.05);
}

/* FEATURES SECTION */
.features-section {
  padding: 40px 20px;
  background: #f0f0f0;
  text-align: center;
}

.features-section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #1f2a38;
}

.features-section p {
  font-size: 1rem;
  margin-bottom: 30px;
  color: #555;
}

.features-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.feature-item {
  flex: 1 1 250px;
  max-width: 300px;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

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

.feature-item h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #1f2a38;
}

.feature-item p {
  font-size: 0.9rem;
  color: #666;
}

/* OFFRES SECTION */
.offers-section {
  padding: 40px 20px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  text-align: center;
}

.offers-section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.offers-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.offer-item {
  flex: 1 1 250px;
  max-width: 300px;
  background: rgba(255, 255, 255, 0.2);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}

.offer-item:hover {
  transform: translateY(-5px);
}

.offer-item h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.offer-item p {
  font-size: 0.9rem;
}

/* MAIN (React) */
main {
  max-width: 1200px;
  margin: 20px auto;
  padding: 10px;
  background: transparent;
}

/* FORM Auth / Editor */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

input, button {
  padding: 12px;
  font-size: 1rem;
  border-radius: 5px;
}

input {
  border: 1px solid #ccc;
}

button {
  background: #f39c12;
  color: #fff;
  border: none;
  transition: background 0.3s;
  cursor: pointer;
}

button:hover {
  background: #e67e22;
}

button:not(form button) {
  margin-top: 10px;
}

/* Animation fade-in */
.fade-in {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* FOOTER */
.footer-container {
  flex-shrink: 0;
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, #1f2a38, #2c3e50);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-container a {
  color: #f39c12;
  text-decoration: none;
}

.footer-container a:hover {
  text-decoration: underline;
}

/* DARK MODE */
body.dark-mode {
  background-color: #181818;
  color: #f4f4f4;
}

footer.dark-mode {
  background-color: #333;
  color: #f4f4f4;
}

header.dark-mode {
  background-color: #2c3e50;
}

body.dark-mode .hero-section {
  background: linear-gradient(
      rgba(0, 0, 0, 0.85),
      rgba(0, 0, 0, 0.85)
    ),
    url('https://source.unsplash.com/1600x900/?technology,code') center/cover no-repeat;
}

body.dark-mode .hero-content h1,
body.dark-mode .hero-content p {
  color: #f4f4f4;
}

body.dark-mode .hero-content .cta-button {
  background: #444;
  color: #fff;
}

body.dark-mode .hero-content .cta-button:hover {
  background: #555;
}

body.dark-mode .features-section {
  background: #2c3e50;
  color: #f4f4f4;
}

body.dark-mode .features-section h2 {
  color: #fff;
}

body.dark-mode .features-section p {
  color: #ddd;
}

body.dark-mode .feature-item {
  background: #3a3a3a;
  color: #f4f4f4;
}

body.dark-mode .offers-section {
  background: linear-gradient(135deg, #333, #444);
  color: #f4f4f4;
}

body.dark-mode .offers-section h2 {
  color: #fff;
}

body.dark-mode .offer-item {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f4f4;
}

.navbar a.dark-mode {
  color: #f39c12;
}

button.dark-mode {
  background-color: #f39c12;
  color: #fff;
}

button.dark-mode:hover {
  background-color: #e67e22;
}

.cta-button.dark-mode {
  background-color: #f39c12;
}

/* TOGGLE SWITCH */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #fff;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
  margin-left: 8px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  border-radius: 50%;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #007bff;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Media Queries pour la responsivite */
@media (max-width: 768px) {
  main {
    width: 95%;
    padding: 20px;
  }
  .navbar {
    padding: 8px 15px;
    flex-wrap: wrap;
  }
  .site-title {
    font-size: 1.1rem;
  }
  .chat-container {
    width: 250px;
    top: 80px;
    height: calc(100vh - 180px);
    right: 10px;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .navbar a, .dropdown-btn {
    font-size: 0.9rem;
    padding: 6px 8px;
  }
  .site-title {
    font-size: 1rem;
  }
  .chat-container {
    width: 220px;
    top: 70px;
    height: calc(100vh - 160px);
    right: 5px;
  }
  .hero-content h1 {
    font-size: 1.8rem;
  }
  .hero-content p {
    font-size: 0.9rem;
  }
}

.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  display: none !important;
}

