html {
  font-size: 14px;
  min-height: 100vh;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  background: linear-gradient(to bottom, #e3f2fd 0%, #ffffff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

/* Container et main pour assurer le bon scroll */
.container {
  flex: 1 0 auto;
  padding-bottom: 2rem;
  margin-bottom: 0;
}

main {
  padding-bottom: 2rem;
  margin-bottom: 0;
}

/* ========== Thème Club de Plongée ========== */

/* Navbar personnalisée */
.navbar {
  background: linear-gradient(135deg, #006994 0%, #0288d1 100%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem !important;
}

.navbar .nav-link:hover {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  transform: translateY(-2px);
}

/* Cartes */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: linear-gradient(135deg, #0288d1 0%, #0277bd 100%);
  color: white;
  font-weight: bold;
  border: none;
}

/* Boutons */
.btn-primary {
  background: linear-gradient(135deg, #0288d1 0%, #0277bd 100%);
  border: none;
  border-radius: 25px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0277bd 0%, #01579b 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
}

.btn-info {
  background: linear-gradient(135deg, #00acc1 0%, #0097a7 100%);
  border: none;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-info:hover {
  background: linear-gradient(135deg, #0097a7 0%, #00838f 100%);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
  border: none;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-success:hover {
  background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
  border: none;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #fb8c00 0%, #f57c00 100%);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
  border: none;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  transform: translateY(-2px);
}

/* Tables */
.table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table thead {
  background: linear-gradient(135deg, #0288d1 0%, #0277bd 100%);
  color: white;
}

.table thead th {
  border: none;
  padding: 1rem;
  font-weight: 600;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: #e3f2fd;
  transform: scale(1.01);
}

/* Badges */
.badge {
  border-radius: 15px;
  padding: 0.4rem 0.8rem;
  font-weight: 500;
}

/* Page d'accueil - Titre principal */
.display-4 {
  color: #006994;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.lead {
  color: #546e7a;
  font-size: 1.2rem;
}

/* Cartes statistiques Dashboard */
.card.text-white .card-body {
  padding: 1.5rem;
}

.card.text-white h2 {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.card.bg-primary {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%) !important;
}

.card.bg-info {
  background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%) !important;
}

.card.bg-success {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%) !important;
}

.card.bg-warning {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
}

/* Formulaires */
.form-control {
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  padding: 0.6rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: #0288d1;
  box-shadow: 0 0 0 0.2rem rgba(2, 136, 209, 0.25);
}

.form-group label {
  font-weight: 600;
  color: #37474f;
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #37474f 0%, #263238 100%);
  color: white;
  padding: 1rem 0;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

.footer a {
  color: #81d4fa;
}

.footer a:hover {
  color: #4fc3f7;
  text-decoration: none;
}

/* Galerie photos */
.card-img-top {
  position: relative;
  overflow: hidden;
}

.card-img-top i {
  font-size: 4rem;
  opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card, .table, .alert {
  animation: fadeIn 0.5s ease;
}

/* Alertes personnalisées */
.alert {
  border: none;
  border-radius: 15px;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-info {
  background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
  color: #01579b;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  color: #e65100;
}

.alert-success {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #1b5e20;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Fix pour assurer le scroll et l'accessibilité */
main {
  min-height: calc(100vh - 200px);
  padding-bottom: 2rem;
}

.container {
  padding-bottom: 2rem;
}

/* Boutons d'action en bas de page */
.action-buttons {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding: 1rem 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Assurer que les formulaires ne cachent pas les boutons */
form {
  margin-bottom: 1.5rem;
}

/* Effet de vague pour le thème océan */
.wave-decoration {
  position: relative;
  overflow: hidden;
}

.wave-decoration::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%230288d1' opacity='0.3'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
}

/* ========== Bascule de thème ========== */
#theme-toggle {
  text-decoration: none;
  font-size: 1.1rem;
}

/* Icône affichée selon le thème : lune en clair (passer en sombre), soleil en sombre */
.theme-icon-light { display: none; }
.theme-icon-dark { display: inline; }

[data-bs-theme="dark"] .theme-icon-dark { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: inline; }

/* ========== Surcharges mode sombre ========== */
/* La navbar garde son dégradé océan et ses liens blancs dans les deux thèmes.
   On corrige ici les éléments dont les couleurs claires étaient codées en dur. */
[data-bs-theme="dark"] body {
  background: linear-gradient(to bottom, #0b1622 0%, #060b12 100%);
}

[data-bs-theme="dark"] .display-4 {
  color: #4fc3f7;
}

[data-bs-theme="dark"] .lead {
  color: #b0bec5;
}

[data-bs-theme="dark"] .form-group label {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
/* En-têtes de colonnes triables (voir site.js) */
th.triable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.triable:hover,
th.triable:focus-visible {
  text-decoration: underline;
}

th.triable::after {
  content: "↕";
  margin-left: 0.35em;
  opacity: 0.35;
  font-size: 0.85em;
}

th.triable[aria-sort="ascending"]::after {
  content: "▲";
  opacity: 0.9;
}

th.triable[aria-sort="descending"]::after {
  content: "▼";
  opacity: 0.9;
}
