/* ==========================================
   STYLES GLOBAUX ET RÉINITIALISATION
   ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}

/* ==========================================
   TYPOGRAPHIE
   ========================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #222;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0052a3;
  text-decoration: underline;
}

/* ==========================================
   CONTENEURS ET MISE EN PAGE
   ========================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
}

.col {
  flex: 1;
  min-width: 250px;
  padding: 10px;
}

/* Colonnes avec différentes largeurs */
.col-1 { flex: 0 0 calc(8.33% - 20px); }
.col-2 { flex: 0 0 calc(16.66% - 20px); }
.col-3 { flex: 0 0 calc(25% - 20px); }
.col-4 { flex: 0 0 calc(33.33% - 20px); }
.col-6 { flex: 0 0 calc(50% - 20px); }
.col-12 { flex: 0 0 calc(100% - 20px); }

/* ==========================================
   EN-TÊTE ET NAVIGATION
   ========================================== */

header {
  background-color: #000000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: #333;
  font-weight: 500;
}

nav a:hover {
  color: #0066cc;
}

/* ==========================================
   BOUTONS
   ========================================== */

button, .btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

button:hover, .btn:hover {
  background-color: #0052a3;
}

/* Variantes de boutons */
.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

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

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

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

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

/* ==========================================
   FORMULAIRES
   ========================================== */

input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

/* Styles au focus des champs */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

/* ==========================================
   CARTES ET CONTENU
   ========================================== */

.card {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-bottom: 1px solid #ddd;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: #f8f9fa;
  padding: 1rem 1.5rem;
  border-top: 1px solid #ddd;
}

/* ==========================================
   TABLEAUX
   ========================================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

thead {
  background-color: #f8f9fa;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #ddd;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #ddd;
}

/* Surbrillance au survol */
tbody tr:hover {
  background-color: #f8f9fa;
}

/* ==========================================
   ALERTES
   ========================================== */

.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Alertes d'informations */
.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

/* Alertes de succès */
.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* Alertes d'avertissement */
.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

/* Alertes de danger */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* ==========================================
   PIED DE PAGE
   ========================================== */

footer {
  background-color: #222;
  color: #fff;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

footer a {
  color: #0066cc;
}

footer a:hover {
  color: #00a8ff;
}

/* ==========================================
   UTILITAIRES
   ========================================== */

/* Alignement du texte */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: #6c757d;
}

/* Marges inférieures */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Marges supérieures */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Espacements internes */
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Affichage */
.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.d-inline {
  display: inline;
}

.d-inline-block {
  display: inline-block;
}

/* ==========================================
   RESPONSIVE - TABLETTES
   ========================================== */

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  /* Colonnes en 50% sur tablettes */
  .col-6 {
    flex: 0 0 calc(50% - 20px);
  }

  /* Navigation en colonne sur tablettes */
  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .container {
    padding: 0 15px;
  }
}

/* ==========================================
   RESPONSIVE - MOBILES
   ========================================== */

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* Colonnes en 100% sur mobiles */
  .col-6, .col-4, .col-3 {
    flex: 0 0 calc(100% - 20px);
  }

  /* Boutons et champs en largeur complète */
  button, .btn {
    width: 100%;
  }

  input, textarea, select {
    width: 100%;
  }
}
