/* ========================================
   SYSTÈME DE PROFILS - YAPlayer v2
   ======================================== */

/* Variables */
:root {
  --profile-primary: #3b82f6;
  --profile-hover: #2563eb;
  --profile-bg: #f8fafc;
  --profile-border: #e2e8f0;
  --profile-text: #1e293b;
  --profile-shadow: rgba(0, 0, 0, 0.1);
}

/* Container principal sélection de profils */
.profile-selection-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-selection-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.profile-selection-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--profile-text);
  margin-bottom: 40px;
}

/* Grille de profils */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--profile-bg);
  border: 2px solid var(--profile-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.profile-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px var(--profile-shadow);
  border-color: var(--profile-primary);
}

.profile-card.locked::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 3px solid transparent;
  transition: border-color 0.3s ease;
}

.profile-card:hover .profile-avatar {
  border-color: var(--profile-primary);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--profile-text, #ffffff);
  text-align: center;
  word-wrap: break-word;
  max-width: 100%;
}

/* Bouton ajouter profil */
.add-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: transparent;
  border: 2px dashed var(--profile-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 180px;
}

.add-profile-card:hover {
  border-color: var(--profile-primary);
  background: var(--profile-bg);
}

.add-profile-icon {
  font-size: 48px;
  color: var(--profile-primary);
  margin-bottom: 8px;
}

.add-profile-text {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

/* Actions profils */
.profile-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--profile-border);
}

.profile-action-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-action-btn.primary {
  background: var(--profile-primary);
  color: white;
}

.profile-action-btn.primary:hover {
  background: var(--profile-hover);
}

.profile-action-btn.secondary {
  background: #f1f5f9;
  color: var(--profile-text);
}

.profile-action-btn.secondary:hover {
  background: #e2e8f0;
}

/* Modal création/édition de profil */
.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.profile-modal.show {
  opacity: 1;
  pointer-events: all;
}

.profile-modal-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.profile-modal.show .profile-modal-content {
  transform: scale(1);
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.profile-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--profile-text);
}

.profile-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.profile-modal-close:hover {
  background: #f1f5f9;
}

/* Formulaire de profil */
.profile-form-group {
  margin-bottom: 24px;
}

.profile-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--profile-text);
  margin-bottom: 8px;
}

.profile-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--profile-border);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.profile-form-input:focus {
  outline: none;
  border-color: var(--profile-primary);
}

/* Sélecteur d'icônes */
.icon-selector-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--profile-text);
  margin-bottom: 16px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.icon-option {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  overflow: hidden;
  background: var(--profile-bg);
}

.icon-option:hover {
  transform: scale(1.1);
  border-color: #cbd5e1;
}

.icon-option.selected {
  border-color: var(--profile-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.icon-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* PIN Code */
.pin-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pin-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.pin-toggle label {
  font-size: 14px;
  color: var(--profile-text);
  cursor: pointer;
}

.pin-input-section {
  display: none;
  padding: 16px;
  background: #fef3c7;
  border-radius: 8px;
  border-left: 4px solid #fbbf24;
}

.pin-input-section.show {
  display: block;
}

.pin-input-section .warning-text {
  font-size: 13px;
  color: #92400e;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  font-weight: 600;
  box-sizing: border-box;
}

.pin-input:focus {
  outline: none;
  border-color: #f59e0b;
}

/* Boutons du modal */
.profile-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.profile-modal-btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-modal-btn.primary {
  background: var(--profile-primary);
  color: white;
}

.profile-modal-btn.primary:hover {
  background: var(--profile-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.profile-modal-btn.secondary {
  background: #f1f5f9;
  color: var(--profile-text);
}

.profile-modal-btn.secondary:hover {
  background: #e2e8f0;
}

/* Modal PIN Entry */
.pin-entry-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pin-entry-modal.show {
  opacity: 1;
  pointer-events: all;
}

.pin-entry-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.pin-entry-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
  overflow: hidden;
}

.pin-entry-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pin-entry-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--profile-text);
  margin-bottom: 24px;
}

.pin-entry-input {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--profile-border);
  border-radius: 8px;
  font-size: 32px;
  letter-spacing: 16px;
  text-align: center;
  font-weight: 600;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.pin-entry-input:focus {
  outline: none;
  border-color: var(--profile-primary);
}

.pin-entry-input.error {
  border-color: #ef4444;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.pin-entry-error {
  color: #ef4444;
  font-size: 14px;
  margin-bottom: 16px;
  min-height: 20px;
}

.pin-entry-actions {
  display: flex;
  gap: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .profiles-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
  }
  
  .profile-avatar {
    width: 80px;
    height: 80px;
  }
  
  .profile-selection-title {
    font-size: 24px;
  }
  
  .icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  
  .icon-option {
    width: 60px;
    height: 60px;
  }
}




