/* ===========================================================================
   FitJourney Settings Page CSS - Clean, Streamlined Layout
   =========================================================================== */

:root {
  --primary: #6a1b9a;
  --accent: #ff6f00;
  --dark-bg: #1c1c1c;
  --darker-bg: #121212;
  --card-bg: #1e1e1e;
  --elevated-bg: #242424;
  --text-color: #e0e0e0;
  --light-text: #b0b0b0;
  --success: #4caf50;
  --warning: #ffc107;
  --error: #f44336;
  --border-radius: 12px;
  --transition: 0.3s;
  --sidebar-width: 280px;
}

body {
  background: var(--darker-bg);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

.settings-main {
  min-height: 100vh;
  background: var(--darker-bg);
  padding-bottom: 2rem;
}

/* Profile Header Section */
.settings-profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 3rem 0 2rem 0;
  margin-bottom: 2rem;
}

.profile-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  color: white;
}

.profile-avatar-section {
  flex-shrink: 0;
}

.avatar-large {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 4px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.btn-avatar-edit {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-avatar-edit:hover {
  background: #e65c00;
}

.profile-info-section {
  flex: 1;
}

.profile-info-section h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.5rem;
  font-weight: 700;
}

.profile-info-section p {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  opacity: 0.9;
}

.user-status {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-stats-section {
  display: flex;
  gap: 2rem;
}

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

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Settings Layout */
.settings-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* Settings Sidebar */
.settings-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem 0;
  position: sticky;
  top: 2rem;
}

.settings-nav {
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: var(--light-text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 111, 0, 0.1);
  color: var(--accent);
}

.nav-item.active {
  background: rgba(255, 111, 0, 0.15);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item i {
  font-size: 1.2rem;
}

/* Settings Content */
.settings-content {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  min-height: 600px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333;
}

.section-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
}

.section-header p {
  margin: 0;
  color: var(--light-text);
  font-size: 1rem;
}

/* Forms */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

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

.form-group label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #333;
  background: var(--elevated-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.2s;
}

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

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* File Upload */
.file-upload-area {
  position: relative;
  border: 2px dashed #333;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--accent);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--light-text);
}

.file-upload-text i {
  font-size: 2rem;
  color: var(--accent);
}

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

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

.btn-primary:hover {
  background: #e65c00;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
}

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

.btn-danger:hover {
  background: #d32f2f;
}

.btn-outline-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
}

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

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Security Options */
.security-options {
  margin-top: 2rem;
}

.security-options h3 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  color: var(--text-color);
}

/* Preference Groups */
.preference-groups {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.preference-group {
  padding: 1.5rem;
  background: var(--elevated-bg);
  border-radius: 8px;
}

.preference-group h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text-color);
}

/* Option Groups */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.option-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.option-title {
  font-weight: 500;
  color: var(--text-color);
}

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

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: 0.3s;
  border-radius: 24px;
}

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

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

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

/* Integrations */
.integrations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.integration-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background: var(--elevated-bg);
  border-radius: 8px;
  border: 1px solid #333;
  transition: border-color 0.2s;
}

.integration-card.connected {
  border-color: var(--success);
  background: rgba(76, 175, 80, 0.05);
}

.integration-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.integration-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.integration-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-color);
}

.integration-details p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--light-text);
}

/* Data Options */
.data-options {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.data-group {
  padding: 1.5rem;
  background: var(--elevated-bg);
  border-radius: 8px;
}

.data-group.danger-zone {
  border: 1px solid var(--error);
  background: rgba(244, 67, 54, 0.05);
}

.data-group h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.2rem;
  color: var(--text-color);
}

.data-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.data-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.action-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-info i {
  font-size: 1.5rem;
  color: var(--accent);
}

.action-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: var(--text-color);
}

.action-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--light-text);
}

/* Header Styles */
.dashboard-header {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(106, 27, 154, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo img {
  height: 40px;
  width: 40px;
  border-radius: 8px;
  margin-right: 0.75rem;
  object-fit: cover;
}

.top-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.top-nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.15s;
  font-weight: 500;
}

.top-nav a:hover,
.top-nav a.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle button {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  padding: 0.3rem;
  transition: background 0.2s;
}

.theme-toggle button:hover {
  background: rgba(255,255,255,0.12);
}

.user-profile {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  color: white;
  font-weight: bold;
  overflow: hidden;
}

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

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  min-width: 200px;
  z-index: 2000;
  padding: 0.5rem 0;
}

.user-profile.active .user-dropdown-menu {
  display: block;
}

.user-dropdown-menu a {
  display: block;
  padding: 0.7rem 1.25rem;
  color: var(--text-color);
  text-decoration: none;
}

.user-dropdown-menu a:hover {
  background: rgba(255, 111, 0, 0.15);
  color: var(--accent);
}

/* Footer Styles */
.dashboard-footer {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  padding: 2rem 0 1rem 0;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-logo img {
  height: 36px;
  width: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.footer-logo span {
  font-size: 1.2rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-social {
  display: flex;
  gap: 0.7rem;
}

.footer-social a {
  color: white;
  font-size: 1.5rem;
  transition: color 0.2s;
}

.footer-social a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  margin-top: 1.5rem;
  color: #fff;
  font-size: 0.95rem;
  opacity: 0.8;
  padding: 0 2rem;
}

/* Light Mode Styles */
body.light-mode {
  background: #f8fafc;
 
}

body.light-mode .settings-main,
body.light-mode .settings-content,
body.light-mode .settings-sidebar,
body.light-mode .settings-profile-header,
body.light-mode .preference-group,
body.light-mode .data-group,
body.light-mode .integration-card,
body.light-mode .option-item,
body.light-mode .data-action-item {
  background: #fff;
  color: #1a202c;
  box-shadow: 0 2px 12px rgba(106, 27, 154, 0.06);
}

body.light-mode .dashboard-header,
body.light-mode .dashboard-footer {
  background: linear-gradient(90deg, #f2cfff, #ffe0b2);
  color: #1a202c;
}

body.light-mode .header-container .logo,
body.light-mode .footer-logo span,
body.light-mode .footer-links a,
body.light-mode .footer-social a {
  color: #6a1b9a;
}

body.light-mode .top-nav a,
body.light-mode .top-nav a.active {
  color: #6a1b9a;
  background: rgba(255, 111, 0, 0.08);
}

body.light-mode .top-nav a:hover {
  background: #ffe0b2;
  color: #ff6f00;
}

body.light-mode .user-profile,
body.light-mode .avatar,
body.light-mode .avatar-large {
  background: #f2cfff;
  color: #6a1b9a;
}

body.light-mode .user-dropdown-menu,
body.light-mode .dropdown-menu {
  background: #fff;
  color: #1a202c;
  box-shadow: 0 4px 16px rgba(106, 27, 154, 0.08);
}

body.light-mode .user-dropdown-menu a,
body.light-mode .dropdown-menu a {
  color: #1a202c;
}

body.light-mode .user-dropdown-menu a:hover,
body.light-mode .dropdown-menu a:hover {
  background: #ffe0b2;
  color: #ff6f00;
}

body.light-mode .settings-sidebar {
  border: 1px solid #eee;
}

body.light-mode .nav-item {
  color: #6a1b9a;
  background: none;
}
body.light-mode .nav-item.active {
  background: #ffe0b2;
  color: #ff6f00;
  border-left-color: #ff6f00;
}

body.light-mode .settings-form input,
body.light-mode .settings-form select,
body.light-mode .settings-form textarea {
  background: #f8fafc;
  color: #1a202c;
  border: 1px solid #ddd;
}
body.light-mode .settings-form input:focus,
body.light-mode .settings-form select:focus,
body.light-mode .settings-form textarea:focus {
  border-color: #ff6f00;
}

body.light-mode .btn-primary {
  background: #ff6f00;
  color: #fff;
}
body.light-mode .btn-primary:hover {
  background: #e65c00;
}
body.light-mode .btn-secondary {
  background: transparent;
  color: #ff6f00;
  border: 1px solid #ff6f00;
}
body.light-mode .btn-secondary:hover {
  background: #ff6f00;
  color: #fff;
}
body.light-mode .btn-danger {
  background: #f44336;
  color: #fff;
}
body.light-mode .btn-danger:hover {
  background: #b71c1c;
}
body.light-mode .btn-outline-danger {
  background: transparent;
  color: #f44336;
  border: 1px solid #f44336;
}
body.light-mode .btn-outline-danger:hover {
  background: #f44336;
  color: #fff;
}

body.light-mode .option-item,
body.light-mode .data-action-item {
  background: #f8fafc;
  color:black
}

body.light-mode .preference-group,
body.light-mode .data-group {
  background: #f8fafc;
  color: black;
}

body.light-mode .integration-card {
  background: #f8fafc;
  border: 1px solid #eee;
}
body.light-mode .integration-card.connected {
  border-color: #4caf50;
  background: #e8f5e9;
}

body.light-mode .toggle-switch .slider {
  background: #ddd;
  color: black;
}
body.light-mode .toggle-switch input:checked + .slider {
  background: #ff6f00;
}
body.light-mode .toggle-switch .slider:before {
  background: #fff;
}

body.light-mode .section-header h2 {
  color: #ff6f00;
}
body.light-mode .section-header p {
  color: #6a1b9a;
}

body.light-mode .user-status {
  background: #e8f5e9;
  color: #388e3c;
  border: 1px solid #a5d6a7;
}

body.light-mode .stat-item {
  color: #6a1b9a;
}
body.light-mode .stat-value {
  color: #ff6f00;
}

body.light-mode .settings-message.success {
  background: #e8f5e9;
  color: #388e3c;
}
body.light-mode .settings-message.error {
  background: #ffebee;
  color: #d32f2f;
}
body.light-mode .settings-message.info {
  background: #fff3e0;
  color: #ff6f00;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .profile-header-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  
  .profile-stats-section {
    justify-content: center;
  }
  
  .settings-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .settings-sidebar {
    width: 100%;
    position: static;
  }
  
  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 1rem;
  }
  
  .nav-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  
  .nav-item.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 768px) {
  .settings-layout {
    padding: 0 1rem;
  }
  
  .settings-content {
    padding: 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .profile-stats-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .profile-header-content {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .settings-nav {
    flex-direction: column;
  }
  
  .nav-item {
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  
  .nav-item.active {
    border-bottom: none;
    border-left-color: var(--accent);
  }
  
  .profile-stats-section {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

/* Light mode scrollbar */
body.light-mode ::-webkit-scrollbar-track {
  background: #f8fafc;
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6a1b9a, #ff6f00);
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff6f00, #6a1b9a);
}