/* Update color variables first (add to :root in style.css if not present) */
:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #48bb78;
  --danger-color: #f56565;
  --warning-color: #ed8936;
  --info-color: #4299e1;
  --text-color: #2d3748;
  --text-light: #718096;
  --text-dark: #1a202c;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --neutral-dark: #2d3748;
  --neutral-gray: #718096;
  --neutral-light: #a0aec0;
}

/* Page Header */

.page-header {
  padding: 3rem 0 2rem;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(0, 201, 183, 0.05),
    rgba(123, 97, 255, 0.05)
  );
  border-radius: 0 0 30px 30px;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--neutral-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--neutral-gray);
  max-width: 600px;
  margin: 0 auto;
}

/* Profile Container */
.profile-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Sidebar - CHANGED BACKGROUND TO LIGHT COLOR */
.profile-sidebar {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; /* CHANGED TO WHITE FOR BETTER CONTRAST */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  border: 4px solid var(--bg-white);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark); /* DARKER COLOR FOR BETTER VISIBILITY */
  margin-bottom: 0.25rem;
}

.profile-email {
  color: var(--neutral-gray);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.profile-meta {
  width: 100%;
  margin-bottom: 1.5rem;
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-light);
}

.meta-item:last-child {
  border-bottom: none;
}

.meta-item i {
  width: 20px;
  color: var(--primary-color);
}

.meta-item strong {
  color: var(--text-dark);
  font-weight: 600;
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin: 1.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.stat-value.success {
  color: var(--success-color);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Profile Content - CHANGED BACKGROUND TO WHITE */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-section {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dark);
  font-size: 1.3rem;
}

/* Form Styles */
.profile-form {
  margin-top: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-white);
  color: var(--text-dark); /* ADDED TEXT COLOR */
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
  background-color: var(--bg-light);
  color: var(--text-light);
  cursor: not-allowed;
}

/* Security Settings */
.security-settings {
  margin-top: 1rem;
}

.password-strength {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.strength-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.strength-bar {
  height: 6px;
  background-color: #eaeaea;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  background: var(--danger-color); /* Default color */
}

.strength-fill.weak {
  background: var(--danger-color);
}
.strength-fill.fair {
  background: var(--warning-color);
}
.strength-fill.good {
  background: #4299e1;
}
.strength-fill.strong {
  background: var(--success-color);
}

.strength-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
}

/* Notification Settings */
.notification-settings {
  margin-top: 1rem;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-info {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.notification-description {
  font-size: 0.9rem;
  color: var(--text-light);
}

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

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

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

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

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

input:focus + .slider {
  box-shadow: 0 0 1px var(--success-color);
}

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

input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Data Management */
.data-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--border-color);
}

.action-card.danger {
  background: rgba(245, 101, 101, 0.05);
  border: 1px solid rgba(245, 101, 101, 0.2);
}

.action-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}

.action-icon.export {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.action-icon.import {
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
}

.action-icon.delete {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.action-content {
  flex: 1;
}

.action-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.action-description {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Button Styles - FIXED TEXT COLORS */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white; /* CHANGED TO WHITE FOR BETTER CONTRAST */
}

.btn-primary:hover:not(:disabled) {
  background-color: #5a67d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background-color: #718096;
  color: white; /* CHANGED TO WHITE FOR BETTER CONTRAST */
}

.btn-secondary:hover:not(:disabled) {
  background-color: #4a5568;
  transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
  background-color: #e53e3e;
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 1.5rem;
  color: var(--text-color);
}

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

/* Avatar Upload */
.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.avatar-preview {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-color);
  overflow: hidden;
  border: 3px solid var(--border-color);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-input {
  display: none;
}

.avatar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  color: var(--text-dark);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.avatar-label:hover {
  background: #e2e8f0;
}

/* Success States */
.success-badge {
  background: rgba(72, 187, 120, 0.1);
  color: var(--success-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Warning States */
.warning-badge {
  background: rgba(237, 137, 54, 0.1);
  color: var(--warning-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .profile-container {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    order: 2;
  }

  .profile-content {
    order: 1;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 2rem 0;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .action-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .notification-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .modal-content {
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .profile-avatar {
    width: 100px;
    height: 100px;
    font-size: 2rem;
  }

  .profile-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-item {
    padding: 0.5rem 0;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* Additional improvements for text visibility */
.profile-sidebar *,
.profile-section * {
  color: inherit; /* Ensures text inherits proper colors */
}

/* Ensure all text is visible in form controls */
input::placeholder,
textarea::placeholder {
  color: var(--neutral-light);
}

/* Make sure select options are visible */
select option {
  background: var(--bg-white);
  color: var(--text-dark);
}
