/* Styles personnalisés pour l'application de monitoring mb8 */

:root {
  --primary-color: #1FA4D7;
  --primary-dark: #1A8AB5;
  --primary-light: #4CB8E2;
  --secondary-color: #000000;
  --secondary-light: #333333;
  --accent1-color: #8E63A1;
  --accent1-dark: #7A5489;
  --accent1-light: #A47FB3;
  --accent2-color: #CA5D6C;
  --accent2-dark: #B54D5B;
  --accent2-light: #D67D8A;
  --success-color: #10B981;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --info-color: #3B82F6;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Styles pour le scanner QR code */
/* Animation de scan */
@keyframes scanning {
  0% { top: 0%; }
  50% { top: 90%; }
  100% { top: 0%; }
}

.scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #1FA4D7;
  box-shadow: 0 0 8px 2px rgba(31, 164, 215, 0.8);
  top: 0;
  left: 0;
  animation: scanning 3s ease-in-out infinite;
  z-index: 100;
  pointer-events: none;
}

/* Animation de pulsation pour le cadre */
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(31, 164, 215, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(31, 164, 215, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 164, 215, 0); }
}

.scan-pulse {
  animation: pulse-border 2s infinite;
  border: 2px solid #1FA4D7 !important;
}

/* Style pour le conteneur du scanner */
.qr-scanner-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

#reader {
  width: 100% !important;
  border: 2px solid #f0f0f0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

/* Style pour les boutons du scanner */
#reader button, #reader select {
  background-color: #1FA4D7 !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 8px 16px !important;
  margin: 5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  font-size: 14px !important;
  display: inline-block !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Style pour les boutons au survol */
#reader button:hover {
  background-color: #e6b800 !important;
}

/* Style pour les éléments du scanner sur mobile */
@media (max-width: 640px) {
  #reader {
    min-height: 300px !important;
  }
  
  #reader button, #reader select {
    width: auto !important;
    max-width: 100% !important;
    margin: 5px auto !important;
    padding: 10px !important;
    font-size: 16px !important;
  }
  
  /* Ajuster la taille de la boîte de scan */
  #reader__scan_region {
    min-height: 200px !important;
  }
  
  /* Amélioration pour les messages d'erreur et de permission */
  #reader__status_span, #reader__camera_permission_button {
    font-size: 14px !important;
    padding: 8px !important;
    margin: 5px auto !important;
    display: block !important;
    text-align: center !important;
    max-width: 100% !important;
  }
  
  /* Assurer que les sélecteurs de caméra s'affichent correctement */
  #reader__camera_selection {
    width: 100% !important;
    max-width: 100% !important;
    margin: 5px auto !important;
  }
}

/* Styles généraux */
body {
  font-family: 'Inter var', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background-color: var(--gray-100);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Animations appliquées */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideInUp 0.5s ease-out;
}

/* Header */
header {
  background-color: var(--primary-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

header h1 {
  color: white;
  font-weight: 700;
}

/* Page Header - Style amélioré pour les titres de page */
.page-header {
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--gray-600);
  font-size: 1rem;
  line-height: 1.5;
}

.header-button {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.header-button:hover {
  background-color: var(--secondary-light);
  transform: translateY(-2px);
}

/* Cards */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
  padding: 1.25rem 1.75rem;
  background-color: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: 1.75rem;
}

.card-footer {
  padding: 1.25rem 1.75rem;
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* Section Titles */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200);
}

/* Amélioration des titres dans les cartes blanches */
.bg-white h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
}

/* Stats Cards */
.stat-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-radius: 0.5rem;
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--primary-color);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card .stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: var(--primary-light);
  color: var(--secondary-color);
}

.stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-800);
}

.stat-card .stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--secondary-light);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

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

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

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

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  background-color: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.table td {
  padding: 1rem 1.5rem;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}

.table tr:hover td {
  background-color: var(--gray-50);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 9999px;
}

.badge-success {
  background-color: #D1FAE5;
  color: #065F46;
}

.badge-danger {
  background-color: #FEE2E2;
  color: #991B1B;
}

.badge-warning {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-info {
  background-color: #DBEAFE;
  color: #1E40AF;
}

.badge-gray {
  background-color: #F3F4F6;
  color: #374151;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 164, 215, 0.25);
}

.form-select {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3e%3cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.5em 1.5em;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-select:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 164, 215, 0.25);
}

/* Alerts */
.alert {
  position: relative;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  border-left-width: 4px;
}

.alert-success {
  color: #065F46;
  background-color: #D1FAE5;
  border-left-color: #10B981;
}

.alert-danger {
  color: #991B1B;
  background-color: #FEE2E2;
  border-left-color: #EF4444;
}

.alert-warning {
  color: #92400E;
  background-color: #FEF3C7;
  border-left-color: #F59E0B;
}

.alert-info {
  color: #1E40AF;
  background-color: #DBEAFE;
  border-left-color: #3B82F6;
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: white;
  padding: 1.5rem 0;
  margin-top: 2rem;
}

footer a {
  color: var(--primary-color);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--primary-light);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 0.25rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.pagination-item.active {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.pagination-item:not(.active) {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.pagination-item:not(.active):hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.pagination-item.disabled {
  background-color: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

/* QR Code Scanner */
#reader {
  border: 2px solid var(--gray-300);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

#qr-reader-results {
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  
  .table th, .table td {
    padding: 0.5rem;
  }
}

/* Animations pour les éléments interactifs */
.btn, .card, .stat-card, .pagination-item {
  transition: all 0.3s ease;
}

.btn:active, .pagination-item:active {
  transform: scale(0.95);
}

/* Animation pour les alertes */
.alert {
  animation: slideInUp 0.3s ease-out;
}

/* Animation de pulsation pour les badges de check-in */
.badge-success {
  animation: pulse 2s infinite;
}

/* Personnalisation des scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Styles pour les titres de page */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom:  3px solid #8E63A1;
}

.page-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #666;
  font-size: 1rem;
}

/* Amélioration des filtres et des tableaux */
.table-filters {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  margin-bottom: 0.75rem;
}

.filter-label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.filter-input, .filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  background-color: white;
  color: var(--gray-800);
  transition: border-color 0.2s ease;
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(31, 164, 215, 0.2);
}

.filter-button {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  font-weight: 600;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.filter-button:hover {
  background-color: var(--primary-dark);
}

.filter-reset {
  padding: 0.75rem 1rem;
  color: var(--gray-600);
  text-decoration: none;
  margin-left: 0.5rem;
}

.filter-reset:hover {
  color: var(--gray-800);
  text-decoration: underline;
}

.data-table-container {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  margin-bottom: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background-color: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--gray-200);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.data-table th:hover {
  background-color: var(--gray-200);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background-color: var(--gray-50);
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  background-color: white;
  color: var(--gray-700);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pagination-item:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.pagination-item.active {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.pagination-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Styles pour les badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-success {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-danger {
  background-color: #fef2f2;
  color: #b91c1c;
}

.badge-warning {
  background-color: #fffbeb;
  color: #b45309;
}

.badge-default {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* Styles pour la pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #555;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #eee;
  transition: all 0.2s;
}

.pagination-item:hover {
  background-color: #f9f9f9;
  border-color: #ddd;
}

.pagination-item.active {
  background-color: #1FA4D7;
  color: #FFFFFF;
  border-color: #1FA4D7;
}

.pagination-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Styles pour les cartes d'export */
.export-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.export-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.export-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.export-description {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.export-button {
  padding: 0.5rem 1rem;
  background-color: #1FA4D7;
  color: #FFFFFF;
  font-weight: 500;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  text-align: center;
}

.export-button:hover {
  background-color: #e6b800;
}
