/* ================================================
   1. ROOT VARIABLES (Studio Black)
   ================================================ */
:root {
  --color-primary: #5a189a;
  --color-secondary: #ffc300;
  --color-background: #f4f7f9;
  --color-text: #333333;
  --color-soft-gray: #6b7280;
  --color-delete: #d32f2f;

  --bg-body: var(--color-background);
  --bg-glass-panel: rgba(255, 255, 255, 0.95);
  --bg-glass-card: #ffffff;
  --border-color: #e0e0e0;
  --shadow-glass: 0 8px 30px rgba(90, 24, 154, 0.05);

  --font-family-sans: 'Poppins', sans-serif;
  --border-radius-lg: 16px;
}

body.dark {
  --bg-body: #050505; 
  --bg-glass-panel: #141414; 
  --bg-glass-card: #1f1f1f;
  --color-text: #ffffff;
  --color-soft-gray: #a3a3a3;
  --border-color: #3c096c; 
  --color-secondary: #ffd60a; 
}

/* ================================================
   2. LAYOUT
   ================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-family-sans);
  background: var(--bg-body);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.settings-header {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.back-link {
  font-size: 2rem;
  color: var(--color-primary);
  text-decoration: none;
  margin-right: 15px;
  line-height: 1;
}
body.dark .back-link { color: var(--color-secondary); }

.settings-header h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--color-text);
}

/* Container */
.settings-container {
  background: var(--bg-glass-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-glass);
  width: 100%;
  max-width: 600px;
}
body.dark .settings-container { box-shadow: 0 0 20px rgba(90, 24, 154, 0.15); }

/* Sections */
.settings-section { margin-bottom: 30px; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
body.dark .section-title { color: var(--color-secondary); }

/* Items */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
}
.setting-item:last-child { border-bottom: none; }

.setting-text { display: flex; flex-direction: column; }
.setting-text span { font-weight: 600; font-size: 1rem; }
.setting-text small { color: var(--color-soft-gray); font-size: 0.8rem; margin-top: 2px; }

.setting-chevron { font-size: 1.2rem; color: var(--color-soft-gray); }

/* Logout Specific */
#logoutBtn { color: var(--color-delete); }
#logoutBtn small { color: rgba(220, 53, 69, 0.7); }

/* Toggles (Switches) */
.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: #ccc;
  transition: .4s; border-radius: 34px;
}
.slider:before {
  position: absolute; content: "";
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s; border-radius: 50%;
}

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

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

/* Modal */
.modal {
    display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
}
.modal-content {
    background-color: var(--bg-glass-card); border: 1px solid var(--border-color);
    padding: 25px; border-radius: 16px; width: 85%; max-width: 320px;
    text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }
.modal-buttons button {
    flex: 1; padding: 12px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer;
}
.cancel { background: #e0e0e0; color: #333; }
.create { background: var(--color-delete); color: white; }
