/* Bootstrap 5.3.2 - Version améliorée pour ESPK */
:root {
  --bs-blue: #0d6efd;
  --bs-indigo: #6610f2;
  --bs-purple: #6f42c1;
  --bs-pink: #d63384;
  --bs-red: #dc3545;
  --bs-orange: #fd7e14;
  --bs-yellow: #ffc107;
  --bs-green: #198754;
  --bs-teal: #20c997;
  --bs-cyan: #0dcaf0;
  --bs-white: #fff;
  --bs-gray: #6c757d;
  --bs-gray-dark: #343a40;
  --bs-primary: #2563eb;
  --bs-secondary: #6c757d;
  --bs-success: #16a34a;
  --bs-info: #0dcaf0;
  --bs-warning: #f59e0b;
  --bs-danger: #dc2626;
  --bs-light: #f8fafc;
  --bs-dark: #1e293b;
  --bs-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --bs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: #1e293b;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  min-height: 100vh;
}

.container, .container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.container-fluid {
  max-width: 100%;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-md-3 {
  flex: 0 0 25%;
  max-width: 25%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-md-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-md-9 {
  flex: 0 0 75%;
  max-width: 75%;
  padding-right: 15px;
  padding-left: 15px;
}

/* Couleurs améliorées */
.bg-dark {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
  box-shadow: var(--bs-shadow);
}

.bg-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
  border: none;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
}

.bg-gradient-info {
  background: linear-gradient(135deg, #0dcaf0 0%, #67e8f9 100%) !important;
}

/* Styles pour les cartes de téléchargement */
.file-upload-card {
  padding: 1.5rem;
  border: 2px dashed #e2e8f0;
  border-radius: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
  margin-bottom: 1rem;
  min-height: 140px;
}

.file-upload-card:hover {
  border-color: #2563eb;
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.file-upload-card.border-warning {
  border-color: #f59e0b;
  background: #fef3c7;
}

.file-upload-card.border-warning:hover {
  border-color: #d97706;
  background: #fde68a;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

/* Amélioration de l'espacement général */
.card-body {
  padding: 2rem !important;
}

.card-header {
  padding: 1.5rem 2rem !important;
}

/* Espacement entre les sections */
.mt-5 {
  margin-top: 3rem !important;
}

.mb-4 {
  margin-bottom: 2rem !important;
}

/* Amélioration des formulaires */
.form-label {
  margin-bottom: 0.75rem !important;
  font-size: 0.95rem;
}

.form-control, .form-select {
  padding: 0.875rem 1rem !important;
  margin-bottom: 0.5rem;
}

.form-text {
  margin-top: 0.5rem !important;
  font-size: 0.85rem;
}

/* Espacement des boutons */
.btn-lg {
  padding: 0.875rem 2rem !important;
  font-size: 1.1rem;
}

/* Amélioration des cartes de documents */
.card {
  margin-bottom: 1.5rem;
  border-radius: 1rem !important;
}

/* Espacement des grilles */
.row.g-4 > * {
  padding: 1.5rem !important;
}

.row.g-3 > * {
  padding: 1rem !important;
}

/* Amélioration du conteneur principal */
.container-fluid {
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}

/* Espacement entre les sections principales */
.mb-4 {
  margin-bottom: 2.5rem !important;
}

.mt-4 {
  margin-top: 2.5rem !important;
}

/* Amélioration des alertes */
.alert {
  padding: 1.25rem 1.5rem !important;
  border-radius: 0.75rem !important;
  margin-bottom: 1.5rem !important;
}

/* Espacement des boutons */
.btn {
  margin-bottom: 0.5rem;
}

/* Amélioration des cartes de documents téléchargés */
.card-body {
  padding: 1.5rem !important;
}

/* Espacement des icônes dans les headers */
.d-flex.align-items-center .me-3 {
  margin-right: 1.5rem !important;
}

/* Amélioration de l'état vide */
.text-center.py-5 {
  padding: 4rem 2rem !important;
}

/* Styles pour les cartes de statut des documents */
.document-status-card {
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
  height: 100%;
}

.document-status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.document-status-card.document-uploaded {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.document-status-card.document-uploaded:hover {
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.document-status-card.document-missing {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.document-status-card.document-missing:hover {
  border-color: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Animation pour les icônes de statut */
.status-icon {
  animation: pulse 2s infinite;
}

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

/* Amélioration des boutons d'action */
.btn-group-sm .btn {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
}

/* Amélioration des badges */
.badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

/* Animation pour les cartes manquantes */
.document-missing .status-icon {
  animation: shake 1s infinite;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

.text-white {
  color: #fff !important;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

.text-muted {
  color: #6c757d !important;
}

.text-danger {
  color: #dc3545 !important;
}

/* Espacement */
.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

/* Typographie */
.h4 {
  font-size: 1.5rem;
  font-weight: 500;
}

.h5 {
  font-size: 1.25rem;
  font-weight: 500;
}

.small {
  font-size: 0.875em;
}

/* Listes */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}

/* Liens */
.text-decoration-none {
  text-decoration: none !important;
}

/* Flexbox */
.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

/* Bordures */
.rounded {
  border-radius: 0.375rem !important;
}

/* Cartes améliorées */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: none;
  border-radius: 1rem;
  box-shadow: var(--bs-shadow-lg);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  margin-bottom: 0;
  background: transparent;
  border-bottom: none;
  border-radius: 1rem 1rem 0 0;
}

.card-body {
  flex: 1 1 auto;
  padding: 1.5rem;
}

/* Formulaires améliorés */
.form-label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #1e293b;
  background-color: #fff;
  background-image: none;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.form-control:focus {
  color: #1e293b;
  background-color: #fff;
  border-color: #2563eb;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #1e293b;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.form-select:focus {
  border-color: #2563eb;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Boutons améliorés */
.btn {
  display: inline-block;
  font-weight: 600;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 2px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: transparent;
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border-color: transparent;
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-link {
  font-weight: 400;
  color: #0d6efd;
  text-decoration: underline;
}

.btn-link:hover {
  color: #0a58ca;
}

/* Alertes */
.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

.alert-dismissible {
  padding-right: 3rem;
}

/* Sidebar améliorée */
.col-md-3.bg-dark {
  background: linear-gradient(180deg, #1e293b 0%, #334155 100%) !important;
  box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.col-md-3 .text-white-50 {
  color: rgba(255, 255, 255, 0.7) !important;
  transition: all 0.3s ease;
}

.col-md-3 .text-white-50:hover {
  color: #fff !important;
  background: rgba(37, 99, 235, 0.1) !important;
  transform: translateX(4px);
}

.col-md-3 .bg-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 767.98px) {
  .col-md-3, .col-md-4, .col-md-6, .col-md-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .col-md-3.bg-dark {
    box-shadow: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}
