/* ===== WhatsApp Glass — Style v2.2 (logo + status, RTL-robust) ===== */
:root {
  --wa: #25d366;
  --wa-ink: #e9f5ec;
  --ink: #e6ece8;
  --ink-muted: #b7c2ba;
  --bg-dark: #0b0c0d;
  --bg-grad-1: #101414;
  --bg-grad-2: #0b0f0c;
  --panel: rgba(20, 22, 21, 0.55);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --radius-lg: 18px;
  --radius-pill: 42px;
  --blur: 24px;
  --speed: 0.25s;
  --control-h: 48px;
}

* {
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}
body {
  margin: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% -10%, rgba(37, 211, 102, 0.08), transparent 60%), radial-gradient(900px 700px at 120% 110%, rgba(37, 211, 102, 0.06), transparent 60%),
    linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
}

/* ===== Layout panes ===== */
#left {
  width: 30%;
  padding: 12px;
  overflow-y: auto;
  background: var(--panel);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-right: 1px solid var(--border);
}

#right {
  width: 70%;
  padding: 28px;
  overflow-y: auto;
  height: 100vh;
  background: linear-gradient(180deg, rgba(16, 20, 17, 0.45), rgba(10, 12, 11, 0.35));
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
}

/* ===== NEW: App header (logo + connection) ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  gap: 8px;
  align-items: baseline;
  letter-spacing: 0.3px;
  user-select: none;
}
.brand-strong {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 30px;
  color: var(--wa-ink);
  cursor: pointer;
}
.brand-light {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-muted);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-console-btn {
  display: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  color: var(--wa-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--speed) ease, transform var(--speed) ease;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.server-console-btn.is-revealed,
.server-console-btn:not([hidden]) {
  display: inline-flex !important;
}
.server-console-btn:hover {
  background: rgba(37, 211, 102, 0.22);
  transform: translateY(-1px);
}

.server-console-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.server-console-panel {
  width: min(960px, 96vw);
  height: min(78vh, 820px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #0d1110;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.server-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}
.server-console-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--wa-ink);
}

.server-console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-console-autoscroll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  user-select: none;
}

.server-console-action-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--glass);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.server-console-action-btn:hover {
  background: var(--glass-strong);
}

.server-console-status {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}
.server-console-status.is-live {
  color: #7dffb0;
}
.server-console-status.is-error {
  color: #ff8a8c;
}

.server-console-output {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #d7e2db;
  white-space: pre-wrap;
  word-break: break-word;
  background: #070908;
}
.server-console-line {
  margin-bottom: 4px;
}
.server-console-line.level-error {
  color: #ff8a8c;
}
.server-console-line.level-warn {
  color: #ffd166;
}
.server-console-line.level-info,
.server-console-line.level-log {
  color: #d7e2db;
}
.server-console-line.level-debug {
  color: #9db0a4;
}

/* Connection status */
.conn {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}
.conn-auto-restart {
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.3;
}
.conn-auto-restart:not([hidden]) {
  display: block;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
.status-dot.is-online {
  background: radial-gradient(circle at 30% 30%, #fff, var(--wa));
  box-shadow: 0 0 8px rgba(37, 211, 102, 0.8);
}
.status-dot.is-offline {
  background: radial-gradient(circle at 30% 30%, #fff, #ff4d4f);
  box-shadow: 0 0 6px rgba(255, 77, 79, 0.7);
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}
.status-dot.is-connecting {
  background: radial-gradient(circle at 30% 30%, #fff, #ffc107);
  animation: pulse 1.6s infinite;
}

/* ===== Search row ===== */
.search-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}
.search-row > * {
  height: var(--control-h);
}

#search {
  flex: 1;
  padding-inline: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
  color: var(--wa-ink);
  transition: all var(--speed) ease;
  outline: none;
  line-height: var(--control-h);
  text-align: start;
  unicode-bidi: plaintext;
}
#search::placeholder {
  color: var(--ink-muted);
}
#search:focus {
  border-color: var(--wa);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
  background: var(--glass-strong);
}

#refreshBtn {
  width: var(--control-h);
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: var(--glass);
  color: var(--wa-ink);
  transition: all var(--speed) ease;
  backdrop-filter: blur(18px);
}
#refreshBtn:hover {
  border-color: var(--wa);
  background: rgba(37, 211, 102, 0.16);
}
#refreshBtn.loading {
  animation: spin 1s linear infinite;
  opacity: 0.7;
  pointer-events: none;
}
@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== Sections ===== */
.section {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
label {
  margin: 12px 0 6px;
  display: block;
  color: var(--wa-ink);
  opacity: 0.9;
  text-align: start;
}

/* ===== Contacts list ===== */
.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  color: var(--wa-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  border-radius: 12px;
  transition: background var(--speed) ease, transform var(--speed) ease, border-color var(--speed) ease;
  text-align: start;
  unicode-bidi: plaintext;
}
.contact:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}
.contact.active {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.35);
}
.contact img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

/* ===== Text areas ===== */
textarea {
  width: 100%;
  height: 110px;
  font-size: 16px;
  padding: 12px 14px;
  background: var(--glass);
  color: var(--wa-ink);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all var(--speed) ease;
  outline: none;
  resize: vertical;
  text-align: start;
  unicode-bidi: plaintext;
}
textarea:focus {
  border-color: var(--wa);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
  background: var(--glass-strong);
}

/* ===== Button groups & pill buttons ===== */
.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  margin: 0;
  padding: 19px 16px;
  background: var(--glass);
  color: var(--wa-ink);
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-size: 14px;
  border: 1px solid var(--border);
  transition: all var(--speed) ease;
  backdrop-filter: blur(18px);
  text-align: center;
}
.btn:hover {
  background: rgba(37, 211, 102, 0.16);
  border-color: var(--wa);
}
.btn.active {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}

/* ===== Generic buttons ===== */
button {
  margin: 8px;
  margin-inline-end: 10px;
  padding: 14px 20px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--glass);
  color: var(--wa-ink);
  transition: all var(--speed) ease;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
button:hover {
  background: rgba(37, 211, 102, 0.16);
  border-color: var(--wa);
}
#parentGlow {
  background: rgba(37, 211, 102, 0.16);
  border-color: var(--wa);
}

/* Primary/Success accents */
#testButton {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
  color: var(--wa-ink);
}
#testButton:hover {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}
#saveBtn {
  background: linear-gradient(180deg, rgba(37, 211, 102, 0.24), rgba(37, 211, 102, 0.18));
  border-color: rgba(37, 211, 102, 0.55);
  color: #0b2b17;
}
#saveBtn:hover {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}

/* Status text */
#statusMsg {
  margin-top: 15px;
  font-size: 16px;
  color: var(--wa);
  min-height: 1.2em;
}

/* ===== Parent search & list ===== */
#parentSearch,
#folderLinkInput,
#englishLevel {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: all var(--speed) ease;
  background: var(--glass);
  color: var(--wa-ink);
  text-align: start;
  unicode-bidi: plaintext;
}
#parentSearch::placeholder,
#folderLinkInput::placeholder {
  color: var(--ink-muted);
}

#parentSearch:focus,
#folderLinkInput:focus,
#englishLevel:focus {
  border-color: var(--wa);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
  background: var(--glass-strong);
}

#parentList {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
}
.parent-option {
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--speed) ease;
  color: var(--wa-ink);
  text-align: start;
  unicode-bidi: plaintext;
}
.parent-option:hover {
  background: rgba(37, 211, 102, 0.14);
}
#selectedParentLabel {
  margin-top: 10px;
  font-style: italic;
  color: var(--ink-muted);
}

/* Day override tiny buttons */
.btn-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 4px;
}
.day-override-btn {
  font-size: 10px;
  padding: 3px 7px;
  margin: 3px 0 0 0;
  background: var(--glass);
  color: var(--wa-ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--speed) ease;
}
.day-override-btn:hover {
  background: rgba(37, 211, 102, 0.18);
  border-color: var(--wa);
}

/* ===== Scrollbars (WebKit) ===== */
#left::-webkit-scrollbar,
#right::-webkit-scrollbar,
#parentList::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
#left::-webkit-scrollbar-thumb,
#right::-webkit-scrollbar-thumb,
#parentList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0);
}
#left::-webkit-scrollbar-thumb:hover,
#right::-webkit-scrollbar-thumb:hover,
#parentList::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 211, 102, 0.45);
}

/* ===== Direction toggles ===== */
html[dir="rtl"] body {
  direction: rtl;
}
html[dir="rtl"] .button-group {
  flex-direction: row-reverse;
}
html[dir="rtl"] button {
  margin-inline-start: 10px;
  margin-inline-end: 0;
}

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* === Contact Title — Gradient text === */
#contactName {
  font-size: clamp(22px, 2.2vw, 36px);
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0 0 14px;
  padding: 14px 16px;
  text-align: start;
  unicode-bidi: plaintext;
  background: linear-gradient(-30deg, #25d366, #b2ffc2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: 2px solid rgba(37, 211, 102, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: titleFade 0.3s ease;
}
@keyframes titleFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
html[dir="rtl"] #contactName {
  text-align: start;
}

/* ===== Student settings (reminders / schedule) — collapsible ===== */
.student-settings-collapsible {
  margin-bottom: 16px;
}
.student-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  margin: 0 0 8px;
  text-align: center;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--wa-ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(37, 211, 102, 0.06));
  border-top: 1px solid rgba(37, 211, 102, 0.65);
  border-bottom: 1px solid rgba(37, 211, 102, 0.65);
  border-inline: none;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 -1px 14px rgba(37, 211, 102, 0.18), 0 1px 14px rgba(37, 211, 102, 0.18);
  transition: background var(--speed) ease, border-color var(--speed) ease, transform var(--speed) ease, box-shadow var(--speed) ease;
}
.student-settings-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(37, 211, 102, 0.14));
  border-top-color: rgba(37, 211, 102, 0.9);
  border-bottom-color: rgba(37, 211, 102, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 -2px 18px rgba(37, 211, 102, 0.3), 0 2px 18px rgba(37, 211, 102, 0.3);
}
.student-settings-toggle:focus-visible {
  outline: 2px solid var(--wa);
  outline-offset: 2px;
}
.student-settings-toggle-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}
.student-settings-toggle-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--wa-ink);
}
.student-settings-toggle-subtitle {
  font-size: 14px;
  color: var(--ink-muted);
}
.student-settings-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  border: 1px solid rgba(37, 211, 102, 0.28);
  background: rgba(37, 211, 102, 0.12);
  color: var(--wa-ink);
  font-size: 22px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform var(--speed) ease, background var(--speed) ease, border-color var(--speed) ease;
}
.student-settings-toggle[aria-expanded="true"] .student-settings-toggle-icon {
  transform: rotate(180deg);
  background: rgba(37, 211, 102, 0.22);
  border-color: rgba(37, 211, 102, 0.5);
}
.student-settings-panel[hidden] {
  display: none !important;
}
.student-settings-panel:not([hidden]) {
  padding-top: 6px;
}

/* ========================= */
/* == NEW: Study settings & nav == */
/* ========================= */

/* Navigation buttons row (אנשי קשר / הגדרות לימוד) */
#navButtons {
  margin: 8px 0 12px;
}
#navButtons button {
  flex: 1;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
}
#navButtons button.active {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}

/* Study settings block */
#studySettings {
  margin-top: 8px;
}

/* Letters grid (B-G) */
#lettersContainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}
#lettersContainer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(14px);
}
#lettersContainer label {
  display: inline-block;
  width: 22px;
  text-align: start;
  color: var(--wa-ink);
  margin: 0;
}
#lettersContainer select {
  padding: 6px 10px;
  min-width: 64px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--wa-ink);
  outline: none;
  transition: all var(--speed) ease;
}
#lettersContainer select:focus {
  border-color: var(--wa);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
  background: var(--glass-strong);
}

/* Start Scan button emphasis (inherits generic button style) */
#startScanBtn {
  margin-top: 14px;
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
}
#startScanBtn:hover {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}
#lettersContainer select {
  padding: 6px 10px;
  min-width: 64px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass); /* רקע שקוף כהה */
  color: var(--wa-ink); /* טקסט ירקרק-בהיר לקריאות */
  outline: none;
  transition: all var(--speed) ease;
  -webkit-appearance: none; /* הסרת עיצוב דפדפן */
  appearance: none;
}

#lettersContainer select option {
  background-color: var(--bg-grad-2); /* רקע כהה לתפריט */
  color: var(--wa-ink); /* טקסט קריא */
}
#startScanBtn.loading {
  opacity: 0.7;
  cursor: wait;
}

select {
  padding: 6px 10px;
  min-width: 64px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass); /* רקע שקוף כהה */
  color: var(--wa-ink); /* טקסט ירקרק-בהיר לקריאות */
  outline: none;
  transition: all var(--speed) ease;
  -webkit-appearance: none; /* הסרת עיצוב דפדפן */
  appearance: none;
}

select option {
  background-color: var(--bg-grad-2); /* רקע כהה לתפריט */
  color: var(--wa-ink); /* טקסט קריא */
}
#sendAnswersBtn {
  margin-top: 14px;
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
}
#sendAnswersBtn:hover {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}
#sendAnswersBtn.loading {
  opacity: 0.7;
  cursor: wait;
}
.buttons-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.buttons-row button {
  flex: 1;
  max-width: 180px;
  padding: 12px 20px;
  border-radius: 30px;
  background: linear-gradient(145deg, #00b853, #008f42);
  border: none;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.buttons-row button:hover {
  transform: translateY(-2px);
  background: linear-gradient(145deg, #00d15e, #00a84e);
}

.buttons-row button.loading {
  opacity: 0.7;
  cursor: wait;
}
#grammarSection {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
}
#grammarSection h3 {
  margin-bottom: 12px;
  color: var(--wa-ink);
}

/* ===== Bagrut Section ===== */
#bagrutSection {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
}
#bagrutSection h3 {
  margin-bottom: 16px;
  color: var(--wa-ink);
}

/* ===== Homework Reminders Section ===== */
.hw-reminders-section {
  margin-top: 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.hw-section-toggle {
  margin-bottom: 0;
}

.hw-section-panel[hidden] {
  display: none !important;
}

.hw-section-panel:not([hidden]) {
  padding: 12px 0 0;
}

.hw-subsection {
  margin-bottom: 20px;
}

.hw-subtitle {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.hw-pending-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hw-pending-track::-webkit-scrollbar {
  height: 5px;
}

.hw-pending-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.hw-pending-empty {
  flex: 1;
  min-width: 100%;
  text-align: center;
  padding: 24px 16px;
  color: var(--ink-muted);
  font-size: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.hw-pending-card {
  flex: 0 0 268px;
  scroll-snap-align: start;
  padding: 14px 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hw-pending-card:hover {
  border-color: rgba(37, 211, 102, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.hw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 28px;
}

.hw-card-date {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--wa-ink);
  line-height: 1.3;
}

.hw-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hw-card-time {
  font-size: 26px;
  font-weight: 700;
  color: #6ee7a0;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hw-card-type {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.hw-card-preview {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  margin-top: auto;
}

.hw-card-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hw-card-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.hw-create-panel {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.hw-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}

.hw-label-hint {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}

.hw-date-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hw-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.hw-chip:hover {
  border-color: rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.1);
}

.hw-chip.active {
  border-color: var(--wa);
  background: rgba(37, 211, 102, 0.2);
  color: var(--wa-ink);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.35);
}

.hw-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hw-field {
  margin-bottom: 12px;
}

.hw-field-grow {
  flex: 1;
  min-width: 200px;
}

.hw-time-field {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
}

.hw-btn-add-reminder {
  width: 100%;
  margin-top: 12px;
  padding: 16px 20px;
  min-height: 54px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.hw-btn-add-reminder:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}

.hw-btn-add-reminder:active {
  transform: translateY(0);
}

.hw-time-field .hw-status-msg {
  margin-top: 8px;
  text-align: center;
}

.hw-select,
.hw-input,
.hw-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 14px;
}

.hw-textarea {
  resize: vertical;
  min-height: 72px;
}

.hw-textarea-sm {
  min-height: 56px;
}

.hw-time-wheel-wrap {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.hw-time-wheel {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  padding: 4px 0;
  scroll-snap-type: y mandatory;
}

.hw-time-wheel option {
  padding: 8px;
  text-align: center;
}

.hw-time-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.hw-time-wheel-wrap {
  flex: 1;
  min-width: 0;
}

.hw-time-manual {
  width: 72px;
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
}

.hw-time-manual:focus {
  outline: 2px solid rgba(37, 211, 102, 0.5);
  border-color: rgba(37, 211, 102, 0.5);
}

.hw-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.hw-template-list-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}

.hw-template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.hw-template-item.is-default {
  border-color: rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.08);
}

.hw-template-item-info {
  flex: 1;
  min-width: 0;
}

.hw-template-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--wa-ink);
  margin-bottom: 2px;
}

.hw-template-item-preview {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-template-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.hw-template-action-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--wa-ink);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.hw-template-action-btn:hover {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
}

.hw-template-delete-btn {
  padding: 5px 8px;
}

.hw-template-default-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.2);
  color: var(--wa);
  font-weight: 600;
}

.hw-template-add-collapsible {
  margin: 12px 0;
}

.hw-subsection-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.06);
  color: var(--wa-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--speed) ease;
}

.hw-subsection-toggle:hover {
  background: rgba(37, 211, 102, 0.12);
}

.hw-subsection-toggle-icon {
  font-size: 16px;
  transition: transform var(--speed) ease;
}

.hw-subsection-toggle[aria-expanded="true"] .hw-subsection-toggle-icon {
  transform: rotate(180deg);
}

.hw-template-add-row[hidden] {
  display: none !important;
}

.hw-template-add-row:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px dashed rgba(37, 211, 102, 0.3);
  background: rgba(37, 211, 102, 0.05);
}

.hw-template-add-row {
  /* styles applied when panel is open — see .hw-template-add-row:not([hidden]) */
}

.hw-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hw-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.hw-btn-primary {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
}

.hw-btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.hw-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border: 1px solid var(--border);
}

.hw-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hw-status-msg {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
  color: var(--wa);
}

/* ===== Exercise Statistics ===== */
#exerciseStatsContainer {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.1) 0%, rgba(0, 119, 182, 0.1) 100%);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(0, 180, 216, 0.2);
}

#exerciseStats {
  display: block;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 180, 216, 0.4);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--wa-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card-level {
  background: linear-gradient(135deg, #b16cff 0%, #74009e 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 24px;
  font-weight: 600;
}

.stat-numbers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 21px;
}

.stat-label {
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-weight: 600;
  color: var(--wa-ink);
}

.stat-value.solved {
  color: #10b981;
}

.stat-value.unsolved {
  color: #ef4444;
}

.progress-bar-container {
  margin-top: 12px;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: #666;
}

.progress-bar {
  width: 100%;
  height: 40px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.progress-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 29px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#yearFilter,
#moduleFilter {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: all var(--speed) ease;
  background: var(--glass);
  color: var(--wa-ink);
  text-align: start;
  unicode-bidi: plaintext;
}

#yearFilter:focus,
#moduleFilter:focus {
  border-color: var(--wa);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
  background: var(--glass-strong);
}

#examsContainer {
  max-height: 600px;
  overflow-y: auto;
  padding: 8px;
}

#examsContainer::-webkit-scrollbar {
  width: 8px;
}

#examsContainer::-webkit-scrollbar-track {
  background: var(--glass);
  border-radius: 4px;
}

#examsContainer::-webkit-scrollbar-thumb {
  background: rgba(37, 211, 102, 0.3);
  border-radius: 4px;
}

#examsContainer::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 211, 102, 0.5);
}

.exam-group {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
}

.exam-group h4 {
  margin: 0 0 12px 0;
  color: var(--wa-ink);
  font-size: 16px;
  font-weight: 600;
}

.exam-group-link {
  margin: 0 0 12px 0;
  color: var(--ink-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  cursor: default;
}

.exam-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: all var(--speed) ease;
}

.exam-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
}

.exam-item.solved {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.3);
}

.exam-item .exam-name {
  flex: 1;
  color: var(--wa-ink);
  font-size: 14px;
}

.exam-item button {
  margin: 0;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
}
.tense {
  margin-bottom: 12px;
}
.tense select {
  width: 100%;
}
#linksBox {
  width: 100%;
  min-height: 80px;
}
.divider {
  border-top: 1px solid var(--border);
  margin: 18px 0;
  opacity: 0.5;
}
#generatedBox {
  max-height: 300px; /* אפשר לשנות לגובה שנוח לך */
  overflow-y: auto;
  overflow-x: hidden; /* שלא יגלול לצדדים */
}
#scanToggleWrapper {
  margin: 12px 0;
  text-align: center;
}

#scanToggleBtn {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
  color: var(--wa-ink);
  transition: all var(--speed) ease;
}

#scanToggleBtn.off {
  background: rgba(255, 77, 79, 0.18);
  border-color: rgba(255, 77, 79, 0.45);
  color: #ff4d4f;
}

#scanToggleBtn.off:hover {
  background: #ff4d4f;
  color: #fff;
  border-color: transparent;
}
#scanAndSendWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}

#scanToggleWrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

#qrCodeContainer {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

#qrCodeImage {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: white;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sendDayWrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

#daySelect {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--wa-ink);
}

.vertical-divider {
  width: 1px;
  height: 40px;
  background-color: var(--border-strong);
}
#sendDayWrapper select,
#sendDayWrapper button {
  height: var(--control-h); /* גובה אחיד */
  line-height: var(--control-h); /* מרכז אנכי לטקסט */
  font-size: 14px;
}

#sendDayWrapper select {
  padding: 0 14px; /* רווח פנימי אחיד */
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none; /* מנקה סגנון דפדפן */
  -webkit-appearance: none;
  -moz-appearance: none;
}

#sendDayWrapper button {
  padding: 0 20px;
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
  color: var(--wa-ink);
  transition: all var(--speed) ease;
}

#sendDayWrapper button:hover {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
}
#availableSlotsWrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

#distributeByDayBtn {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
}

/* הפצה לפי יום - מודל */
.distribute-modal-content {
  max-width: 500px;
  width: 95%;
}

.distribute-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
}

.distribute-modal-body label {
  font-weight: 600;
  color: var(--ink);
}

.distribute-modal-body select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--wa-ink);
  font-size: 14px;
}

.distribute-modal-body textarea {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--wa-ink);
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
}

.distribute-delay-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.distribute-delay-row input {
  width: 80px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--wa-ink);
  font-size: 14px;
}

.distribute-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.distribute-send-btn {
  padding: 10px 24px;
  background: rgba(37, 211, 102, 0.3);
  border: 1px solid rgba(37, 211, 102, 0.5);
  color: var(--wa-ink);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed);
}

.distribute-send-btn:hover {
  background: var(--wa);
  color: #0b2b17;
}

.distribute-close-btn {
  padding: 10px 24px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--speed);
}

.distribute-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

#availableSlotsBtn {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
}

#availableNumber {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--wa-ink);
}

/* Mark All Year Button */
#markAllYearBtn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(37, 211, 102, 0.24), rgba(37, 211, 102, 0.18));
  border: 1px solid rgba(37, 211, 102, 0.55);
  color: var(--wa-ink);
  cursor: pointer;
  transition: all var(--speed) ease;
  box-shadow: var(--shadow);
}

#markAllYearBtn:hover {
  background: var(--wa);
  color: #0b2b17;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

/* Unmark All Year Button */
#unmarkAllYearBtn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 77, 79, 0.24), rgba(255, 77, 79, 0.18));
  border: 1px solid rgba(255, 77, 79, 0.55);
  color: var(--wa-ink);
  cursor: pointer;
  transition: all var(--speed) ease;
  box-shadow: var(--shadow);
}

#unmarkAllYearBtn:hover {
  background: #ff4d4f;
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 77, 79, 0.35);
}

/* ===== QR Code Popup ===== */
.qr-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.qr-popup-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease-out;
}

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

.qr-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.qr-popup-header h3 {
  margin: 0;
  color: var(--wa);
  font-size: 20px;
  font-weight: 600;
}

.qr-popup-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--speed);
}

.qr-popup-close:hover {
  background: var(--glass);
  color: var(--ink);
}

.qr-popup-body {
  text-align: center;
}

.qr-popup-body p {
  margin: 0 0 20px 0;
  color: var(--ink);
  font-size: 16px;
}

.qr-popup-body img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: white;
  padding: 12px;
}

/* ===== Mobile Detection - Hide desktop layout on mobile ===== */
@media (max-width: 768px) {
  #left,
  #right {
    display: none !important;
  }
  
  body {
    overflow-x: hidden;
  }
}