/* ============================================
   BENTO GRID - PROFILE (Profil Utilisateur)
   Modern Bento Grid design inspired by owners-bento.css
   Based on DESIGN_SPECS_PROFILE_BENTO.md
   ============================================ */

:root {
  /* Couleurs principales Loyr */
  --profile-lime: #A8E34F;
  --profile-lime-light: #E8FFB7;
  --profile-lime-dark: #7FC73E;
  --profile-green: #00D97A;
  --profile-green-dark: #00A85E;
  --profile-forest: #0A1A16;
  --profile-forest-light: #0f2621;
  --profile-forest-dark: #061110;

  /* Gris */
  --profile-gray-50: #F9FAFB;
  --profile-gray-100: #F3F4F6;
  --profile-gray-200: #E5E7EB;
  --profile-gray-300: #D1D5DB;
  --profile-gray-400: #9CA3AF;
  --profile-gray-500: #6B7280;
  --profile-gray-600: #4B5563;
  --profile-gray-700: #374151;
  --profile-gray-800: #1F2937;
  --profile-gray-900: #111827;

  /* États */
  --profile-success: #10B981;
  --profile-warning: #F59E0B;
  --profile-danger: #EF4444;
  --profile-info: #3B82F6;
}

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */

#profileView {
  min-height: 100vh;
  background: var(--profile-gray-50);
  padding: 2rem 0;
}

.profile-bento-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
}

/* ============================================
   EN-TÊTE PROFIL
   ============================================ */

.profile-header-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(10, 26, 22, 0.08);
  border: 1px solid var(--profile-gray-200);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  animation: fadeIn 0.4s ease-out forwards;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--profile-lime-light) 0%, var(--profile-green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(10, 26, 22, 0.15);
  position: relative;
}

.profile-avatar-initials {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--profile-forest);
  letter-spacing: -0.02em;
}

.profile-verification-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--profile-success);
  border-radius: 50%;
  border: 4px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   STATISTIQUES (KPIs)
   ============================================ */

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(10, 26, 22, 0.08);
  border: 1px solid var(--profile-gray-200);
  transition: all 0.3s ease;
  animation: fadeIn 0.4s ease-out forwards;
}

.profile-stat-card:nth-child(1) { animation-delay: 0s; }
.profile-stat-card:nth-child(2) { animation-delay: 0.1s; }
.profile-stat-card:nth-child(3) { animation-delay: 0.2s; }
.profile-stat-card:nth-child(4) { animation-delay: 0.3s; }

.profile-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -6px rgba(0, 0, 0, 0.15);
  border-color: var(--profile-lime);
}

.profile-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.profile-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--profile-gray-900);
  margin-bottom: 0.25rem;
}

.profile-stat-label {
  font-size: 0.875rem;
  color: var(--profile-gray-600);
}

/* ============================================
   ONGLETS NAVIGATION
   ============================================ */

.profile-tabs-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(10, 26, 22, 0.08);
  border: 1px solid var(--profile-gray-200);
  margin-bottom: 2rem;
  overflow: hidden;
}

.profile-tabs-container {
  display: flex;
  border-bottom: 1px solid var(--profile-gray-200);
  padding: 0 1.5rem;
}

.profile-tab-button {
  padding: 1rem 1.5rem;
  border-bottom: 3px solid transparent;
  color: var(--profile-gray-600);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.profile-tab-button:hover {
  color: var(--profile-lime-dark);
  background: var(--profile-gray-50);
}

.profile-tab-button.active {
  color: var(--profile-lime);
  border-bottom-color: var(--profile-lime);
  font-weight: 600;
}

.profile-tab-button i {
  font-size: 1rem;
}

/* ============================================
   CONTENU DES ONGLETS
   ============================================ */

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out forwards;
}

.profile-content-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(10, 26, 22, 0.08);
  border: 1px solid var(--profile-gray-200);
  margin-bottom: 1.5rem;
}

/* ============================================
   FORMULAIRES
   ============================================ */

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-form-field {
  display: flex;
  flex-direction: column;
}

.profile-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--profile-gray-700);
  margin-bottom: 0.5rem;
}

.profile-form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--profile-gray-300);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
  outline: none;
}

.profile-form-input:focus {
  border-color: var(--profile-lime);
  box-shadow: 0 0 0 3px rgba(168, 227, 79, 0.1);
}

.profile-form-input:disabled {
  background: var(--profile-gray-50);
  cursor: not-allowed;
}

/* ============================================
   BOUTONS
   ============================================ */

.profile-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-btn-primary {
  background: var(--profile-lime);
  color: var(--profile-forest);
}

.profile-btn-primary:hover {
  background: var(--profile-lime-dark);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(168, 227, 79, 0.4);
}

.profile-btn-secondary {
  background: var(--profile-gray-200);
  color: var(--profile-gray-700);
}

.profile-btn-secondary:hover {
  background: var(--profile-gray-300);
}

.profile-btn-info {
  background: var(--profile-info);
  color: white;
}

.profile-btn-info:hover {
  background: #2563eb;
}

.profile-btn-danger {
  background: var(--profile-danger);
  color: white;
}

.profile-btn-danger:hover {
  background: #dc2626;
}

/* ============================================
   BADGES
   ============================================ */

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.profile-badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.profile-badge-green {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.profile-badge-red {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.profile-badge-orange {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

/* ============================================
   TOGGLE SWITCH (Préférences)
   ============================================ */

.profile-toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
}

.profile-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--profile-gray-200);
  transition: 0.4s;
  border-radius: 34px;
}

.profile-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.profile-toggle input:checked + .profile-toggle-slider {
  background-color: var(--profile-lime);
}

.profile-toggle input:checked + .profile-toggle-slider:before {
  transform: translateX(28px);
}

/* ============================================
   ITEMS DE SESSION / ACTIVITÉ
   ============================================ */

.profile-session-item,
.profile-activity-item {
  display: flex;
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  background: var(--profile-gray-50);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: background 0.2s ease;
}

.profile-session-item:hover,
.profile-activity-item:hover {
  background: var(--profile-gray-100);
}

.profile-session-icon,
.profile-activity-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}

.animate-fade-in-1 { animation-delay: 0s; }
.animate-fade-in-2 { animation-delay: 0.1s; }
.animate-fade-in-3 { animation-delay: 0.2s; }
.animate-fade-in-4 { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .profile-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .profile-bento-container {
    padding: 1rem;
  }
  
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-header-card .flex {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-tabs-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .profile-tab-button {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .profile-tab-button span {
    display: none;
  }
  
  .profile-tab-button {
    justify-content: center;
    min-width: 60px;
  }
}

/* ============================================
   ALERTE / INFO BOX
   ============================================ */

.profile-alert {
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.profile-alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.profile-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.profile-alert-icon {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.profile-alert-content {
  flex: 1;
}

.profile-alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.profile-alert-message {
  font-size: 0.875rem;
  color: var(--profile-gray-700);
}
