/* ============================================================
   PLATEFORME RH MAROC - Styles Personnalisés
   ============================================================ */

:root {
  --moroccan-red: #C1272D;
  --moroccan-green: #006233;
  --primary-blue: #1e40af;
  --light-bg: #f8fafc;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

/* ---- Navigation ---- */
.navbar {
  background: linear-gradient(135deg, #1e3a8a 0%, #C1272D 100%);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-link:hover, .nav-link.active {
  color: white;
  background: rgba(255,255,255,0.15);
}

/* ---- Hero Section ---- */
.hero-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #C1272D 50%, #006233 100%);
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ---- Cards ---- */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
.card-stat { border-left: 4px solid var(--moroccan-red); }

/* ---- Boutons ---- */
.btn-primary {
  background: linear-gradient(135deg, #1e40af, #C1272D);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

.btn-secondary {
  background: white;
  color: #1e40af;
  border: 2px solid #1e40af;
  padding: 0.6rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-secondary:hover { background: #1e40af; color: white; }

.btn-danger {
  background: #dc2626;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}
.btn-danger:hover { opacity: 0.85; }

.btn-success {
  background: #16a34a;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}
.btn-success:hover { opacity: 0.85; }

/* ---- Formulaires ---- */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-weight: 600; color: #374151; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: white;
}
.form-input:focus { border-color: #1e40af; box-shadow: 0 0 0 3px rgba(30,64,175,0.1); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.2rem; padding-right: 2.5rem; }
.form-textarea { resize: vertical; min-height: 100px; }

/* ---- Étoiles de satisfaction ---- */
.star-rating { display: flex; gap: 0.3rem; }
.star { font-size: 1.5rem; cursor: pointer; color: #d1d5db; transition: color 0.1s; }
.star.active, .star:hover { color: #f59e0b; }

/* ---- Badges statut ---- */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ---- FAQ Accordion ---- */
.faq-item {
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: #C1272D; }
.faq-question {
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #1f2937;
  background: #fff;
  transition: background 0.2s;
}
.faq-question:hover { background: #f9fafb; }
.faq-answer { padding: 1rem 1.5rem; background: #f9fafb; color: #4b5563; border-top: 1px solid #e5e7eb; display: none; }
.faq-answer.open { display: block; }

/* ---- Commentaires ---- */
.comment-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.2rem;
  border-left: 3px solid var(--moroccan-red);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 1rem;
}
.comment-meta { font-size: 0.8rem; color: #6b7280; }

/* ---- Admin Sidebar ---- */
.admin-sidebar {
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  min-height: 100vh;
  width: 260px;
  flex-shrink: 0;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-nav-item {
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.admin-nav-item.active { background: rgba(255,255,255,0.15); color: white; border-left-color: #f59e0b; }

/* ---- Tableaux ---- */
.table-wrapper { overflow-x: auto; border-radius: 0.75rem; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
table { width: 100%; border-collapse: collapse; background: white; }
thead tr { background: linear-gradient(90deg, #1e3a8a, #C1272D); color: white; }
thead th { padding: 0.9rem 1rem; text-align: left; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid #f3f4f6; font-size: 0.9rem; color: #374151; }
tbody tr:hover { background: #f9fafb; }
tbody tr:last-child td { border-bottom: none; }

/* ---- Notifications ---- */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  color: white;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #1e40af; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Page Header ---- */
.page-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #C1272D 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: #f8fafc;
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* ---- Moroccan Pattern ---- */
.moroccan-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Crect width='56' height='100' fill='%23C1272D' fill-opacity='0.05'/%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100M28 0L28 34' stroke='%23C1272D' stroke-opacity='0.1' fill='none'/%3E%3C/svg%3E");
}

/* ---- Email badge new ---- */
.badge-new {
  background: #C1272D;
  color: white;
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.4rem;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .admin-sidebar { width: 100%; min-height: auto; position: relative; height: auto; }
  .admin-layout { flex-direction: column; }
  .hero-section { min-height: 60vh; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #C1272D; border-radius: 3px; }

/* ---- Footer ---- */
.footer {
  background: linear-gradient(135deg, #1e3a8a 0%, #111827 100%);
  color: rgba(255,255,255,0.8);
  padding: 3rem 0 1.5rem;
}
.footer-link { color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: white; }

/* ---- Loader ---- */
.loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ---- Section separator ---- */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1e3a8a;
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 50%;
  height: 3px;
  background: linear-gradient(90deg, #C1272D, transparent);
  border-radius: 2px;
}
