/* Styles modernes pour le système de suivi de stages */
/* Copyright M. AITELHADJ - 2024 */

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* Base styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container,
.container-fluid {
  flex: 1;
}

/* Navigation */
.navbar {
  box-shadow: var(--shadow-light);
  border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

/* Sidebar */
.sidebar {
  background: var(--gradient-primary);
  min-height: 100vh;
  box-shadow: var(--shadow-medium);
  padding: 0;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 12px 20px;
  margin: 2px 10px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  border-left-color: white;
  transform: translateX(5px);
}

.sidebar .nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  border-left-color: white;
  font-weight: 600;
}

.sidebar .nav-link i {
  width: 20px;
  margin-right: 10px;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.card-header {
  background: var(--gradient-primary);
  color: white;
  border-bottom: none;
  font-weight: 600;
}

/* Stat cards */
.stat-card {
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.stat-card-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
  color: white;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.stat-card-success:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.stat-card-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #fd7e14 100%);
  color: white;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.stat-card-warning:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.stat-card-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #e83e8c 100%);
  color: white;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.stat-card-danger:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.stat-card-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #6f42c1 100%);
  color: white;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.stat-card-info:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

/* Buttons */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
  border: none;
  padding: 8px 16px;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

/* Tables */
.table {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table thead th {
  background: var(--gradient-primary);
  color: white;
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background-color: rgba(102, 126, 234, 0.05);
  transform: scale(1.01);
}

/* Forms */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  border: 2px solid #e9ecef;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 8px;
}

/* Badges */
.badge {
  border-radius: 20px;
  padding: 6px 12px;
  font-weight: 500;
  font-size: 0.75rem;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow-light);
}

.alert-success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
  border-left: 4px solid var(--success-color);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(253, 126, 20, 0.1) 100%);
  border-left: 4px solid var(--warning-color);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(232, 62, 140, 0.1) 100%);
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(111, 66, 193, 0.1) 100%);
  border-left: 4px solid var(--info-color);
}

/* Modals */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow-medium);
}

.modal-header {
  background: var(--gradient-primary);
  color: white;
  border-bottom: none;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* List groups */
.list-group-item {
  border: none;
  border-radius: var(--border-radius) !important;
  margin-bottom: 2px;
  transition: var(--transition);
}

.list-group-item:hover {
  background-color: rgba(102, 126, 234, 0.05);
  transform: translateX(5px);
}

.list-group-item.active {
  background: var(--gradient-primary);
  border-color: var(--primary-color);
}

/* Progress bars */
.progress {
  border-radius: 20px;
  height: 8px;
}

.progress-bar {
  background: var(--gradient-primary);
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

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

.pulse {
  animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    min-height: auto;
  }

  .stat-card {
    margin-bottom: 1rem;
  }

  .table-responsive {
    border-radius: var(--border-radius);
  }
}

/* Footer */
.footer {
  background: var(--gradient-primary);
  color: white;
  padding: 20px 0;
  margin-top: auto;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
}

.footer i {
  margin-right: 5px;
}

/* Custom utilities */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.bg-gradient-primary {
  background: var(--gradient-primary);
}

.shadow-custom {
  box-shadow: var(--shadow-medium);
}

.border-radius-custom {
  border-radius: var(--border-radius);
}

/* Avatar circle */
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  box-shadow: var(--shadow-light);
}

/* Loading spinner */
.spinner-custom {
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top: 3px solid var(--primary-color);
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Print styles */
@media print {
  .sidebar,
  .navbar,
  .footer,
  .btn,
  .modal {
    display: none !important;
  }

  .container-fluid {
    margin: 0;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
