/* ============================================
   CHEKINA SARL - CSS RESPONSIVE (responsive.css)
   Version Ultime - Tous les appareils
   ============================================ */

/* ========== TABLET (768px à 1024px) ========== */
@media (max-width: 1024px) {
  :root {
    --font-size-base: 15px;
    --spacing-xxl: 3rem;
  }
  .container-hero {
    grid-template-columns: 1fr;
    padding: var(--spacing-xl) var(--spacing-md);
  }
  .hero-title {
    font-size: 36px;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .expertise-grid {
    grid-template-columns: 1fr;
  }
  .team-grid {
    grid-template-columns: 1fr;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .contact-info {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .geologie-content > div,
  .operations-content > div,
  .etude-content > div {
    grid-template-columns: 1fr;
  }
}

/* ========== MOBILE LANDSCAPE (600px à 768px) ========== */
@media (max-width: 768px) {
  :root {
    --font-size-base: 14px;
    --font-size-xxl: 24px;
    --spacing-xl: 1.5rem;
    --spacing-xxl: 2rem;
  }
  body {
    font-size: var(--font-size-base);
  }

  /* Navigation */
  .navbar-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    padding: var(--spacing-lg) 0;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
  }
  .navbar-menu.active {
    display: flex;
  }
  .navbar-menu li {
    width: 100%;
  }
  .nav-link {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
  }
  .nav-link::after {
    display: none;
  }
  .navbar-toggle {
    display: flex;
  }
  .navbar-toggle.active .hamburger:nth-child(1) {
    transform: rotate(-45deg) translate(-8px, 6px);
  }
  .navbar-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
  }
  .navbar-toggle.active .hamburger:nth-child(3) {
    transform: rotate(45deg) translate(-8px, -6px);
  }

  /* Héro */
  .hero {
    min-height: 450px;
  }
  .hero-title {
    font-size: 28px;
  }
  .hero-subtitle {
    font-size: 18px;
  }
  .hero-description {
    font-size: 15px;
  }
  .hero-cta {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
  }
  .stat-number {
    font-size: 30px;
  }

  /* Grids */
  .services-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-image {
    height: 200px;
  }
  .expertise-grid {
    grid-template-columns: 1fr;
  }
  .team-grid {
    grid-template-columns: 1fr;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .contact-info {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }
  .footer-socials {
    justify-content: center;
  }
  .stats-cards {
    grid-template-columns: 1fr 1fr;
  }

  /* Sections */
  section {
    padding: var(--spacing-xl) 0;
  }
  .section-header h2 {
    font-size: 24px;
  }
  .section-header p {
    font-size: 16px;
  }

  /* Map */
  .map-container {
    height: 300px;
  }

  /* Scroll to top */
  .scroll-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }

  /* Tableaux */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    font-size: 12px;
  }
  table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 11px;
  }
  table tbody td {
    padding: 0.75rem 0.5rem;
  }

  /* Layout interne des sections spécifiques */
  .geologie-content > div,
  .operations-content > div,
  .etude-content > div {
    grid-template-columns: 1fr !important;
  }
}

/* ========== MOBILE (max 600px) ========== */
@media (max-width: 600px) {
  :root {
    --font-size-base: 13px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;
    --font-size-xxl: 20px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 1.5rem;
    --spacing-xxl: 1.5rem;
  }
  .container {
    padding: 0 var(--spacing-sm);
  }
  .container-nav {
    padding: 0 var(--spacing-sm);
  }

  /* Typographie */
  h1 {
    font-size: 22px;
  }
  h2 {
    font-size: 20px;
  }
  h3 {
    font-size: 18px;
  }
  h4 {
    font-size: 16px;
  }

  /* Boutons */
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 13px;
  }
  .btn-large {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  /* Navigation */
  .brand-name {
    font-size: 18px;
  }
  .logo {
    height: 40px;
  }
  .navbar-main {
    padding: var(--spacing-sm) 0;
  }

  /* Héro */
  .hero {
    min-height: 350px;
    padding: var(--spacing-xl) 0;
  }
  .hero-title {
    font-size: 22px;
    letter-spacing: 1px;
  }
  .hero-subtitle {
    font-size: 16px;
  }
  .hero-description {
    font-size: 14px;
  }
  .stat-item {
    padding: var(--spacing-md);
  }
  .stat-number {
    font-size: 24px;
  }
  .stat-label {
    font-size: 12px;
  }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
  }

  /* Services */
  .service-card {
    padding: var(--spacing-lg);
  }
  .service-icon {
    width: 60px;
    height: 60px;
  }
  .service-features li {
    font-size: 13px;
  }

  /* Projets */
  .project-image {
    height: 160px;
  }
  .project-content {
    padding: var(--spacing-md);
  }

  /* Équipe */
  .member-image {
    width: 120px;
    height: 120px;
  }

  /* Formulaires */
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 10px var(--spacing-sm);
    font-size: 16px;
  }
  .form-group textarea {
    min-height: 100px;
  }
  .contact-form {
    padding: var(--spacing-lg);
  }

  /* Map */
  .map-container {
    height: 250px;
  }

  /* Footer */
  .footer {
    padding: var(--spacing-xl) 0 var(--spacing-md);
  }
  .footer-content {
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }
  .footer-section h4 {
    font-size: 14px;
    margin-bottom: var(--spacing-sm);
  }
  .footer-section p,
  .footer-section a {
    font-size: 12px;
  }
  .footer-bottom {
    font-size: 12px;
    padding-top: var(--spacing-md);
  }

  /* Scroll to top */
  .scroll-to-top {
    width: 40px;
    height: 40px;
    bottom: 15px;
    right: 15px;
    font-size: 18px;
  }

  /* Utilitaires */
  .mt-xl {
    margin-top: var(--spacing-lg);
  }
  .mb-xl {
    margin-bottom: var(--spacing-lg);
  }
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  .expertise-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  section {
    padding: var(--spacing-lg) 0;
  }
  .section-header {
    margin-bottom: var(--spacing-lg);
  }

  /* Ajustements pour les nouvelles sections */
  .exploration-content h3,
  .etude-content h3,
  .geologie-content h3,
  .operations-content h3 {
    font-size: 18px;
  }
  .anomaly-list li {
    flex-wrap: wrap;
  }
  .sensitivity-alert {
    padding: 1rem;
  }
  .recommendations-list {
    padding: 1rem;
  }
  .stats-cards {
    grid-template-columns: 1fr;
  }
  .interventions-list {
    padding: 1rem;
  }
  .interventions-list li {
    font-size: 13px;
  }

  /* Tableaux - version mobile en carte */
  table thead {
    display: none;
  }
  table tbody,
  table tr,
  table td {
    display: block;
    width: 100%;
  }
  table tr {
    margin-bottom: 1.5rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-lg);
    background: var(--white);
    padding: 0.5rem 0;
  }
  table td {
    text-align: right;
    padding: 0.5rem 1rem;
    position: relative;
    padding-left: 50%;
    border: none;
    border-bottom: 1px solid var(--light-gray);
    font-size: 13px;
  }
  table td:before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    font-weight: 700;
    text-align: left;
    color: var(--accent-color);
    width: 45%;
  }
  table td:last-child {
    border-bottom: none;
  }
}

/* ========== TRÈS PETIT MOBILE (max 360px) ========== */
@media (max-width: 360px) {
  :root {
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1rem;
    --spacing-xxl: 1rem;
  }
  .hero-title {
    font-size: 18px;
  }
  h2 {
    font-size: 18px;
  }
  h3 {
    font-size: 16px;
  }
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  .contact-info {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .stat-number {
    font-size: 20px;
  }
}

/* ========== ORIENTATION PAYSAGE (MOBILE) ========== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-lg) 0;
  }
  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
  }
  section {
    padding: var(--spacing-lg) 0;
  }
}

/* ========== IMPRESSION ========== */
@media print {
  body {
    font-size: 12pt;
    color: black;
  }
  .navbar-main,
  .footer,
  .scroll-to-top,
  .contact-form,
  .hero-background {
    display: none !important;
  }
  section {
    page-break-inside: avoid;
  }
  a {
    text-decoration: underline;
  }
  .hero {
    min-height: auto;
    padding: 1rem 0;
  }
  .container-hero {
    grid-template-columns: 1fr;
  }
  .stat-item {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
  }
}

/* ========== ACCESSIBILITÉ (mouvement réduit) ========== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ========== MODE SOMBRE ========== */
@media (prefers-color-scheme: dark) {
  /* Les variables sont déjà gérées dans styles.css, mais on ajoute des ajustements */
  .table-wrapper {
    background: var(--dark-gray);
  }
  table tr {
    border-color: #444;
    background: var(--dark-gray);
  }
  table td {
    border-bottom-color: #444;
  }
  .stat-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }
  .navbar-menu {
    background: var(--dark-gray);
  }
  .nav-link {
    color: var(--text-color);
  }
  .sensitivity-alert {
    background: #3d3a1a;
    border-left-color: #f39c12;
  }
  .sensitivity-alert p {
    color: #e0d5a0;
  }
  .next-steps {
    background: #1c3a4a;
  }
  .tonnage-note {
    background: #1c3a4a;
  }
}
