/* Styles globaux responsives pour toutes les pages */
body {
  background: #f8fafc;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  margin-top: 20px;
  padding-left: 15px;
  padding-right: 15px;
  max-width: 100%;
}

/* En-tête responsive */
.header-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-title {
  font-size: 1.5rem;
  margin: 0;
  flex-grow: 1;
  text-align: center;
}

.user-info {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.nav-buttons .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

/* Cartes */
.card {
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

/* Formulaire de connexion */
.login-container {
  max-width: 400px;
  margin: 20px auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
}

body.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-header {
  font-size: 1.1rem;
  padding: 12px 15px;
}

/* Formulaires */
.form-container {
  padding: 15px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1 1 200px;
  min-width: 150px;
  margin-bottom: 10px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: #fff;
  box-sizing: border-box;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  margin-top: 15px;
}

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #17a2b8;
  color: white;
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.btn-primary:hover {
  background-color: #138496;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #1e7e34;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-outline-primary {
  color: #007bff;
  border: 1px solid #007bff;
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: #007bff;
  color: white;
}

.btn-outline-danger {
  color: #dc3545;
  border: 1px solid #dc3545;
  background-color: transparent;
}

.btn-outline-danger:hover {
  background-color: #dc3545;
  color: white;
}

/* Tableaux */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

th, td {
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #dee2e6;
}

th {
  background-color: #e9ecef;
  font-weight: 600;
  white-space: nowrap;
}

tr:hover {
  background-color: #f8f9fa;
}

/* Graphiques */
.chart-container {
  position: relative;
  width: 100%;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  width: 100% !important;
  height: 100% !important;
  min-height: 200px;
}

/* Contrôles de graphique */
.chart-controls {
  padding: 15px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.control-group {
  flex: 1 1 150px;
  min-width: 120px;
}

/* Style pour l'icône de plein écran */
.fullscreen-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 10;
  font-size: 16px;
}

.fullscreen-toggle:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Mode plein écran - couvre tout l'écran */

#fullscreenChart {
  width: 100%;
  height: 100%;
}

/* Alertes */
.alert {
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

/* Media queries pour différents écrans */
@media (max-width: 768px) {
  .container {
    margin-top: 10px;
  }
  
  .header-container {
    flex-direction: column;
    text-align: center;
  }
  
  .nav-buttons {
    justify-content: center;
  }
  
  .form-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-group {
    flex: 1 1 100%;
    min-width: 100%;
  }
  
  .control-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .control-group {
    flex: 1 1 100%;
    min-width: 100%;
  }
  
  canvas {
    min-height: 180px;
  }
  
  th, td {
    padding: 8px 5px;
    font-size: 0.85rem;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .header-title {
    font-size: 1.2rem;
  }
  
  .user-info {
    font-size: 0.8rem;
  }
  
  .chart-container {
    min-height: 400px;
    height: 550px;
  }
  
  canvas {
    min-height: 160px;
  }
  
  th, td {
    padding: 6px 3px;
    font-size: 0.8rem;
  }
  
  .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .chart-container {
    min-height: 350px;
    height: 400px;
  }
  
  canvas {
    min-height: 330px;
  }
}

/* Styles spécifiques pour les boutons de navigation du dashboard */
.nav-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.nav-btn {
  padding: 8px 15px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  flex: 1;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  text-align: center;
}

.nav-btn:hover:not(:disabled) {
  background-color: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-btn#todayBtn {
  background-color: #17a2b8;
}

.nav-btn#todayBtn:hover:not(:disabled) {
  background-color: #138496;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Style spécifique pour le bouton Afficher */
#refreshBtn {
  background-color: #28a745; /* Vert */
  width: 100%;
  margin-top: 10px;
}

#refreshBtn:hover:not(:disabled) {
  background-color: #218838; /* Vert plus foncé au survol */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments pour les boutons de navigation */
@media (max-width: 768px) {
  .nav-buttons {
    flex-direction: row;
  }
  
  .nav-btn {
    padding: 10px 15px;
    font-size: 16px;
  }
}
