/* ------------------ Global ------------------ */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f7f8fa;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ------------------ Header ------------------ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4f46e5;
    color: #fff;
    padding: 15px 25px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.header-actions button {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* ------------------ Sidebar ------------------ */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 220px;
    bottom: 0;
    background-color: #fff;
    border-right: 1px solid #eee;
    padding: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4f46e5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.nav-section-header {
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.nav-list {
    list-style: none;
    padding: 0;
}

.nav-item {
    margin-bottom: 10px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    padding: 10px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background-color: #f9f9fb;
}

.nav-item a:hover {
    background: linear-gradient(135deg, #d3ceff, #9f7fff);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 255, 0.3);
}

.nav-item.active a {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* ------------------ Main Content ------------------ */
.main-content {
    margin-left: 240px;
    padding: 30px 40px;
}

/* ----- Back to Home Button ----- */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 500;
    padding: 12px 22px;
    background: linear-gradient(135deg, #6b5bff 0%, #9f7fff 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(111, 66, 255, 0.4);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: linear-gradient(135deg, #9f7fff 0%, #6b5bff 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(111, 66, 255, 0.5);
}

/* ----- Heading ----- */
h1 {
    margin-bottom: 20px;
    color: #222;
}

/* ----- Cards ----- */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

.card-header {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subscription-status {
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
}

.status-inactive { background-color: #eee; color: #555; }
.status-active { background-color: #4f46e5; color: #fff; }

/* ------------------ Buttons ------------------ */
.action-button {
    background-color: #4f46e5;
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.action-button:hover {
    background-color: #4b41cd;
}

.btn-whatsapp { background-color: #25D366; }
.btn-whatsapp:hover { background-color: #1ebe57; }

/* ------------------ Billing History ------------------ */
#billing-history {
    max-height: 300px;
    overflow-y: auto;
}

#billing-history div {
    font-size: 0.95rem;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    border-radius: 8px;
}

#billing-history div:hover {
    background-color: #f3f0ff;
}

#billing-history p {
    margin: 0;
}

/* ------------------ Payment Method Box ------------------ */
.payment-method-box {
    border: 1px dashed #ccc;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    background-color: #fafafa;
    color: #555;
}

/* ------------------ Settings / Personal Info ------------------ */
.settings-section {
    background: #f9f9fb;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 15px;
}

.personal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.personal-info label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #2d3748;
}

.personal-info input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.personal-info input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
    outline: none;
}

/* ------------------ Responsive ------------------ */
@media(max-width: 768px){
    .sidebar { position: relative; width: 100%; height: auto; top: 0; }
    .main-content { margin-left: 0; padding: 20px; }
    .personal-info { grid-template-columns: 1fr; }
}

 /* =========================
   LearnFlow - Theme CSS
   - Lighter active color for top-level settings tabs
   - Compact "Personal Info" sections using .personal-info
   ========================= */

/* ===== Root variables ===== */
:root{
  --accent-color: #a16eff;      /* primary purple (text / accents) */
  --accent-strong: #a676ff;     /* slightly darker for contrast */
  --accent-light: #f6eefc;      /* very light accent background for tabs */
  --accent-hover: #efe0ff;      /* light hover */
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --muted: #666;
}

/* ===== Base Styles ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0; padding: 0;
  background-color: var(--bg);
  display: flex;
  min-height: 100vh;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 250px;
  background-color: var(--card-bg);
  color: #333;
  padding: 20px 0;
  border-right: 1px solid #ddd;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}
body.dark-mode .sidebar {
  background-color: #1f1f1f;
  color: #e0e0e0;
}
.user-info {
  padding: 0 20px 20px 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}
body.dark-mode .user-info { border-bottom-color: #333; }
.user-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: bold;
  margin-right: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ===== Navigation ===== */
.nav-section-header {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  padding: 5px 20px;
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-item a {
  display: flex; align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: #555;
  font-size: 15px;
  transition: background-color 0.25s, color 0.25s, transform 0.12s;
  border-radius: 8px;
  margin: 5px 15px;
}

/* subtle hover for sidebar items */
.nav-item a:hover {
  background-color: #fbf6ff;
  color: var(--accent-strong);
  transform: translateY(-2px);
}

/* active sidebar item (stays noticeable but not too heavy) */
.nav-item.active a {
  background-color: #f7f0ff;         /* very light purple background */
  color: var(--accent-strong);
  border-left: 3px solid var(--accent-color);
  font-weight: 600;
  padding-left: 17px;
}

/* ===== Back to Home Button ===== */
.back-link {
  display: block;
  margin: 10px 20px 20px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #7f5fff, #b785ff);
  color: #ffffff;
  font-weight: 500;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(159, 151, 185, 0.3);
  transition: all 0.25s ease;
}
.back-link:hover {
  background: linear-gradient(135deg, #9d5cf3, #c2a5ff);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(159, 151, 185, 0.45);
}

/* ===== Main Content ===== */
.main-content {
  flex-grow: 1;
  padding: 30px;
  background-color: var(--card-bg);
  margin: 20px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(124, 54, 255, 0.04);
  transition: background-color 0.3s;
}
body.dark-mode .main-content { background-color: #1e1e1e; }

/* ===== Settings Tabs (TOP-LEVEL: Settings, Billing, etc.) =====
   NOTE: These use a very LIGHT active color so they remain visible on white.
*/
.settings-tabs {
  border-bottom: 1px solid #e6e6e6;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-tab {
  padding: 9px 16px;         /* moderate size */
  margin-right: 6px;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s, transform 0.12s;
  background: transparent;
  border: 1px solid transparent;
}

/* Hover: mild tint */
.settings-tab:hover {
  background-color: var(--accent-hover);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

/* ACTIVE: light and soft so it doesn't look heavy on white */
.settings-tab.active {
  background-color: var(--accent-light);   /* very pale purple */
  color: var(--accent-strong);             /* purple text for contrast */
  font-weight: 600;
  border: 1px solid #eadcff;               /* faint border to define pill */
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

/* Optional small indicator under active (not heavy) */
.settings-tab.active::after {
  content: "";
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-strong));
  border-radius: 2px;
  margin-top: 8px;
  opacity: 0.18;
}

/* ===== Setting Groups =====
   Use .personal-info on the group container when you want compact rows
   Example in HTML:
   <div class="setting-group personal-info"> ... </div>
*/
.setting-group {
  margin-bottom: 36px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fcfcfc;
  transition: background-color 0.25s, border-color 0.25s;
}
body.dark-mode .setting-group { background-color: #2a2a2a; border-color: #444; color: #e0e0e0; }

/* Compact Personal Info variant */
.setting-group.personal-info {
  padding: 10px 14px;               /* much smaller padding for compact feel */
  border-radius: 6px;
  background-color: #ffffff;
}
body.dark-mode .setting-group.personal-info {
  background-color: #242424;
  border-color: #383838;
}

/* Heading inside groups */
.setting-group h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: var(--accent-strong);
  font-weight: 600;
}

/* ===== Form Rows =====
   Default (regular sections)
*/
.form-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s;
}
.form-setting:last-child { border-bottom: none; }
.form-setting:hover { background-color: #fbf6ff; }

/* Compact rows for personal-info groups:
   These will be applied automatically if the row is inside
   .setting-group.personal-info because of the next selector.
*/
.setting-group.personal-info .form-setting {
  padding: 6px 0;                    /* reduced vertical spacing */
  font-size: 14px;                   /* slightly smaller text */
  border-bottom: 1px solid #f4f4f4;
}
.setting-group.personal-info .form-setting:last-child { border-bottom: none; }
.setting-group.personal-info .form-setting:hover { background-color: transparent; }

/* Example: smaller inputs / labels alignment inside compact rows */
.setting-group.personal-info label {
  font-size: 14px;
  color: #444;
  margin-right: 12px;
}
.setting-group.personal-info .field {
  font-size: 14px;
  color: #222;
}

/* ===== Buttons ===== */
.button.delete {
  padding: 10px 15px;
  border: none;
  background-color: #dc3545;
  color: white;
  font-weight: 600;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.25s, transform 0.12s;
  margin-top: 16px;
}
.button.delete:hover {
  background-color: #b02a37;
  transform: translateY(-2px);
}

/* ===== Toggle Switch ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px; height: 24px;
}
.toggle-switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.3s; border-radius: 24px;
}
.slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: 0.3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
th {
  background-color: #faf5ff;
  color: var(--accent-strong);
}
tr:hover { background-color: #fbf7ff; }

/* ===== Highlight Sections ===== */
.danger-zone {
  border-color: #f8d7da;
  background-color: #fff0f0;
  padding: 15px;
  border-radius: 5px;
}

/* ===== Content Sections ===== */
.content-section { display: none; }
.content-section.active { display: block; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; }
  .main-content { margin: 10px; padding: 18px; }
  .settings-tab { padding: 8px 12px; font-size: 14px; }
}

