/* base.css */
@font-face {
  font-family: 'Satoshi';
  src: url('/static/fonts/Satoshi-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/static/fonts/Satoshi-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/static/fonts/Satoshi-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --vinted-color: #008c8c;
  --light-bg: #f1fafa;
  --cta-color: #008c8c;
  --gray-text: #555;
  --font-base: 'Satoshi', 'Inter', 'Helvetica Neue', Helvetica, sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1; /* pousse le footer vers le bas quand le contenu est court */
}

body {
  font-family: var(--font-base);
  background-color: white;
  margin: 0;
  padding: 0;
  color: #222;
}

.alert-counter {
  font-weight: bold;
  color: white;
  background-color: var(--vinted-color);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  /*box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);*/
  transition: transform 0.2s ease;
  /*height: 36px;*/
  /*line-height: 1;*/
}


header > .alert-counter {
  margin-top: 4px; /* ajuste finement si besoin */
}

.alert-counter:hover {
  transform: scale(1.05);
}

.alert-counter.low {
  background-color: var(--vinted-color);
}

.alert-counter.medium {
  background-color: #f0a202; /* orange clair */
}

.alert-counter.full {
  background-color: #d00; /* rouge vif */
}

.burger-menu {
  position: relative;
}

.add-search-button {
  display: inline-flex;          /* force le flex sur ligne */
  align-items: center;           /* centre verticalement */
  background-color: var(--vinted-color);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
}

.add-search-button:hover {
  transform: scale(1.05);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--vinted-color);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

button.cta:disabled {
  opacity: 0.5;         /* Rend le bouton visiblement grisé */
  cursor: not-allowed;  /* Curseur bloqué */
  pointer-events: none; /* Optionnel : neutralise tout clic JS résiduel */
  filter: grayscale(50%); /* Optionnel : rend le bouton en niveaux de gris */
}


.burger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--vinted-color);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  line-height: 1;
  border: none;
  cursor: pointer;
}

.burger-button:hover {
  transform: scale(1.05);
}

.burger-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem;
  width: 220px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 100; /* index burger menu */
}

.burger-dropdown.show {
  display: block;
}

.burger-dropdown a,
.burger-dropdown form button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  text-decoration: none;
  color: var(--vinted-color);
  background: white;
  border: none;
  border-left: 4px solid transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-base);
  transition: background 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box; /* ← corrige le débordement */
}

.burger-dropdown a:hover,
.burger-dropdown form button:hover {
  background-color: var(--light-bg);
  border-left: 4px solid var(--vinted-color);
  font-weight: bold;
}

.burger-dropdown i {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem; /* espace entre logo, compteurs et bouton */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem; /* espace entre compteur, bouton, burger */
}

header {
    position: sticky;
    top: 0;
    z-index: 100; /* index header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
    padding: 0 1rem;
    background-color: rgba(255, 255, 255, 0.75); /* semi-transparent */
    backdrop-filter: blur(10px);                   /* effet flou */
    -webkit-backdrop-filter: blur(10px);           /* pour Safari */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);   /* légère ombre */
    border-bottom: none;                           /* supprime la bordure */
}

header h1 {
    font-family: var(--font-base);
    color: var(--vinted-color);
    font-size: 1.5rem;
}

main {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    padding: 3rem 5vw 2rem;  /* ↑ haut, → côtés (vw = %) , ↓ bas */
    margin-top: 2rem;         /* espace entre header et le bloc principal */
}

main h1 {
  font-family: var(--font-base);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--vinted-color);
  text-align: center;
  margin-bottom: 1rem;
}

.centered {
  text-align: center;
}

.centered-cta {
  display: block;
  width: max-content;
  margin: 1.5rem auto 0;
  background-color: var(--cta-color);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  text-decoration: none;
}

footer {
  font-size: 0.9rem;
  border-top: 1px solid #eee;
  background: linear-gradient(to bottom, var(--light-bg), white);
  padding: 2rem 1rem;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: center;
  position: relative;
}

.footer-left {
  position: absolute;
  left: 1rem;
}

.footer-center {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-center a {
  color: var(--gray-text);
  text-decoration: none;
  font-weight: 500;
}

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  height: 150px;
  width: auto;
}

.logo-footer {
  height: 135px;
  width: auto;
}
  
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
    margin-top: 1.5rem;
}

.login-form input {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.login-form input:focus {
    border-color: var(--vinted-color);
    outline: none;
}

.nav-links a.login-link {
  color: var(--gray-text);
  text-decoration: none;
  margin-right: 0.5rem;
  font-weight: 500;
}

.message {
  text-align: center;
  color: red;
  font-weight: bold;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--vinted-color);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--vinted-color);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--vinted-color);
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  background-color: white !important;
  backdrop-filter: none !important;
  z-index: 99999 !important; /* index toast supérieur aux modales */
}

.toast.show {
  opacity: 1;
}

.toast.error {
  border-left: 5px solid #d00;
  color: #d00;
}

/* Harmonisation des en-têtes de modales */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--vinted-color);
}

/* === Modal de confirmation ou de renommage === */
.modal-fixed {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000; /* index modal */
  top: 40px; /* même hauteur que les toast */
}

.modal-box {
  background: white;
  border: 1px solid var(--vinted-color);
  border-radius: 12px;
  padding: 1.25rem 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.modal-box p {
  margin-bottom: 1.25rem;
  font-weight: bold;
  color: var(--vinted-color);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-actions .cta {
  padding: 0.5rem 1.25rem;
}


/* === Boutons === */
.cta {
  background-color: var(--vinted-color);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-align: center;
  justify-content: center;
}

.small-button {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  width: 100%;
  max-width: 300px;
  margin: 1rem auto 0;
  display: block;
}

.form-button {    /* Cette classe reproduit exactement le style de form .cta mais est indépendante de la structure HTML. */
  width: 100%;
  max-width: 400px;
  padding: 0.75rem;
  font-size: 0.95rem;
  border-radius: 8px;
  display: block;
  margin: 1rem auto 0;
  box-sizing: border-box;
}

/* === Champs de formulaire === */
.input-base {
  font-family: var(--font-base);
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: white;
  width: 100%;
  box-sizing: border-box;
}

.input-base:focus {
  border-color: var(--vinted-color);
  outline: none;
}

/* === Infobulle === */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: var(--vinted-color);
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: 1px solid var(--vinted-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100; /* index tooltip */
}

.tooltip:hover::after {
  opacity: 1;
}

/* === Badge générique (plan actuel, recommandé) === */
.badge {
  text-align: center;
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  color: var(--vinted-color);
  font-weight: bold;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  font-size: 0.85rem;
  border: 1px solid var(--vinted-color);
}

/* === Spinner === */
.spinner {
  margin: 2rem auto;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--vinted-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loading-spinner {
  display: none;
}

body.loading #loading-spinner {
  display: block;
}


/* === Cadres contenant des listes === */
.select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

.select-wrapper select {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: var(--font-base);
  min-width: 250px;
  color: #333;
}

/* === Liste déroulante === */
.dropdownlist-select {
    width: 100%;
    min-width: 250px;
    max-width: 350px;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    color: var(--vinted-color);
    box-sizing: border-box;
}

.dropdownlist-select:focus {
    border-color: var(--vinted-color);
    outline: none;
}

@media (max-width: 500px) {
  .mobile-hidden {
    display: none;
  }

  .alert-counter,
  .add-search-button,
  .burger-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    gap: 0.4rem;
    line-height: 1;
    height: auto;
  }

  .burger-button {
    align-items: center;
    gap: 0.4rem;
  }

  .alert-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
    height: auto;
  }

  .add-search-button i {
    width: 16px;
    height: 16px;
  }

  .add-search-button span {
    display: none;
  }

  .logo {
    height: 90px;
  }

  .page-title {
    font-size: 2rem;
  }
}