/* custom-home.css */

/* ======= Position et dimension sidebar ====== */

/* Desktop : sidebar fixe, décalée sous le header */
@media (min-width: 769px) {
  #mobile-sidebar.sidebar {
    position: fixed !important;
    top: 145px !important; /* décalage sous barre top */
    left: 0 !important;
    width: 260px !important;
    height: calc(100vh - 245px) !important; /* hauteur visible */
    overflow-y: auto !important;
    padding-bottom: 120px !important; /* espace bas pour boutons */
    box-sizing: border-box !important;
    background: #f4f4f4 !important;
    border-right: 1px solid #ccc !important;
    z-index: 1000 !important;
    transform: none !important;
  }
}

/* Mobile : sidebar glissant décalé également */
@media (max-width: 768px) {
  #mobile-sidebar.sidebar {
    position: fixed !important;
    top: 145px !important; /* même décalage que desktop */
    left: 0 !important;
    width: 80vw !important;
    max-width: 320px !important;
    height: calc(100vh - 145px) !important;
    background: #fff !important;
    border-right: 1px solid #ccc !important;
    overflow-y: auto !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease-in-out !important;
    z-index: 1100 !important;
  }
  #mobile-sidebar.sidebar.active {
    transform: translateX(0) !important;
  }

  /* Bouton burger visible, bien positionné */
  #burger-toggle.burger-btn {
    display: block !important;
    position: fixed !important;
    top: 15px !important;
    left: 10px !important;
    z-index: 1200 !important;
    background: #333 !important;
    color: #fff !important;
    border: none !important;
    font-size: 24px !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
  }

  /* Bouton fermeture visible */
  #close-sidebar.close-btn {
    display: block !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    font-size: 26px !important;
    background: none !important;
    border: none !important;
    color: #333 !important;
    cursor: pointer !important;
    z-index: 1150 !important;
  }
}

/* ======= Style toast moderne ====== */
#toast-container {
  bottom: 30px;
  right: 30px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  font-family: Arial, Helvetica, sans-serif;
  position: fixed;
  pointer-events: none;
}

.toast {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: white;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.5);
  opacity: 0;
  transform: translateY(20px);
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  pointer-events: auto;
  position: relative;
  padding-right: 40px; /* espace pour le bouton fermer */
}

.toast.show {
  animation-name: fadeInUp;
  animation-duration: 0.4s;
}

.toast.hide {
  animation-name: fadeOutDown;
  animation-duration: 0.4s;
}

.toast .close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  font-weight: bold;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.toast .close-btn:hover,
.toast .close-btn:focus {
  opacity: 1;
  outline: none;
}

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

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Style pour les messages non lus */
.unread {
    font-weight: bold;
    background-color: #eef9f1;
}

.read {
    font-weight: normal;
}

/* Dropdown espace client */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown button {
    background: none;
    border: none;
    color: #333;
    font-weight: 600;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    list-style: none;
    margin: 0;
    padding: 0.5em 0;
    min-width: 150px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 1000;
}

.dropdown-menu li {
    padding: 0.3em 1em;
}

.dropdown-menu li a {
    color: #333;
    text-decoration: none;
    display: block;
}

.dropdown-menu li a:hover,
.dropdown-menu li a:focus {
    background-color: #0f9d58;
    color: white;
    outline: none;
}

/* Table dans mailbox */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.6em;
    border-bottom: 1px solid #ccc;
    text-align: left;
}

th {
    background-color: #0f9d58;
    color: white;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover, a:focus {
    text-decoration: underline;
}

/* Boutons dans mailbox */
nav a {
    margin-right: 1em;
    color: #0f9d58;
    font-weight: 600;
    text-decoration: none;
}

nav a:hover, nav a:focus {
    text-decoration: underline;
}


@keyframes oscillate-color-move {
  0% {
    transform: translateX(0px);
    color: #0f9d58;
  }
  25% {
    transform: translateX(10px);
    color: #0ea5e9;
  }
  50% {
    transform: translateX(0px);
    color: #10b981;
  }
  75% {
    transform: translateX(-10px);
    color: #14b8a6;
  }
  100% {
    transform: translateX(0px);
    color: #0f9d58;
  }
}

.promo-animated {
  font-size: 2rem;
  font-weight: bold;
  display: inline-block;
  animation: oscillate-color-move 3s infinite ease-in-out;
  transition: transform 0.3s ease, color 0.3s ease;
}

/* ANIMATION défilement droite-gauche pour la bannière promotion */
.promotion-banner {
  position: relative;
  overflow: hidden;
  background: #0f766e;
  height: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.03);
}

.promotion-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;   /* Démarre en dehors du conteneur */
  font-size: 1.18em;
  font-weight: 700;
  color: #fff; 
  text-shadow: 0 2px 6px rgba(0,0,0,0.06);
  animation: scrollLeft 13s linear infinite;
  /* Optionnel : garder le style précédent */
  letter-spacing: 1.5px;
}

@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.promotion-banner {
  width: 100vw;  /* force la pleine largeur de la fenêtre */
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  background: #0f766e;
  height: 52px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 1100;
  border-radius: 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.promotion-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  font-size: 1.21em;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.13);
  animation: scrollLeft 35s linear infinite;
  letter-spacing: 1.5px;
}

@keyframes scrollLeft {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Responsive pour mobile */
@media (max-width: 600px) {
  .promotion-banner {
    height: 42px;
    font-size: 1em;
    margin-bottom: 16px;
  }
  .promotion-text {
    font-size: 1em;
  }
}
