/**
 * Settings Styles
 * Styles pour la page Paramètres
 */

/* Access Denied */
.access-denied {
  text-align: center;
  padding: 60px 20px;
}

.access-denied-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.access-denied h2 {
  color: var(--text-primary);
  margin-bottom: 12px;
}

.access-denied p {
  color: var(--text-secondary);
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
}

.settings-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.settings-tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.settings-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Settings Section */
.settings-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-color);
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-section-header h3 {
  color: var(--text-primary);
  font-size: 20px;
  margin: 0;
}

/* Users List */
.users-list {
  display: grid;
  gap: 16px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.user-card:hover {
  box-shadow: var(--shadow-md);
}

.user-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.user-card-email {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.user-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.user-card-phone {
  font-size: 13px;
  color: var(--text-tertiary);
}

.user-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Settings Category */
.settings-category {
  margin-bottom: 32px;
}

.settings-category h4 {
  color: var(--text-primary);
  font-size: 18px;
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.setting-description {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -4px;
}

.setting-field input[type="text"],
.setting-field input[type="number"],
.setting-field input[type="email"] {
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
}

.setting-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

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

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

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

input:checked + .slider {
  background-color: var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Settings Actions */
.settings-actions {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Providers List */
.providers-list {
  display: grid;
  gap: 16px;
}

.provider-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 2px solid var(--border-color);
  transition: all 0.2s;
}

.provider-card.active {
  border-color: var(--accent-green);
}

.provider-card.inactive {
  opacity: 0.6;
}

.provider-icon {
  font-size: 40px;
  flex-shrink: 0;
}

.provider-info {
  flex: 1;
}

.provider-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.provider-type {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.provider-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Import/Export Grid */
.import-export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.import-export-card {
  padding: 24px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.import-export-card .card-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.import-export-card h4 {
  color: var(--text-primary);
  font-size: 18px;
  margin-bottom: 12px;
}

.import-export-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-orange);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

/* Responsive */
@media (max-width: 768px) {
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  .settings-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .user-card {
    flex-direction: column;
    text-align: center;
  }
  
  .user-card-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .provider-card {
    flex-direction: column;
    text-align: center;
  }
  
  .provider-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .import-export-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .user-card,
[data-theme="dark"] .provider-card,
[data-theme="dark"] .import-export-card {
  background: var(--bg-tertiary);
}

/* Light Mode Adjustments */
[data-theme="light"] .user-card,
[data-theme="light"] .provider-card,
[data-theme="light"] .import-export-card {
  background: #ffffff;
}

/* Contrast Mode Adjustments */
[data-theme="contrast"] .user-card,
[data-theme="contrast"] .provider-card,
[data-theme="contrast"] .import-export-card {
  border: 2px solid #ffffff;
}

[data-theme="contrast"] .settings-tab.active {
  border-bottom-width: 4px;
}


/* ============================================
   MODALES
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: var(--color-bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-text-primary);
}

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

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

.modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--color-border-primary);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

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

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}

.form-control {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:disabled {
  background: var(--color-bg-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

select.form-control {
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ============================================
   THEME CARDS (Onglet Affichage)
   ============================================ */

.theme-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.theme-card {
  padding: 24px;
  background: var(--bg-tertiary, #334155);
  border: 2px solid var(--border-color, #475569);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-card:hover {
  border-color: var(--accent-blue, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-card.active {
  border-color: var(--accent-blue, #3b82f6);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 2px var(--accent-blue, #3b82f6);
}

.theme-card-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.theme-card-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 8px;
}

.theme-card-desc {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.4;
}

[data-theme="light"] .theme-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .theme-card:hover {
  border-color: #3b82f6;
}

[data-theme="light"] .theme-card.active {
  background: rgba(59, 130, 246, 0.05);
}

[data-theme="contrast"] .theme-card {
  border: 2px solid #ffffff;
}

[data-theme="contrast"] .theme-card.active {
  border-color: #4da6ff;
  box-shadow: 0 0 0 2px #4da6ff;
}
