/* -----------------------------------
   GLOBAL
----------------------------------- */
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: #fafafa;
  color: #222;
  transition: background 0.3s, color 0.3s;
}

/* Center the entire app */
#app {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* Light mode card colors */
:root {
  --card-1: #abdbfd; /* bright sky blue */
  --card-3: #b8f9be; /* bright mint green */
  --card-4: #fbdba8; /* bright apricot */
  --card-5: #f2b1fc; /* bright lilac */
  --card-6: #fce9a9; /* bright butter yellow */
  --card-7: #a2eef8; /* bright aqua */
  --card-2: #faa8c4; /* bright rose pink */

}

/* Dark mode card colors */
body.dark-mode {
  background: #121212;
  color: #eee;

  --card-1: #2a2438;
  --card-2: #1f2a38;
  --card-3: #382a24;
  --card-4: #24382a;
  --card-5: #38242f;
  --card-6: #2b2b3d;
  --card-7: #333333;
}

/* -----------------------------------
   HEADER — CLEAN, CONSOLIDATED
----------------------------------- */

header {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 100%;
  padding: 15px 0;

  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

/* Container to center content */
.header-container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* -----------------------------------
   LEFT SIDE — TITLE + DATE + TIMER
----------------------------------- */

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.header-left h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
}

.header-left .date {
  margin-top: 2px;
  font-size: 18px;
  opacity: 0.75;
}

/* -----------------------------------
   COUNTDOWN TIMER
----------------------------------- */

.header-timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.header-timer-label {
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.header-countdown {
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  opacity: 0.9;
}

body.dark-mode .header-countdown,
body.dark-mode .header-timer-label {
  color: var(--text-light);
  opacity: 1;
}

/* -----------------------------------
   RIGHT SIDE — CONTROLS
----------------------------------- */

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Icon / Profile Button */
.icon-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;

  background: var(--card);
  border: 1px solid var(--border);

  transition: background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

body.dark-mode .icon-btn {
  background: var(--card);
  color: var(--text-light);
}

/* -----------------------------------
   SUBHEADER BLACK BAR
----------------------------------- */
.subheader-bar {
  position: sticky;
  top: 60px; /* height of your header — adjust if needed */
  height: 16px; /* or whatever height you want */
  background: var(--card); /* matches your theme */
  width: 100%;
  border-bottom: 1px solid var(--border);
  z-index: 999; /* just under the header */
  position: sticky;
  top: 60px;          /* adjust if your header height changes */
  height: 8px;        /* a nice, bold horizontal bar */
  background: #000;   /* pure black */
  z-index: 999;
  padding-left: 100px;   /* match your header's horizontal padding */
  padding-right: 18px;  /* optional, for symmetry */
  box-sizing: border-box;
}

.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
}


/* -----------------------------------
   PAGE LAYOUT
----------------------------------- */
.page {
  display: none;
  padding: 24px 20px 40px;
}

.page.active {
  display: block;
}

.hidden {
  display: none;
}


/* -----------------------------------
   QUESTION CARDS
----------------------------------- */
.question-card {
  padding: 20px;
  border-radius: 16px;
  padding-left: 18px;   /* match header horizontal alignment */
  padding-right: 18px;  /* match header horizontal alignment */
  margin-left: auto;
  margin-right: auto;
  color: inherit;
  width: 100%;              /* fills the column */
  box-sizing: border-box;   /* ensures padding doesn’t break width */
  margin: 20px 0;           /* vertical spacing only */
}

.question-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 1;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


.question-card,
.result-card {
  max-width: 600px;   /* match header-container */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 18px;   /* match header horizontal alignment */
  padding-right: 18px;  /* match header horizontal alignment */
  box-sizing: border-box;
}

.choice-container {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.choice-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  position: relative;
}

.choice-btn.selected::before {
  content: "✔";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent, #8e4b9f); /* or whatever your theme uses */
}


.choice-btn.selected {
  background: #fdfdfd;
  color: #0d0d0d;
  font-weight: 700; /* bold */
}

.prompt {
  font-weight: 600; /* strong, clean bold */
  opacity: 0.9;
}


/* -----------------------------------
   RESULTS
----------------------------------- */
#results-screen {
  text-align: center;
  max-width: 600px;   /* match header-container */
  width: 100%;
  justify-content: space-between;
}

.results-btn,
.share-btn {
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: #7c7c7c;
  color: #fff;
  cursor: pointer;
  margin-top: 20px;
}

.result-item {
  margin-bottom: 16px;
}

/* -----------------------------------
   FOOTER
----------------------------------- */
footer {
  max-width: 600px;
  text-align: center;
  margin-top: 40px;
  opacity: 0.7;
}

/* -----------------------------------
   PROFILE PAGE
----------------------------------- */
.profile-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.profile-card {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
  justify-content: center;
}

body.dark-mode .profile-card {
  background: #1e1e1e;
  box-shadow: none;
  justify-content: center;
}

/* Avatar */
.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #4a90e2;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px;
}

.avatar-initial {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-color, #b9b8b8);
  color: white;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

/* If an image is used */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Profile Header */
.profile-header {
  margin-bottom: 24px;
}

.profile-subtitle {
  opacity: 0.7;
  font-size: 14px;
}

/* Profile Fields */
.profile-field-group {
  margin-bottom: 24px;
  text-align: left;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.profile-label {
  display: block;
  margin-bottom: 6px;
  opacity: 0.8;
}

.profile-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
}

body.dark-mode .profile-input {
  background: #2a2a2a;
  border-color: #444;
  color: #fff;
}

/* -----------------------------------
   PROFILE BUTTONS
----------------------------------- */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #4a90e2;
  color: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}

.secondary-btn {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #ddd;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}

body.dark-mode .secondary-btn {
  background: #333;
  color: #fff;
}

.profile-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}



/* -----------------------------------
   RESULTS COLLAPSIBLE
----------------------------------- */
#results-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  justify-content: space-between;
}

#results-collapse.open {
  max-height: 500px; /* enough to show all results */
  justify-content: center;
}

.results-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.chevron {
  transition: transform 0.3s ease;
}

.chevron.rotated {
  transform: rotate(180deg);
}




/* -----------------------------------
   SETTINGS BUTTON AND ICON
----------------------------------- */
.settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.settings-btn:hover {
  background: rgba(0,0,0,0.08);
}

.dark-mode .settings-btn:hover {
  background: rgba(255,255,255,0.1);
}

.gear-icon {
  font-size: 24px;
  line-height: 1;
}

/* Settings menu */
.settings-menu {
  position: fixed;
  top: 100px;      /* adjust to your layout */
  right: 460px;
  background: var(--card-bg, #fff);
  color: var(--text-color, #000);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  width: 240px;
  z-index: 1000;    /* above overlay */
}

/* Settings menu container */
.settings-menu {
  position: absolute;
  top: 60px; /* adjust based on your header */
  right: 20px;
  background: var(--card-bg, #fff);
  color: var(--text-color, #000);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  width: 200px;
  z-index: 100;
}

/* Optional: style the gear button */
.icon-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* -----------------------------------
   DARK MODE SWITCH IN SETTINGS
----------------------------------- */
.switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  background: #ccc;
  border-radius: 22px;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: 0.3s;
}

.slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background: #3b124f;
}

input:checked + .slider:before {
  transform: translateX(18px);
}


/* -----------------------------------
   HELP BUTTON AND ICON
----------------------------------- */
.help-button {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg, #fff);
  color: var(--text-color, #000);
  padding: 24px;
  border-radius: 12px;
  width: min(90%, 420px);
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Dark mode */
body.dark-mode .help-button {
  color: var(--text-color, #f2f2f2); /* soft white for dark mode */
}


/* -----------------------------------
   HISTORY BUTTON AND ICON
----------------------------------- */
.history-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.history-btn:hover {
  background: rgba(0,0,0,0.08);
}

.dark-mode .history-btn:hover {
  background: rgba(255,255,255,0.1);
}

.history-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  color: #222; /* dark gray for light mode */
}

/* Dark mode */
body.dark-mode .history-icon {
  color: #f2f2f2; /* soft white for dark mode */
}


/* -----------------------------------
   APP AND HIDDEN
----------------------------------- */

.app-column {
  max-width: 600px;   /* or whatever width your header uses */
  margin: 0 auto;     /* centers the entire column */
  padding: 0 16px;    /* optional: adds breathing room on mobile */
}

/* Hide by default */
.hidden {
  display: none;
}

/* Toggle row layout */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

/* Hidden utility class */
.hidden {
  display: none;
}