/* ============================================================
   PAGE PROFIL - Profil utilisateur
   ============================================================ */

/* Container principal */
.profil-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg, 24px);
  padding-bottom: 60px; /* Espace supplémentaire avant le footer */
  background-color: transparent;
}

/* Header avec avatar */
.profil-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  text-align: center;
}

.profil-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

/* Avatar wrapper pour le hover */
.avatar-wrapper {
  position: relative;
  display: inline-block;
  text-decoration: none;
}

.profil-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profil-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(2, 123, 154, 0.4);
}

/* Overlay sur l'avatar avec icône + */
.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay i {
  color: white;
  font-size: 24px;
}

/* Grille d'informations utilisateur */
.profil-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.profil-info-block {
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profil-info-block h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profil-info-block h3 i {
  color: var(--color-primary, #027b9a);
  font-size: 1.1rem;
}

.profil-info-block p {
  margin: 0;
  color: #506070;
  font-size: 0.95rem;
}

/* Grille des sections principales */
.profil-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

/* Sections (Paramètres, Activité, Sécurité) */
.profil-section {
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  height: 100%;
}

.profil-section-full {
  margin-bottom: 24px;
}

.profil-section h2 {
  margin: 0 0 20px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  border-bottom: 2px solid #e6edf5;
  padding-bottom: 12px;
}

.profil-section .custom-button {
  margin-right: 12px;
  margin-bottom: 12px;
}

/* Grille OAuth pour les comptes liés */
.profil-oauth-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

/* Boutons spéciaux */
.btn-google {
  background-color: #4285f4 !important;
  color: white !important;
}

.btn-google:hover {
  background-color: #357ae8 !important;
}

.btn-discord {
  background-color: #5865f2 !important;
  color: white !important;
}

.btn-discord:hover {
  background-color: #4752c4 !important;
}

.btn-retour {
  background-color: #dc2626 !important;
  color: white !important;
}

.btn-retour:hover {
  background-color: #b91c1c !important;
}

/* Responsive */
@media (max-width: 968px) {
  .profil-sections-grid {
    grid-template-columns: 1fr;
  }

  .profil-oauth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .profil-container {
    padding: var(--spacing-md, 16px);
  }

  .profil-header h1 {
    font-size: 1.5rem;
  }

  .profil-info {
    grid-template-columns: 1fr;
  }

  .profil-section {
    padding: 16px;
  }

  .profil-section .custom-button {
    display: block;
    width: 100%;
    margin-right: 0;
    margin-bottom: 12px;
  }
}

/* ============================================================
   PAGE PRÉFÉRENCES - Styles pour la gestion des préférences
   ============================================================ */

/* Description de section */
.section-description {
  color: #506070;
  font-size: 0.95rem;
  margin: 0 0 20px 0;
}

/* Grille des préférences (checkboxes) */
.preferences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* Grille des préférences radio (média audio/vidéo) */
.preferences-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

/* Radio button personnalisé */
.preference-radio {
  position: relative;
  display: block;
  cursor: pointer;
  background: #fff;
  border: 3px solid #e6edf5;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.preference-radio:hover {
  border-color: #027b9a;
  box-shadow: 0 4px 12px rgba(2, 123, 154, 0.15);
  transform: translateY(-2px);
}

.preference-radio.active,
.preference-radio:has(input:checked) {
  border-color: #027b9a;
  background: linear-gradient(135deg, #f0f9fb 0%, #e8f4f8 100%);
  box-shadow: 0 6px 16px rgba(2, 123, 154, 0.2);
}

.preference-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.radio-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  user-select: none;
}

.preference-radio.active .radio-label,
.preference-radio:has(input:checked) .radio-label {
  color: #027b9a;
}


/* Checkbox personnalisée */
.preference-checkbox {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafb;
  border: 2px solid #e6edf5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preference-checkbox:hover {
  background: #f0f4f8;
  border-color: #027b9a;
}

.preference-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0 12px 0 0;
  cursor: pointer;
  accent-color: #027b9a;
}

.preference-checkbox .checkbox-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  user-select: none;
}

.preference-checkbox input[type="checkbox"]:checked + .checkbox-label {
  color: #027b9a;
  font-weight: 600;
}

/* Options avec switch */
.preference-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e6edf5;
}

.preference-option:last-child {
  border-bottom: none;
}

.preference-option strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}

.option-description {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Switch toggle */
.preference-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.preference-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.preference-switch input:checked + .slider {
  background-color: #027b9a;
}

.preference-switch input:checked + .slider:before {
  transform: translateX(24px);
}

.preference-switch input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(2, 123, 154, 0.2);
}

/* Boutons d'action du formulaire */
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background-color: #027b9a !important;
  color: white !important;
}

.btn-primary:hover {
  background-color: #026280 !important;
}

.btn-secondary {
  background-color: #6b7280 !important;
  color: white !important;
}

.btn-secondary:hover {
  background-color: #4b5563 !important;
}

/* Message de confirmation */
.message {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 500;
}

.message.success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

.message.error {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

/* Responsive préférences */
@media (max-width: 768px) {
  .preferences-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .custom-button {
    width: 100%;
    margin: 0 0 12px 0;
  }

  .preference-option {
    flex-direction: column;
    gap: 12px;
  }
}
