body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: #f7f9fc;
  color: #222;
  line-height: 1.5;
}

/* =========================
   HEADER
========================= */
header {
  background-color: #0b2850;
  color: white;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0.8rem 2rem;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);

  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* =========================
   NAVIGATION
========================= */
.top-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;

  border: 1px solid rgba(255, 255, 255, 0.15);

  padding: 0.55rem 0.8rem;
  border-radius: 10px;

  cursor: pointer;

  display: flex;
  align-items: center;
  gap: 0.35rem;

  font-weight: 600;
  font-size: 0.9rem;

  transition:
    background 0.3s,
    transform 0.2s,
    border 0.3s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.nav-btn.active {
  background: white;
  color: #0b2850;
}

.nav-btn.logout {
  background: #9ca3af;
}

.nav-btn.logout:hover {
  background: #ef4444;
}

.nav-icon {
  font-size: 1.05rem;
}

.nav-text {
  white-space: nowrap;
}

/* =========================
   PAGE
========================= */
.requests-page {
  max-width: 1100px;
  margin: 2rem auto;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.requests-section {
  background: white;

  padding: 1.5rem;

  border-radius: 14px;

  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.requests-section:first-child {
  grid-column: 1 / -1;
}

.requests-section h1,
.requests-section h2 {
  color: #0b2850;
  margin-top: 0;
}

.requests-section h1 {
  margin-bottom: 0.5rem;
}

.intro-text {
  color: #6b7280;
  margin: 0;
}

/* =========================
   REQUEST CARDS
========================= */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.request-card {
  border: 1px solid #e5e7eb;

  border-radius: 10px;

  padding: 1rem;

  background: #ffffff;

  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.request-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
}

.request-header {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.request-photo {
  width: 55px;
  height: 55px;

  border-radius: 50%;

  object-fit: cover;

  background: #e5e7eb;

  flex-shrink: 0;
}

.request-name {
  margin: 0;
  font-weight: 700;
  color: #0b2850;
}

.request-info {
  font-size: 0.9rem;
  color: #6b7280;
}

.request-actions {
  margin-top: 1rem;

  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =========================
   MODIFICATION: Bouton "Profil ansehen"
   Ce bouton permettra d'ouvrir la modal détaillée du profil depuis une demande.
========================= */
.profile-btn {
  border: 1px solid #cdd6e1;

  padding: 0.5rem 1rem;

  color: #0b2850;
  background: #eef2f7;

  border-radius: 6px;

  cursor: pointer;

  font-weight: 600;

  transition:
    transform 0.2s,
    opacity 0.2s,
    background 0.2s;
}

.profile-btn:hover {
  background: #e2e8f0;
  transform: translateY(-2px);
  opacity: 0.95;
}

.accept-btn,
.reject-btn {
  border: none;

  padding: 0.5rem 1rem;

  color: white;

  border-radius: 6px;

  cursor: pointer;

  font-weight: 600;

  transition:
    transform 0.2s,
    opacity 0.2s;
}

.accept-btn:hover,
.reject-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.accept-btn {
  background: #22c55e;
}

.reject-btn {
  background: #ef4444;
}

/* =========================
   STATUS
========================= */
.status-badge {
  display: inline-block;

  margin-top: 0.5rem;

  padding: 0.3rem 0.7rem;

  border-radius: 6px;

  font-size: 0.8rem;
  font-weight: 600;
}

.pending {
  background: #fff7d6;
  color: #92400e;
}

.accepted {
  background: #dcfce7;
  color: #166534;
}

.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.empty-message {
  color: #6b7280;
  font-style: italic;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
  header {
    padding: 0.8rem 1rem;
    flex-direction: column;
    gap: 0.8rem;
  }

  .top-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-btn {
    padding: 0.5rem 0.7rem;
  }

  .requests-page {
    margin: 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* =========================
   MODIFICATION: Bouton pour terminer une collaboration acceptée
   Ce bouton sera affiché sur les demandes avec le statut "accepted".
========================= */
.end-btn {
  border: none;

  padding: 0.5rem 1rem;

  color: white;
  background: #6b7280;

  border-radius: 6px;

  cursor: pointer;

  font-weight: 600;

  transition:
    transform 0.2s,
    opacity 0.2s,
    background 0.2s;
}

.end-btn:hover {
  background: #4b5563;
  transform: translateY(-2px);
  opacity: 0.95;
}

/* =========================
   MODIFICATION: Bouton pour annuler une demande envoyée
   Ce bouton sera affiché sur les demandes envoyées avec le statut "pending".
========================= */
.cancel-btn {
  border: none;

  padding: 0.5rem 1rem;

  color: white;
  background: #f97316;

  border-radius: 6px;

  cursor: pointer;

  font-weight: 600;

  transition:
    transform 0.2s,
    opacity 0.2s,
    background 0.2s;
}

.cancel-btn:hover {
  background: #ea580c;
  transform: translateY(-2px);
  opacity: 0.95;
}

/* =========================
   MODIFICATION: Badge pour une collaboration terminée
   Ce statut sera utilisé quand une demande acceptée passe à "ended".
========================= */
.ended {
  background: #e5e7eb;
  color: #374151;
}

.cancelled {
  background: #ffedd5;
  color: #9a3412;
}

/* =========================
   MODIFICATION: Modal personnalisée pour remplacer les alert()
   Cette modal affichera les messages au centre de la page Requests avec l’arrière-plan flouté.
========================= */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal.hidden {
  display: none;
}

/* =========================
   MODIFICATION: Arrière-plan flouté de la modal
   Cet élément assombrit et floute la page lorsque la popup est ouverte.
========================= */
.modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(11, 40, 80, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* =========================
   MODIFICATION: Boîte centrale de la modal
   Elle contient l’icône, le titre, le message et le bouton OK.
========================= */
.modal-box {
  position: relative;

  width: 90%;
  max-width: 430px;

  background: white;
  border-radius: 18px;

  padding: 2rem;

  text-align: center;

  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);

  animation: modalFadeIn 0.25s ease;
}

/* =========================
   MODIFICATION: Icône de la modal
   L’icône change selon le type du message: info, success, error ou warning.
========================= */
.modal-icon {
  width: 58px;
  height: 58px;

  margin: 0 auto 1rem;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #eaf3ff;

  font-size: 1.8rem;
}

/* =========================
   MODIFICATION: Titre de la modal
   Le titre utilise la couleur principale du projet BUW.
========================= */
.modal-box h2 {
  margin: 0 0 0.8rem;

  color: #0b2850;
  font-size: 1.4rem;
}

/* =========================
   MODIFICATION: Texte de la modal
   white-space: pre-line permet d’afficher correctement les retours à la ligne si besoin.
========================= */
.modal-box p {
  margin: 0;

  color: #374151;
  line-height: 1.5;
  font-size: 0.95rem;

  white-space: pre-line;
}

/* =========================
   MODIFICATION: Bouton OK de la modal
   Ce bouton ferme la modal et peut lancer une action après validation.
========================= */
.modal-box button {
  margin-top: 1.5rem;

  padding: 0.85rem 1.6rem;

  border: none;
  border-radius: 10px;

  background: #0b2850;
  color: white;

  font-weight: 700;
  cursor: pointer;

  transition:
    background 0.3s,
    transform 0.2s;
}

.modal-box button:hover {
  background: #163b70;
  transform: translateY(-2px);
}


.modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1 1 0;
  margin-top: 0;
}

.modal-actions .modal-cancel-btn.hidden {
  display: none;
}

.modal-actions .modal-cancel-btn {
  background: #e5e7eb;
  color: #1f2937;
}

.modal-actions .modal-cancel-btn:hover {
  background: #d1d5db;
}

@media (max-width: 420px) {
  .modal-actions {
    flex-direction: column;
  }
}

/* =========================
   MODIFICATION: Couleurs selon le type de message
   Ces classes permettent de différencier les messages info, succès, erreur et avertissement.
========================= */
.modal-box.info .modal-icon {
  background: #eaf3ff;
}

.modal-box.success .modal-icon {
  background: #e7f7ec;
}

.modal-box.error .modal-icon {
  background: #fdeaea;
}

.modal-box.warning .modal-icon {
  background: #fff7e6;
}

/* =========================
   MODIFICATION: Animation d’apparition de la modal
   La boîte apparaît avec un effet léger et moderne.
========================= */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   MODIFICATION: BADGES DE NOTIFICATION
   Petit badge rouge sur les boutons de navigation.
========================= */
.nav-btn {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -7px;
  right: -7px;

  min-width: 18px;
  height: 18px;

  padding: 0 5px;

  background: #ef4444;
  color: white;

  border-radius: 999px;

  font-size: 0.72rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;

  border: 2px solid white;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.nav-badge.hidden {
  display: none;
}

/* =========================
   MODIFICATION: MODAL PROFIL DÉTAILLÉ POUR REQUESTS
   Cette modal affiche le profil complet de la personne liée à une demande.
========================= */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1rem;
  box-sizing: border-box;
}

.profile-modal.hidden {
  display: none;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(11, 40, 80, 0.42);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.profile-modal-box {
  position: relative;
  z-index: 1;

  width: 100%;
  max-width: 760px;
  max-height: 90vh;

  background: white;
  border-radius: 20px;

  overflow-y: auto;
  overflow-x: hidden;

  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);

  animation: modalFadeIn 0.25s ease;
}

.profile-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;

  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.9);
  color: #0b2850;

  font-size: 1.7rem;
  line-height: 1;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);

  transition:
    background 0.3s,
    transform 0.2s;
}

.profile-modal-close:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.05);
}

/* =========================
   MODIFICATION: En-tête du profil avec photo, nom et email
========================= */
.profile-modal-header {
  background: linear-gradient(135deg, #0b2850, #163b70);
  color: white;

  padding: 2rem;

  display: flex;
  align-items: center;
  gap: 1.3rem;
}

.profile-modal-photo {
  width: 110px;
  height: 110px;

  border-radius: 50%;

  object-fit: cover;

  background: #e5e7eb;

  border: 4px solid white;

  cursor: pointer;

  flex-shrink: 0;

  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.profile-modal-photo:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.profile-modal-main-info h2 {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
}

.profile-modal-email {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  word-break: break-word;
}

.profile-modal-content {
  padding: 1.6rem 2rem 2rem;
}

/* =========================
   MODIFICATION: Grille des informations du profil
========================= */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;

  margin-bottom: 1.5rem;
}

.profile-info-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;

  padding: 0.9rem;
}

.profile-info-label {
  display: block;

  color: #6b7280;

  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;

  margin-bottom: 0.25rem;
}

.profile-info-value {
  display: block;

  color: #111827;

  font-size: 0.95rem;
  font-weight: 600;

  word-break: break-word;
}

.profile-section {
  margin-top: 1.4rem;
}

.profile-section h3 {
  margin: 0 0 0.7rem;

  color: #0b2850;
  font-size: 1.05rem;
}

/* =========================
   MODIFICATION: Liste des cours dans la modal profil
========================= */
.profile-courses-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.profile-course-chip {
  background: #eef2f7;
  color: #0b2850;

  border: 1px solid #cdd6e1;
  border-radius: 999px;

  padding: 0.42rem 0.75rem;

  font-size: 0.84rem;
  font-weight: 700;
}

.profile-about-text {
  margin: 0;

  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;

  padding: 1rem;

  color: #374151;

  line-height: 1.6;

  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================
   MODIFICATION: MODAL PHOTO AGRANDIE
   Cette modal s'ouvre quand l'utilisateur clique sur la photo du profil.
========================= */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1rem;
  box-sizing: border-box;
}

.photo-modal.hidden {
  display: none;
}

.photo-modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.photo-modal-box {
  position: relative;
  z-index: 1;

  max-width: 92vw;
  max-height: 92vh;

  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-close {
  position: absolute;
  top: -0.8rem;
  right: -0.8rem;

  width: 40px;
  height: 40px;

  border: none;
  border-radius: 50%;

  background: white;
  color: #0b2850;

  font-size: 1.8rem;
  line-height: 1;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);

  transition:
    background 0.3s,
    transform 0.2s;
}

.photo-modal-close:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.05);
}

.large-profile-photo {
  max-width: 92vw;
  max-height: 88vh;

  border-radius: 18px;

  object-fit: contain;

  background: white;

  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

  animation: modalFadeIn 0.25s ease;
}

.section-description {
  margin-top: -0.4rem;
  margin-bottom: 1.2rem;

  color: #6b7280;
  font-size: 0.9rem;
}

.history-section {
  grid-column: 1 / -1;
}

.request-direction {
  margin-top: 0.15rem;

  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Historique légèrement plus discret */
.request-card-ended,
.request-card-rejected,
.request-card-cancelled {
  background: #f8fafc;
}

/* Chat = action positive principale */
.chat-action-btn {
  border: none;

  padding: 0.5rem 1rem;

  color: white;
  background: #16a34a;

  border-radius: 6px;

  cursor: pointer;

  font-weight: 600;

  transition:
    background 0.2s,
    transform 0.2s;
}

.chat-action-btn:hover {
  background: #15803d;
  transform: translateY(-2px);
}

/* =========================
   RESPONSIVE MOBILE
========================= */
@media (max-width: 600px) {
  .requests-section {
    padding: 1.2rem;
  }

  .nav-text {
    display: none;
  }

  .nav-btn {
    width: 42px;
    height: 42px;

    justify-content: center;

    padding: 0;

    border-radius: 50%;
  }

  .nav-icon {
    font-size: 1.15rem;
  }

  .request-actions {
    flex-direction: column;
  }

  /* =========================
     MODIFICATION: Les boutons d’action prennent toute la largeur sur mobile
     Cela inclut accepter, refuser, terminer une collaboration, annuler une demande et voir le profil.
  ========================= */
  .profile-btn,
  .accept-btn,
  .reject-btn,
  .end-btn,
  .cancel-btn,
  .chat-action-btn {
    width: 100%;
  }

  /* =========================
     MODIFICATION: Adaptation mobile de la modal personnalisée
     La boîte devient plus compacte sur les petits écrans.
  ========================= */
  .modal-box {
    width: calc(100% - 2rem);
    padding: 1.5rem;
  }

  .modal-box h2 {
    font-size: 1.2rem;
  }

  .modal-box p {
    font-size: 0.9rem;
  }

  /* =========================
     MODIFICATION: Adaptation mobile de la modal profil
  ========================= */
  .profile-modal-box {
    max-height: 92vh;
  }

  .profile-modal-header {
    padding: 1.6rem 1.2rem;
    flex-direction: column;
    text-align: center;
  }

  .profile-modal-photo {
    width: 96px;
    height: 96px;
  }

  .profile-modal-main-info h2 {
    font-size: 1.35rem;
  }

  .profile-modal-content {
    padding: 1.2rem;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }

  .photo-modal-close {
    top: 0.4rem;
    right: 0.4rem;
  }

  .large-profile-photo {
    border-radius: 12px;
  }
}

/* =========================
   NUTZER BLOCKIEREN / ENTSPERREN IM PROFIL
========================= */
.request-profile-safety-actions {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.request-block-user-btn,
.request-unblock-user-btn {
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fff7f7;
  color: #b91c1c;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.request-block-user-btn:hover {
  background: #fee2e2;
}

.request-unblock-user-btn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.request-unblock-user-btn:hover {
  background: #dbeafe;
}

@media (max-width: 600px) {
  .request-profile-safety-actions {
    justify-content: stretch;
  }

  .request-profile-safety-actions button {
    width: 100%;
  }
}


/* =========================
   AKADEMISCHE PROFILANGABEN
========================= */
.request-info {
  display: grid;
  gap: 0.1rem;
}

.request-study-program {
  color: #374151;
  font-weight: 600;
}

.request-faculty {
  color: #6b7280;
  font-size: 0.82rem;
}

.profile-course-code {
  font-weight: 800;
}

.request-intent-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 800;
}

.request-intent-badge.help {
  background: #ecfdf5;
  color: #166534;
}
