:root {
  --bg-dark: #001f2d;
  --card-bg: rgba(255, 255, 255, 0.1);
  --accent: #b4c5e4;
  --acent-50: rgba(180, 197, 228, 0.5);
  --red: #fd696f;
  --green: #2ecc71;
}
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  position: relative;
  color: white;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1400px;
  margin: auto;
  margin-top: 0;
  padding: 0 10px;
  padding-top: 140px;
  padding-bottom: 50px;
}

@media screen and (max-width: 768px) {
  body {
    margin-bottom: 50px;
  }

  footer {
    border-radius: 10px 0 0 10px !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
}

/* go back button */

.back-link {
  background-color: transparent;
  border: none;
  font-size: 1.5rem;
  color: white;
  opacity: 0.5;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-weight: bold;
}

.back-link:hover {
  opacity: 1;
}

/* fav button */

.btn-fav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  height: 100%;
  font-size: 0.8em;
  opacity: 0.5;
  transition: all 0.3s;
  color: white;
}

.btn-fav-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

.btn-fav-toggle.active {
  color: var(--red);
  opacity: 1;
}

/* Header restaurant */

h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Status indicator */

.status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  font-size: 1em;
}

.status-indicator .dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.ouvert {
  color: #2ecc71;
}

.status-indicator.ouvert .dot {
  background-color: #2ecc71;
  animation: pulse-green 2s infinite;
}

.status-indicator.ferme {
  color: #e74c3c;
}

.status-indicator.ferme .dot {
  background-color: #e74c3c;
}

@keyframes pulse-green {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
}

/* Infos rapides */

.top-info-bar {
  display: flex;
  gap: 5px;
}

.info-item {
  border-radius: 5px;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.1);
}

.affluence {
  background: var(--accent);
  color: var(--bg-dark);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: auto;
}

.affluence strong {
  font-size: 1.2em;
  font-weight: bolder;
}

.address {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: auto;
}

.content-grid {
  display: flex;
  flex-flow: column-reverse;
  gap: 20px;
}

.services-icons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.service-ligne {
  display: flex;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 10px 15px;
  border-radius: 10px;
  gap: 15px;
}

.service-icon {
  width: 30px;
  font-size: 1rem;
  color: var(--accent);
}

.service-ligne span {
  flex: 1;
}

.service-ligne.dispo {
  border-left: 3px solid var(--green);
}

.service-ligne.dispo .status-icon {
  color: var(--green);
}

.service-ligne.indispo {
  border-left: 3px solid var(--red);
  opacity: 0.5;
}
.service-ligne.indispo .status-icon {
  color: var(--red);
}

@media screen and (min-width: 768px) {
  .content-grid {
    flex-flow: row;
  }

  .left-col {
    flex: auto;
  }

  .right-col {
    width: 30vw;
    display: flex;
    flex-flow: column;
    gap: 10px;
  }
}

/* order button */

.btn-order {
  display: block;
  background: var(--accent);
  color: var(--bg-dark);
  text-align: center;
  padding: 10px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.btn-order:hover {
  background-color: var(--acent-50);
}

/* chat live */

#chat-container {
  position: relative;
  background-color: rgba(255, 255, 255, 1);
  padding: 10px;
  transition: transform 0.3s ease-out;
  color: black;
  border-radius: 10px;
  height: 96vh;
}

#display-messages::-webkit-scrollbar {
  width: 5px;
}

#display-messages::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 10px;
}

@media screen and (max-width: 768px) {
  body {
    margin-bottom: 50px;
  }

  .container {
    padding-top: 100px;
  }

  .tabs {
    display: flex;
  }

  .tab-btn {
    flex: 1;
  }

  /* Le tiroir mobile */
  #chat-container {
    width: 100vw; /* Utilise toute la largeur */
    height: 85vh; /* Définit une hauteur pour que le scroll interne marche */
    position: fixed;
    bottom: 0;
    left: 0;
    border-radius: 20px 20px 0 0;
    transform: translateY(95%); /* Cache le chat, laisse dépasser le titre */
    z-index: 9000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
  }
  #chat-container form {
    position: relative; /* Change l'absolute en relative sur mobile */
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    margin-bottom: 0;
    display: flex; /* Pour que l'input et le bouton soient bien alignés */
    background: white;
  }

  #chat-container.active {
    transform: translateY(0);
  }

  #display-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
  }

  footer {
    border-radius: 10px 0 0 10px !important;
  }

  .grab {
    display: block;
    cursor: grab;
  }
}

@media screen and (min-width: 769px) {
  #chat-container {
    display: flex;
    flex-direction: column; /* Force une structure verticale */
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    height: 90vh; /* Hauteur fixe pour permettre le scroll interne */
    position: sticky;
    top: 2vh;
  }

  .grab {
    display: none;
  }
}

#chat-container.grabbing {
  transition: none;
  /* On désactive la transition pendant qu'on glisse à la main */
}

.grab {
  padding-top: 10px;
  margin-top: -10px;
  padding-bottom: 20px;
  /* empecher le double scroll */
  touch-action: none;
  user-select: none;
}

.grab hr {
  width: 40vw;
  border: 2px solid #ccc;
  border-radius: 5px;
  margin: 0 auto;
}

#chat-container h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-style: italic;
  margin-bottom: 10px;
}

#chat-container .dot {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  display: inline-block;
  background-color: #2ecc71;
  animation: pulse-green 2s infinite;
}

#chat-container form button {
  color: white;
  background-color: var(--bg-dark);
  border: var(--bg-dark) 2px solid;
  border-radius: 0 20px 20px 0;
  padding: 5px 15px;
}

#chat-container form input {
  border: none;
  padding: 6px 12px;
  border-radius: 20px 0 0 20px;
  border: var(--bg-dark) 2px solid;
  flex: auto;
}

/* --- Système de bulles Chat Live --- */

/* Conteneur global des messages */
#display-messages {
  flex: 1;
  overflow-y: auto; /* Active le scroll vertical quand ça déborde */
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 10px;
  margin-bottom: 60px; /* Laisse de la place pour le formulaire en bas */
}

/* Structure de base d'un message */
.chat-message {
  display: flex;
  width: 100%;
}

/* Positionnement Gauche/Droite */
.chat-message.others {
  justify-content: flex-start;
}

.chat-message.mine {
  justify-content: flex-end;
}

/* La bulle de texte */
.message-content {
  max-width: 75%;
  padding: 10px 15px;
  border-radius: 15px;
  display: flex;
  flex-direction: column; /* Aligne Nom / Texte / Heure verticalement */
}

/* Style spécifique : Autres (Gris clair) */
.others .message-content {
  background-color: var(--accent);
  color: #333;
  border-bottom-left-radius: 2px;
}

/* Style spécifique : Moi (Bleu/Noir selon ton thème) */
.mine .message-content {
  background-color: var(--bg-dark);
  color: white;
  border-bottom-right-radius: 2px;
}

/* Style de l'heure pour qu'elle soit discrète et en bas à droite de la bulle */
.chat-date {
  font-size: 0.7em;
  opacity: 0.6;
  /*   align-self: flex-end; */
  margin-top: 5px;
  display: flex;
}

.chat-message.others .chat-date {
  justify-content: flex-start;
}

.chat-message.mine .chat-date {
  justify-content: flex-end;
}
/* Informations */

/*  contact */

.mail {
  color: var(--accent);
}

/* Onglets */
.tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
}

.tab-btn {
  background: none;
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
}

.tab-btn.active {
  opacity: 1;
  border-bottom: 2px solid white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

h3 {
  color: var(--accent-blue);
  margin-top: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
}

.product-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

.stock-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: bold;
}

.in-stock {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
}

.out-of-stock {
  background: rgba(231, 76, 60, 0.15);
  color: var(--red);
}

.media-card {
  position: relative;
  margin-bottom: 40px;
}

.media-card div {
  position: absolute;
  bottom: -27px;
  font-family: "Segoe UI", sans-serif;
  background-color: var(--card-bg);
  width: fit-content;
  padding: 15px 10px 5px 10px;
  border-radius: 0 0 10px 10px;
}

.crous-img {
  width: 100%;
  border-radius: 10px;
  max-width: 750px;
  position: relative;
  z-index: 2;
}

.hours-list {
  list-style: none;
  padding: 0;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

.google-disclaimer {
  margin-top: 40px;
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

.login-prompt {
  color: #fff;
  text-align: center;
  margin-top: 20px;
}

.login-prompt p {
  margin: 0;
}

.login-prompt a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}
i a {
  color: var(--bg-dark);
  text-decoration: none;
  font-weight: bold;
}
.login-prompt a:hover,
i a:hover {
  text-decoration: underline;
}
