/**
 * Responsive Styles - Theme v2.0
 * Mobile-First Approach
 * 
 * @author MiniMax Agent
 * @version 2.0
 */

/* Mobile First - Base styles (320px+) */

/* Container responsif */
.container {
  padding: 0 1rem;
}

/* Typography responsive */
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); }
h5 { font-size: clamp(1rem, 2vw, 1.125rem); }
h6 { font-size: 1rem; }

/* Grid responsive */
.row {
  margin: 0 -0.75rem;
}

.col {
  padding: 0 0.75rem;
  margin-bottom: 1rem;
}

/* Colonnes mobiles */
.col-sm-1 { flex: 0 0 8.33333%; }
.col-sm-2 { flex: 0 0 16.66667%; }
.col-sm-3 { flex: 0 0 25%; }
.col-sm-4 { flex: 0 0 33.33333%; }
.col-sm-5 { flex: 0 0 41.66667%; }
.col-sm-6 { flex: 0 0 50%; }
.col-sm-7 { flex: 0 0 58.33333%; }
.col-sm-8 { flex: 0 0 66.66667%; }
.col-sm-9 { flex: 0 0 75%; }
.col-sm-10 { flex: 0 0 83.33333%; }
.col-sm-11 { flex: 0 0 91.66667%; }
.col-sm-12 { flex: 0 0 100%; }

/* Utilitaires responsive mobiles */
.d-sm-none { display: none; }
.d-sm-block { display: block; }
.d-sm-flex { display: flex; }

.text-sm-center { text-align: center; }
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }

/* Tablet Portrait (768px+) */
@media (min-width: 768px) {
  :root {
    font-size: 16px;
  }
  
  .container {
    padding: 0 1.5rem;
  }
  
  /* Grid tablette */
  .col-md-1 { flex: 0 0 8.33333%; }
  .col-md-2 { flex: 0 0 16.66667%; }
  .col-md-3 { flex: 0 0 25%; }
  .col-md-4 { flex: 0 0 33.33333%; }
  .col-md-5 { flex: 0 0 41.66667%; }
  .col-md-6 { flex: 0 0 50%; }
  .col-md-7 { flex: 0 0 58.33333%; }
  .col-md-8 { flex: 0 0 66.66667%; }
  .col-md-9 { flex: 0 0 75%; }
  .col-md-10 { flex: 0 0 83.33333%; }
  .col-md-11 { flex: 0 0 91.66667%; }
  .col-md-12 { flex: 0 0 100%; }
  
  /* Utilitaires tablette */
  .d-md-none { display: none; }
  .d-md-block { display: block; }
  .d-md-flex { display: flex; }
  
  .text-md-center { text-align: center; }
  .text-md-left { text-align: left; }
  .text-md-right { text-align: right; }
  
  /* Espacement tablette */
  .main-content {
    padding: 3rem 0;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
  
  /* Grid desktop */
  .col-lg-1 { flex: 0 0 8.33333%; }
  .col-lg-2 { flex: 0 0 16.66667%; }
  .col-lg-3 { flex: 0 0 25%; }
  .col-lg-4 { flex: 0 0 33.33333%; }
  .col-lg-5 { flex: 0 0 41.66667%; }
  .col-lg-6 { flex: 0 0 50%; }
  .col-lg-7 { flex: 0 0 58.33333%; }
  .col-lg-8 { flex: 0 0 66.66667%; }
  .col-lg-9 { flex: 0 0 75%; }
  .col-lg-10 { flex: 0 0 83.33333%; }
  .col-lg-11 { flex: 0 0 91.66667%; }
  .col-lg-12 { flex: 0 0 100%; }
  
  /* Utilitaires desktop */
  .d-lg-none { display: none; }
  .d-lg-block { display: block; }
  .d-lg-flex { display: flex; }
  
  .text-lg-center { text-align: center; }
  .text-lg-left { text-align: left; }
  .text-lg-right { text-align: right; }
  
  /* Espacement desktop */
  .main-content {
    padding: 4rem 0;
  }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
    padding: 0 2rem;
  }
  
  /* Grid large desktop */
  .col-xl-1 { flex: 0 0 8.33333%; }
  .col-xl-2 { flex: 0 0 16.66667%; }
  .col-xl-3 { flex: 0 0 25%; }
  .col-xl-4 { flex: 0 0 33.33333%; }
  .col-xl-5 { flex: 0 0 41.66667%; }
  .col-xl-6 { flex: 0 0 50%; }
  .col-xl-7 { flex: 0 0 58.33333%; }
  .col-xl-8 { flex: 0 0 66.66667%; }
  .col-xl-9 { flex: 0 0 75%; }
  .col-xl-10 { flex: 0 0 83.33333%; }
  .col-xl-11 { flex: 0 0 91.66667%; }
  .col-xl-12 { flex: 0 0 100%; }
  
  /* Utilitaires large desktop */
  .d-xl-none { display: none; }
  .d-xl-block { display: block; }
  .d-xl-flex { display: flex; }
  
  .text-xl-center { text-align: center; }
  .text-xl-left { text-align: left; }
  .text-xl-right { text-align: right; }
}

/* Ultra Wide (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* Breakpoints pour composants spécifiques */

/* Navigation responsive */
@media (max-width: 767px) {
  .navbar-nav {
    flex-direction: column;
  }
  
  .navbar-toggler {
    display: block;
  }
}

/* Hero responsive */
@media (max-width: 767px) {
  .hero {
    text-align: center;
    padding: 2rem 0;
  }
  
  .hero h1 {
    margin-bottom: 1rem;
  }
  
  .hero .btn {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
  }
}

/* Cards responsive */
@media (max-width: 767px) {
  .card-deck {
    flex-direction: column;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

/* Formulaires responsive */
@media (max-width: 767px) {
  .form-row {
    flex-direction: column;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    margin-bottom: 0.5rem;
  }
}

/* Tableaux responsive */
@media (max-width: 767px) {
  .table-responsive {
    border: none;
  }
  
  .table-responsive .table {
    border: none;
  }
  
  .table-responsive .table td,
  .table-responsive .table th {
    border: none;
    display: block;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
    padding-left: 50%;
    position: relative;
  }
  
  .table-responsive .table td:before,
  .table-responsive .table th:before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    width: 45%;
    text-align: left;
    font-weight: bold;
  }
}

/* Sidebar responsive */
@media (max-width: 991px) {
  .sidebar {
    margin-top: 2rem;
  }
  
  .main-sidebar-layout {
    flex-direction: column;
  }
}

/* Footer responsive */
@media (max-width: 767px) {
  .footer-columns {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-column {
    margin-bottom: 2rem;
  }
}

/* Utilitaires d'espacement responsive */
@media (max-width: 767px) {
  .mb-sm-0 { margin-bottom: 0 !important; }
  .mb-sm-1 { margin-bottom: 0.25rem !important; }
  .mb-sm-2 { margin-bottom: 0.5rem !important; }
  .mb-sm-3 { margin-bottom: 1rem !important; }
  .mb-sm-4 { margin-bottom: 1.5rem !important; }
  .mb-sm-5 { margin-bottom: 3rem !important; }
  
  .p-sm-0 { padding: 0 !important; }
  .p-sm-1 { padding: 0.25rem !important; }
  .p-sm-2 { padding: 0.5rem !important; }
  .p-sm-3 { padding: 1rem !important; }
  .p-sm-4 { padding: 1.5rem !important; }
  .p-sm-5 { padding: 3rem !important; }
}

/* Mode sombre responsive */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  
  body:not(.light-mode) .card {
    background: #2a2a2a;
    border-color: #404040;
  }
}

/* Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mode haute contraste */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #000000;
    --color-accent: #0066cc;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* Mode impression */
@media print {
  .d-print-none {
    display: none !important;
  }
  
  .d-print-block {
    display: block !important;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .btn {
    border: 1px solid #000;
    background: transparent;
    color: #000;
  }
}