/* Profile Page Styles */

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE HEADER CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.profile-main {
  padding-top: var(--space-md);
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--state-active) 0%, var(--state-recommendation) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--brand-white);
  flex-shrink: 0;
}

.profile-header-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--state-active);
}

.profile-tier-badge.level-1 .tier-dot { background: #4CAF50; }
.profile-tier-badge.level-2 .tier-dot { background: #2196F3; }
.profile-tier-badge.level-3 .tier-dot { background: #9C27B0; }

.tier-text {
  color: var(--text-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.profile-section {
  margin-bottom: var(--space-lg);
}

.profile-section .section-header {
  margin-bottom: var(--space-sm);
}

.profile-section .section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.edit-btn {
  font-size: 0.75rem;
  color: var(--state-recommendation);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.edit-btn:hover {
  background: rgba(42, 123, 123, 0.1);
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INFO ROWS
   ═══════════════════════════════════════════════════════════════════════════ */

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.875rem;
  color: var(--text);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOGGLE SWITCHES
   ═══════════════════════════════════════════════════════════════════════════ */

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.toggle-row.last {
  border-bottom: none;
}

.toggle-info {
  flex: 1;
  padding-right: var(--space-md);
}

.toggle-label {
  display: block;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 2px;
}

.toggle-description {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 28px;
  transition: all 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--state-active);
  border-color: var(--state-active);
}

.toggle-switch input:checked + .toggle-slider::before {
  background-color: var(--brand-white);
  transform: translateX(20px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VOICE CUSTOMIZATION
   ═══════════════════════════════════════════════════════════════════════════ */

.voice-card {
  padding: var(--space-md);
}

.voice-intro {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.voice-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.voice-option {
  display: block;
  cursor: pointer;
}

.voice-option input {
  display: none;
}

.voice-option-content {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all 0.2s;
}

.voice-option:hover .voice-option-content {
  border-color: var(--text-muted);
}

.voice-option.selected .voice-option-content,
.voice-option input:checked + .voice-option-content {
  border-color: var(--state-active);
  background: rgba(74, 111, 165, 0.1);
}

.voice-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.voice-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
}

.voice-option[data-voice="strict"] .voice-icon {
  color: var(--state-escalation);
}

.voice-option[data-voice="minimal"] .voice-icon {
  color: var(--text-muted);
}

.voice-option[data-voice="warm"] .voice-icon {
  color: var(--state-stable);
}

.voice-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.voice-description {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

.voice-example {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-sm);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}

.stat-item {
  background: var(--bg-card);
  padding: var(--space-md);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCOUNT ACTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.account-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.btn-block {
  width: 100%;
}

.btn-outline-muted {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 12px 16px;
}

.btn-outline-muted:hover {
  background: var(--bg-card);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.text-muted {
  color: var(--text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EDIT MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.edit-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.edit-modal.active {
  display: flex;
}

.edit-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.edit-modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.close-modal-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal-btn:hover {
  background: var(--bg-input);
  color: var(--text);
}

.edit-form {
  padding: var(--space-md);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--state-active);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER TITLE (for Profile page)
   ═══════════════════════════════════════════════════════════════════════════ */

.header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .profile-header-card {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .profile-header-info {
    width: 100%;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .voice-option-content {
    padding: var(--space-sm);
  }

  .voice-example {
    font-size: 0.6875rem;
  }
}
