/* ==== GLOBAL === */
:root {
  --primary-color: #bfa66b;
  --secondary-color: #2b3d55;
  --accent-color: #3b2f2f;
  --bg-color: #f9f9f9;
  --text-color: #333;
  --light-bg: #f8f5f2;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  --color-text: #222;
  --color-title: #111;
  --color-border: #ddd;
  --primary-light: #e7d7b0;
  --secondary-light: #4a6a97;
  --accent-light: #584a43;

  --font-serif: "Playfair Display", serif;
  --font-sans: "Inter", sans-serif;
  --font-body: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-title: "Playfair Display", Georgia, serif;
  --font-family: "Playfair Display", serif;

  --spacing-xs: 0.4rem;
  --spacing-sm: 0.8rem;
  --spacing-md: 1.6rem;
  --spacing-lg: 2.4rem;
  --spacing-xl: 4rem;

  --max-content-width: 1200px;

  --light-bg: #f8f5f2;
  --bg-white: #ffffff;

  --text-dark: #2c2c2c;
  --text-muted: #7f8c8d;

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 12px;

  --light-gray: #f9fafb;
  --background-highlight: #f3f4f6;

  --text-primary: #bfa66b;
  --text-secondary: #2b3d55;
  --text-dark: #2c2c2c;
  --text-muted: #7f8c8d;

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.12);
  --radius: 12px;

  --light-border: #e0e0e0;
  --message-mine-bg: #d1e7ff;
  --message-other-bg: #f1f1f1;
  --unread-badge-bg: #dc3545;
  --unread-badge-color: #fff;
  --bs-badge-border-radius: 0.375rem;
  --bs-badge-padding-y: 0.35em;
  --bs-badge-font-size: 0.75em;
  --bs-badge-padding-x: 0.65em;
  --bs-badge-font-weight: 700;
}

html,
body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #faf8f0 !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif; /* or Roboto, Poppins, etc. */
  line-height: 1.6;
  letter-spacing: 0.2px;
}

h1,
h2,
h3,
h5,
.section-title {
  font-family: var(--font-title);
}
p,
dd,
dt,
li,
.feature-item {
  font-family: var(--font-body);
}
button,
input,
.btn {
  font-family: var(--font-sans);
}

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

.main-content {
  flex: 1;
  display: flex;
  justify-content: center; /* Center the inner container */
  padding: 2rem 1rem;
}

.page-wrapper main,
.page-wrapper .content,
.page-wrapper .main-content {
  flex: 1; /* This pushes the footer to the bottom */
}

.container {
  flex: 1;
  padding: 20px;
}

.title {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 40px;
}

.card {
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-body {
  padding: 10px !important;
  border-radius: 15px;
}

/* Statut Badge */

.badge-status {
  display: inline-block;
  padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
  font-size: var(--bs-badge-font-size);
  font-weight: var(--bs-badge-font-weight);
  text-transform: capitalize;
  border-radius: var(--bs-badge-border-radius);
  line-height: 1;
  vertical-align: middle;
}

.badge-status.confirmee {
  background-color: var(--success-color);
  color: #fff;
}

.badge-status.terminee {
  background-color: var(--primary-color);
  color: #fff;
}

.badge-status.annulee {
  background-color: var(--danger-color);
  color: #fff;
  border: 1px solid #f5c2c7;
}

.badge-status.echec_paiement {
  background-color: var(--danger-color);
  color: #fff;
  border: 1px solid #f5c2c7;
}

.badge-status.en_attente {
  background-color: var(--warning-color);
  color: #000;
}

.badge-status.en-cours {
  background-color: var(--warning-color);
  color: #000;
}

.badge-status.a-venir {
  background-color: var(--success-color);
  color: #fff;
}

.badge-status.remboursable {
  background-color: var(--success-color);
  color: #fff;
}

.badge-status.rembourse {
  background-color: var(--success-color);
  color: #fff;
}

.badge-status.validee {
  background-color: var(--success-color);
  color: #fff;
}

.badge-status.inconnu {
  background-color: var(--light-border);
  color: #000;
}

.form-box h2 {
  text-align: center;
  font-size: 1.8em;
  margin-bottom: 25px;
  color: #2b3d55;
  font-weight: 600;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* ==== Form === */
.form-control {
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-control:focus {
  border-color: #2b3d55;
  box-shadow: 0 0 8px rgba(43, 124, 255, 0.6);
  outline: none;
}

.form-errors .error {
  color: #d33;
  background: #ffeaea;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 6px;
  font-size: 0.95em;
  text-align: left;
}

.form-box {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: auto;
}

.form-box h2 {
  color: #2b3d55;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.form-box .section-title {
  font-size: 1.4rem;
  color: #333;
  margin-bottom: 15px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2b3d55;
  box-shadow: 0 0 8px rgba(43, 124, 255, 0.6);
  outline: none;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
}

input[type="file"] {
  font-size: 1rem;
}

.form-box .button-row {
  text-align: center;
  margin-top: 25px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2b3d55;
  box-shadow: 0 0 5px rgba(43, 124, 255, 0.6);
}

.auto-width {
  width: auto !important;
  min-width: 0;
  flex-shrink: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-thumb {
  background-color: #2b3d55;
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background: #f7f7f7;
}

/* ==== Buttons === */
button,
.btn {
  padding: 12px 20px;
  background: #2b3d55;
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-add {
  display: inline-block;
  background: #2b3d55;
  color: white;
  padding: 10px 16px;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 20px;
}
.btn-add:hover {
  background: #1a5fd1;
}

.btn-submit {
  background-color: #2b3d55;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: block;
  margin: 0 auto; /* This centers the button horizontally */
}

.btn-submit:hover {
  background-color: #1a5fd1;
  transform: scale(1.05);
}

.btn-primary {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-light) !important;
  transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s,
    border-color 0.25s !important;
}

.btn-primary:hover {
  background: linear-gradient(90deg, #bfa66b 0%, #c7b491 100%) !important;
  color: #fff !important;
  border-color: #bfa66b !important;
}

.btn-secondary {
  background: linear-gradient(
    90deg,
    var(--secondary-color) 0%,
    var(--secondary-light) 100%
  ) !important;
  color: #fff !important;
  border-color: var(--secondary-light) !important;
  transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s,
    border-color 0.25s;
}

.btn-secondary:hover {
  background: linear-gradient(90deg, #23344a 0%, #3d5779 100%) !important;
  color: #fff !important;
  border-color: #23344a !important;
}

.btn-danger {
  background-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-success {
  background-color: #28a745;
  color: #fff;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-info {
  background-color: #17a2b8;
  color: #fff;
}

.btn-info:hover {
  background-color: #138496;
}

.btn-lg {
  font-size: 1.2rem;
}

/* ==== LIST STYLES === */
ul.list-unstyled {
  padding-left: 0;
}

ul.list-unstyled li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

ul.list-unstyled li img {
  border-radius: 8px;
  margin-right: 15px;
}

ul.list-unstyled li .ml-3 {
  margin-left: 15px;
}

#loader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25d366;
  color: white;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  background-color: #1ebc59;
}

#chatbot-launcher {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease-in-out;
  overflow: hidden;
}

#chatbot-launcher:hover {
  transform: scale(1.05);
}

#chatbot-close {
  padding: 0px 5px !important;
}

.chatbot-icon {
  width: 100%;
  height: 100%;
  object-fit: cover; /* or 'contain' if you prefer the full image inside */
}

#chatbot-window {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 360px;
  height: 440px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 9998;
  font-family: "Segoe UI", sans-serif;
  border: 1px solid #ddd;
  overflow: hidden;
}

#chatbot-header {
  flex: 0 0 auto;
  background-color: var(--primary-color);
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 13%;
}

#chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  background-color: #f8f8f8;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70%;
}

#chatbot-input {
  flex-shrink: 0;
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid #ddd;
  background-color: #fff;
}

#chatbot-input input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#chatbot-input button {
  background-color: var(--primary-color);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

#chatbot-input button:hover {
  background-color: var(--accent-color);
}

.cookie-banner {
  max-width: 420px;
  background: #fff;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  border: 1px solid #e5e5e5;
}
@media (max-width: 600px) {
  .cookie-banner {
    right: 0;
    left: 0;
    bottom: 0;
    max-width: 100vw;
    border-radius: 0;
  }
}

.cookie-banner p {
  color: white;
}

.cookie-banner a {
  color: #ffd700;
  text-decoration: underline;
}
.cookie-banner button {
  background: #ffd700;
  color: #000;
  border: none;
  padding: 6px 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}

.translate-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color, #333);
  padding: 0.5rem 1rem;
  background: var(--bg-light, #f8f8f8);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.translate-select {
  padding: 0.3rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: white;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.translate-select:hover,
.translate-select:focus {
  border-color: #007bff;
  outline: none;
}

.pagination {
  text-align: center;
  margin-top: 2rem;
  margin: auto;
}

.d-flex.justify-content-between.align-items-center.mt-3 {
  justify-content: center !important;
}

.pagination-list {
  display: flex;
  list-style: none;
  padding-left: 0;
  gap: 0.25rem;
  justify-content: center !important; /* Center the whole pagination */
  align-items: center;
  width: 100%;
}

.page-item {
  border-radius: 4px;
  margin: 0 2px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center; /* Center content inside each li */
  min-width: 2.2em;
  min-height: 2.2em;
}

.page-item a,
.page-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.35em 0.85em;
  text-decoration: none;
  color: var(--primary-color);
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.page-item.active span,
.page-item.active a {
  background: linear-gradient(90deg, #d4af7f 0%, #ffecd2 100%);
  color: #fff !important;
  border-color: var(--primary-light);
  font-weight: bold;
}

.page-item.disabled span {
  color: #aaa;
  background: #f8f9fa;
  border-color: #dee2e6;
  cursor: not-allowed;
}

.page-item:not(.active):not(.disabled) a:hover {
  background: #e9ecef;
  color: var(--primary-light);
  text-decoration: underline;
}

/* ==== Django message tags compatibility */
.alert-error,
.alert-danger {
  background-color: #f8d7da !important;
  color: #842029 !important;
  border-color: #f5c2c7 !important;
}
.alert-success {
  background-color: #d1e7dd !important;
  color: #0f5132 !important;
  border-color: #badbcc !important;
}
.alert-warning {
  background-color: #fff3cd !important;
  color: #664d03 !important;
  border-color: #ffecb5 !important;
}
.alert-info {
  background-color: #cff4fc !important;
  color: #055160 !important;
  border-color: #b6effb !important;
}

.custom-divider {
  border: none;
  border-top: 2px solid var(--primary-color, #003580);
  width: 60px;
  margin: 1.5rem auto;
  opacity: 0.5;
  border-radius: 2px;
}

/* ==== RESPONSIVE === */
@media screen and (max-width: 900px) {
  .container {
    max-width: 700px !important; /* Adjust width for medium screens and up */
  }

  input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5); /* optional: style calendar icon */
  }

  #chatbot {
    bottom: 15px;
    left: 15px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}
