/* user_dashboard.css */

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #121212;
  color: #ffffff;
}

.dashboard-header {
  background-color: #1e1e1e;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.logo {
  font-size: 1.8rem;
  color: #ffc107;
  margin: 0;
}

.dashboard-title {
  font-size: 1rem;
  font-weight: normal;
  color: #ccc;
  margin: 0.2rem 0 0 0;
}

.salutation {
  color: #ffffff;
  font-weight: normal;
}

.nom-utilisateur {
  color: #ffc107;
  font-weight: bold;
}

.salutation, .nom-utilisateur {
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInSalutation 0.8s ease-out forwards;
}

@keyframes fadeInSalutation {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.welcome-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#profile-pic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffc107;
  animation: fadeInProfile 1s ease-out;
}

@keyframes fadeInProfile {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


.profile-pic-update {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#preview-pic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffc107;
}

.nav-profile-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffc107;
  margin-right: 8px;
  vertical-align: middle;
}

#nav-user-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}


.user-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.user-nav a, .user-nav button {
  color: #fff;
  text-decoration: none;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.user-nav a:hover, .user-nav button:hover {
  color: #ffc107;
}

.dashboard-container {
  padding: 2rem;
  max-width: 1000px;
  margin: auto;
  margin-top: 100px; /* décalage du haut pour laisser respirer le header */
}

.dashboard-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background-color: #1f1f1f;
  border-radius: 8px;
}

.stats {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.stat-box {
  background-color: #2c2c2c;
  padding: 1rem;
  border-radius: 6px;
  flex: 1 1 200px;
  text-align: center;
}

.stat-box h3 {
  margin: 0;
  color: #ffc107;
}

.stat-box p {
  font-size: 1.5rem;
  margin: 0.5rem 0 0 0;
}

#reservation-list > div {
  padding: 1rem;
  background-color: #2b2b2b;
  margin-bottom: 1rem;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
}

#account-form input {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 1.2rem;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  border-radius: 4px;
}

#account-form button {
  background-color: #ffc107;
  color: #000;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#account-form button:hover {
  background-color: #e0a800;
}

/* --- Filtre de réservation --- */
#reservation-filter {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background-color: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 1rem;
  outline: none;
}

#reservation-filter:focus {
  border-color: #ffc107;
}

/* --- Boutons modifier / supprimer --- */
.reservation-item button {
  margin-top: 0.5rem;
  margin-right: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.edit-btn {
  background-color: #007bff;
  color: #fff;
}

.edit-btn:hover {
  background-color: #0056b3;
}

.delete-btn {
  background-color: #dc3545;
  color: #fff;
}

.delete-btn:hover {
  background-color: #a71d2a;
}

/* --- Réservations annulées --- */
.reservation-annulee {
  background-color: #2a1a1a !important;
  color: #999 !important;
  border-left: 4px solid #ff4d4d !important;
}

/* --- Réservations passées --- */
.reservation-passee {
  opacity: 0.6;
  background-color: #1f1f1f;
  border-left: 4px solid #666;
}

/*-----------------------------------------------------------------------------------------*/
/* Custom file input style */
input[type="file"]#photo {
  display: none;
}
.custom-file-upload {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  color: #000;
  background-color: #ffc107;
  border-radius: 24px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: background 0.3s;
  margin-top: 0.4rem;
}
.custom-file-upload:hover {
  background-color: #e0a800;
  color: #222;
}
.file-message {
  margin-top: 0.2rem;
  font-size: 0.93rem;
  color: #ff3939;
  min-height: 18px;
}
/*-----------------------------------------------------------------------------------------*/

.reservation-qrcode {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 5px;
  background: #fff;
  margin: 8px 0;
}
.res-id {
  color: #1e90ff;
  font-family: monospace;
  font-size: 1rem;
  background: rgba(30,144,255,0.07);
  border-radius: 4px;
  padding: 1px 4px;
}
/*----------------------------------------------------------------------------------*/
.export-pdf-btn {
  background: #ffc107;
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  margin-top: 6px;
  margin-bottom: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.25s;
}
.export-pdf-btn:hover {
  background: #e0a800;
  color: #222;
}
/*----------------------------------------------------------------------------------*/

.reservation-item.edited {
  animation: highlight-edit 1.2s cubic-bezier(0.7,0,0.3,1);
}

@keyframes highlight-edit {
  0%   { background: #fff3cd; border-left: 7px solid #ffa500; }
  50%  { background: #ffe066; border-left: 7px solid #ffa500; }
  100% { background: white; border-left: none; }
}

#delete-modal {
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(1.2px);
}

#delete-modal[style*="display: flex"] > div {
  animation: modal-pop-in 0.38s cubic-bezier(0.67,0,0.33,1);
}
@keyframes modal-pop-in {
  0%   { transform: scale(0.7) translateY(60px); opacity: 0.3; }
  75%  { transform: scale(1.08) translateY(-10px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}


/*----------------------------------------------------------------------------------*/

.success-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.success-list li {
  background-color: #2c2c2c;
  padding: 1rem;
  border-radius: 10px;
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 2px solid transparent;
  transition: transform 0.3s;
}

.success-icon {
  font-size: 2rem;
}

.success-unlocked {
  border-color: #ffc107;
  background-color: #333;
}

.success-locked {
  opacity: 0.5;
}

.success-unlocked:hover {
  transform: scale(1.02);
}


/*----------------------------------------------------------------------------------*/

/* Barre de progression des succès */
.progress-container {
  width: 100%;
  height: 18px;
  background-color: #444;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
  
  width: 0%;
  transition: width 0.6s ease;
  
}

.progress-text {
  text-align: right;
  font-size: 0.95rem;
  color: #ccc;
  margin-top: 4px;
}
/*----------------------------------------------------------------------------------*/

#user-level-section {
  margin-top: 2rem;
}

.xp-bar-container {
  width: 100%;
  height: 18px;
  background: #3a3a3a;
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  width: 0%;
  transition: width 0.5s ease-in-out;
}

#level-title {
  font-size: 1.1rem;
  color: #ffc107;
  margin-bottom: 6px;
  font-weight: bold;
}

.xp-text {
  text-align: right;
  font-size: 0.92rem;
  color: #ccc;
}
/*----------------------------------------------------------------------------------*/

.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.badge {
  background: #232323;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 0.8rem;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.2), 0 0 24px rgba(255, 193, 7, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: popInBadge 0.5s ease-out;
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.4), 0 0 28px rgba(255, 193, 7, 0.2);
}


@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.25);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 193, 7, 0.6);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.25);
  }
}

.badge.glow {
  animation: popInBadge 0.5s ease-out, pulseGlow 2.5s ease-in-out infinite;
}


.badge-icon {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  display: block;
}
.badge-title {
  font-weight: bold;
  color: #ffc107;
  font-size: 0.95rem;
}

@keyframes popInBadge {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.08) translateY(-6px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.badge {
  animation: popInBadge 0.5s ease-out;
}


.badge.locked {
  background: #1a1a1a;
  border: 2px solid #555;
  color: #888;
  opacity: 0.5;
  box-shadow: none;
  pointer-events: auto; /* ← essentiel pour permettre le survol */
  
}

.badge.locked:hover {
  cursor: help;
}


.badge.locked .badge-title {
  color: #999;
}

.badge.locked .badge-icon {
  font-size: 1.8rem;
}


.badge-icon[title]:hover,
.badge-title[title]:hover {
  filter: brightness(1.2);
  cursor: help;
}

.badge.locked:hover .badge-icon,
.badge.locked:hover .badge-title {
  filter: brightness(1.2);
}


/*----------------------------------------------------------------------------------*/

.badge {
  position: relative;
  cursor: pointer;
}

/* Info-bulle */
.tooltip {
  display: none;
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 20;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Survol sur ordinateur */
.badge:hover .tooltip {
  display: block;
}

/* Animation de fade-in */
.tooltip.show {
  display: block !important;
  opacity: 1;
}

/*-----------------------------------------------------------------------------------*/

.user-tag {
  display: inline-block;
  background: linear-gradient(45deg, #ffd700, #ff6b00);
  color: white;
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 20px;
  margin-left: 8px;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 15px rgba(255, 215, 0, 1); }
  100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
}

.hidden {
  display: none;
}


/*-----------------------------------------------------------------------------------*/

.account-security {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

#connection-history {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.connection-entry {
  padding: 8px;
  border-bottom: 1px solid #444;
}

/*------------------------------------------------------------------------------------*/




/* --- Responsive design --- */
@media screen and (max-width: 768px) {
  .user-nav ul {
    flex-direction: column;
    gap: 0.8rem;
  }

  .dashboard-container {
    padding: 1rem;
  
  }

  .stats {
    flex-direction: column;
    gap: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-box {
    width: 100%;
  }

  #reservation-filter {
    width: 100%;
  }

  .reservation-item button {
    width: auto;
  }
}
