/**
 * responsive.css - Styles adaptatifs pour Portal SSO
 * Définit les règles de mise en page pour différentes tailles d'écran
 */

/* Variables pour les points de rupture */
:root {
  --breakpoint-xs: 480px;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
}

/* Grille responsive de base */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Système de grille */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
}

/* Colonnes de taille fixe */
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Version tablette - écrans de taille moyenne */
@media screen and (max-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  /* Adaptation des grilles */
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Adaptation des statistiques du tableau de bord */
  .dashboard-stats {
    flex-direction: column;
  }
  
  .dashboard-stat-card {
    margin-right: 0;
    margin-bottom: var(--spacing-md);
  }
  
  /* Adaptation des cartes de service */
  .service-card {
    flex: 0 0 calc(100% - 30px);
  }
  
  /* Réduction des marges et paddings */
  .admin-content,
  .user-content {
    padding: var(--spacing-lg);
  }
  
  /* Gestion du menu latéral */
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.open {
    transform: translateX(0);
    max-height: 100vh;
    z-index: 10;
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* Version mobile - petits écrans */
@media screen and (max-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  /* Colonnes responsives */
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Header adaptatif */
  .admin-header,
  .user-header {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-sm);
  }
  
  .header-user {
    margin-top: var(--spacing-sm);
  }
  
  /* Sidebar transformé en menu hamburger */
  .admin-body {
    flex-direction: column;
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  /* Tableau utilisateurs simplifié */
  .user-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Formulaire de recherche et filtres */
  .user-management-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box,
  .filter-select,
  .user-management-controls .btn {
    margin-bottom: var(--spacing-sm);
  }
  
  /* Adaptation des cartes sur la page services */
  .services-grid {
    flex-direction: column;
  }
  
  /* Adaptation de la page de connexion */
  .login-container {
    padding: var(--spacing-md);
  }
  
  .login-links {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }
  
  /* Réduction des espacements globaux */
  :root {
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-xxl: 32px;
  }
  
  /* Réduction de la taille des textes */
  h1 {
    font-size: var(--font-size-lg);
  }
  
  h2 {
    font-size: var(--font-size-md);
  }
  
  .dashboard-title {
    font-size: var(--font-size-lg);
  }
  
  /* Ajustement du contenu */
  .container {
    padding: 0 var(--spacing-sm);
  }
}

/* Très petits écrans */
@media screen and (max-width: 576px) {
  .container {
    max-width: 540px;
  }
  
  /* Colonnes responsives */
  .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
  .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Boutons adaptés */
  .service-card-actions {
    flex-direction: column;
  }
  
  .service-card-actions .btn {
    width: 100%;
    margin-bottom: var(--spacing-sm);
  }
  
  /* Panneau de statistiques simplifié */
  .dashboard-panels {
    margin: 0;
  }
  
  .dashboard-panel {
    margin: 0 0 var(--spacing-lg);
  }
  
  /* Réduction supplémentaire des espacements */
  .admin-content,
  .user-content {
    padding: var(--spacing-md);
  }
  
  /* Adaptation des toggles dans la gestion des utilisateurs */
  .user-table th:nth-child(n+4),
  .user-table td:nth-child(n+4) {
    padding: var(--spacing-xs);
  }
  
  /* Légende compacte */
  .user-legend {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

/* Écrans très étroits */
@media screen and (max-width: 480px) {
  /* Colonnes responsives */
  .col-xs-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-xs-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-xs-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xs-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-xs-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-xs-6 { flex: 0 0 50%; max-width: 50%; }
  .col-xs-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-xs-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-xs-9 { flex: 0 0 75%; max-width: 75%; }
  .col-xs-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-xs-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-xs-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Font plus petite */
  :root {
    --font-size-base: 13px;
    --font-size-md: 15px;
    --font-size-lg: 17px;
    --font-size-xl: 20px;
  }
}

/* Réglages pour impression */
@media print {
  body {
    background-color: white;
  }
  
  .admin-sidebar,
  .admin-header,
  .admin-footer,
  .user-header,
  .user-footer,
  .fab,
  .btn {
    display: none !important;
  }
  
  .admin-content,
  .user-content {
    padding: 0;
    margin-left: 0;
  }
  
  .card,
  .dashboard-stat-card,
  .service-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  /* Assure que le contenu est visible en noir et blanc */
  body, p, h1, h2, h3, h4, h5, h6, th, td {
    color: black !important;
  }
  
  /* Garder les tableaux lisibles */
  .table th,
  .table td {
    border-color: #333;
  }
}


.justify-content-center {
    justify-content: center;
}