/* Profile Settings Modal Styles */
.profile-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.profile-settings-modal.active {
  opacity: 1;
  visibility: visible;
}

.profile-settings-modal .modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  transform: scale(0.9);
  transition: all var(--transition-base);
}

.profile-settings-modal.active .modal-content {
  transform: scale(1);
}

.profile-settings-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
}

.profile-settings-modal .modal-header h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--font-size-4xl);
  cursor: pointer;
  color: var(--danger);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-base);
}

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

/* Profile Settings Tabs */
.profile-settings-tabs {
  display: flex;
  gap: 8px;
  background-color: var(--bg-secondary);
  padding: 10px;
  border-radius: 12px;
  width: fit-content;
  margin: 0 auto;
  border-bottom: none;
}

.profile-settings-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-tertiary);
  transition: width 0.3s ease-in-out, background-color var(--transition-base), color var(--transition-base);
  width: 40px;
  overflow: hidden;
  color: var(--text-secondary);
  border: none;
  font-size: var(--font-size-base);
  font-weight: 500;
  position: relative;
}

.profile-settings-tab:hover {
  width: 150px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.profile-settings-tab.active {
  width: 150px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

.profile-settings-tab i {
  font-size: 18px;
  flex-shrink: 0;
}

.profile-settings-tab span {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.3s ease-in-out;
  transform: translateX(-10px);
  min-width: 0;
}

.profile-settings-tab.active span,
.profile-settings-tab:hover span {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Profile Settings Content */
.profile-settings-content {
  min-height: 400px; /* Fixed height to prevent resizing */
  overflow-y: auto;
}

.profile-settings-tab-content {
  display: none;
  padding: var(--space-xl);
}

.profile-settings-tab-content.active {
  display: block;
}

.profile-section:last-child {
  margin-bottom: 0;
}

/* Profile Picture Display */
.profile-picture-display {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid var(--border-medium);
  position: relative;
  flex-shrink: 0;
}

.profile-picture-display i {
  font-size: 2.5rem;
  color: var(--text-secondary);
}

.profile-picture-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Profile Summary Card */
.profile-summary-card {
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(16, 185, 129, 0.05) 100%) !important;
  opacity: 0.9;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column; /* Stack content and buttons */
  align-items: center; /* Center children horizontally */
  gap: var(--space-lg);
}

.profile-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--warning) !important;
}

[data-theme="dark"] .profile-summary-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%) !important;
  opacity: 0.9;
}

[data-theme="dark"] .profile-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.profile-header-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  justify-content: center; /* Center content horizontally */
  width: 100%; /* Take full width */
}

.profile-action-buttons {
  display: flex;
  justify-content: center; /* Center buttons horizontally */
  gap: var(--space-sm);
  margin-top: var(--space-md);
  width: 50px; /* Ensure it takes full width for justify-content to work */
}

.profile-picture-actions .profile-picture-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 5px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-base);
}

.profile-picture-actions .profile-picture-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
}

.profile-picture-actions .profile-picture-btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

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

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

/* Toggle Switch */
.toggle-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  cursor: default;
}

.toggle-switch label:first-child {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
  cursor: default;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.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-tertiary);
  transition: var(--transition-base);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-base);
  border-radius: 50%;
}

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

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

/* Theme Options */
.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(99px, 1fr));
  gap: var(--space-md);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.theme-option[data-theme="system"] {
  background: linear-gradient(45deg, var(--bg-primary) 50%, var(--text-secondary) 50%);
  border-color: var(--border-medium);
}

.theme-option[data-theme="system"]:hover {
  background: linear-gradient(45deg, var(--bg-primary) 50%, var(--text-secondary) 50%);
}
.theme-option:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
}

.theme-option.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.theme-option[data-theme="light"] {
  background: #ffffff;
  color: #1f2937;
}

.theme-option[data-theme="dark"] {
  background: #1f2937;
  color: #ffffff;
}

.theme-option[data-theme="system"] {
  background: linear-gradient(45deg, #ffffff 50%, #1f2937 50%);
  color: #1f2937;
}

.theme-option i {
  font-size: var(--font-size-xl);
}

.theme-option span {
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.theme-option[data-theme="light"] i,
.theme-option[data-theme="light"] span {
  color: #f59e0b;
}

.theme-option[data-theme="dark"] i,
.theme-option[data-theme="dark"] span {
  color: #60a5fa;
}

.theme-option[data-theme="system"] i,
.theme-option[data-theme="system"] span {
  color: #6b7280;
}

/* Dark mode adjustments */
[data-theme="dark"] .profile-settings-modal .modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
}

[data-theme="dark"] .profile-settings-tab {
  background: var(--bg-primary);
}

[data-theme="dark"] .profile-settings-tab:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] .profile-settings-tab.active {
  background: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .profile-picture-display {
  border-color: var(--border-medium);
}

[data-theme="dark"] .profile-picture-btn {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

[data-theme="dark"] .profile-picture-btn:hover {
  background: var(--bg-primary);
}

[data-theme="dark"] .info-value {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .theme-option[data-theme="system"] {
  background: linear-gradient(45deg, var(--bg-primary) 50%, var(--text-secondary) 50%);
  border-color: var(--border-medium);
}

[data-theme="dark"] .theme-option[data-theme="light"] {
  background: var(--text-secondary);
}

[data-theme="dark"] .theme-option[data-theme="light"] {
  background: #f9fafb;
  color: #1f2937;
}

[data-theme="dark"] .theme-option[data-theme="dark"] {
  background: #111827;
  color: #ffffff;
}

[data-theme="dark"] .theme-option[data-theme="system"] {
  background: linear-gradient(45deg, #f9fafb 50%, #111827 50%);
  color: #6b7280;
}

[data-theme="dark"] .theme-option[data-theme="system"]:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .theme-option.active {
  background: var(--primary-dark);
  color: white;
}

@media (max-width: 768px) {
  .profile-settings-modal .modal-content {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100vw;
    height: calc(100vh - 64px);
    max-width: none;
    max-height: none;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .profile-settings-modal.active .modal-content {
    transform: translateX(0);
  }
  
  .profile-settings-modal.closing .modal-content {
    transform: translateX(100%);
  }
}

/* Override prefers-reduced-motion for profile settings modal */
@media (prefers-reduced-motion: reduce) {
  .profile-settings-modal .modal-content {
    transition-duration: 0.3s !important;
  }
}