/* ── Hamburger menu — shared across pages ── */

/* -- Button -- */
.menu-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s;
  box-shadow: 0 4px 12px var(--card-shadow);
  color: var(--text-primary);
}
.menu-btn:hover { transform: scale(1.1); background: var(--card-bg-hover); }

/* -- Full-screen overlay -- */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 20px;
}
.menu-overlay.open { display: flex; align-items: flex-start; justify-content: center; }

/* -- Panel -- */
.menu-panel {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  margin: 60px auto 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* -- Close button -- */
.menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.menu-close:hover { background: var(--card-bg-hover); color: var(--text-primary); }

/* -- Sections -- */
.menu-section { margin-bottom: 32px; }
.menu-section:last-child { margin-bottom: 0; }
.menu-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* -- About content -- */
.menu-about-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.menu-about-globe { width: 28px; height: 28px; }
.menu-about-name {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--globe-gradient-1), var(--globe-gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.menu-about-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin: 0 0 12px; }
.menu-link { color: var(--accent-color, #3b82f6); text-decoration: none; }
.menu-link:hover { text-decoration: underline; }

/* -- Preference rows -- */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
}
.pref-row:last-child { border-bottom: none; }
.pref-label { display: flex; flex-direction: column; gap: 3px; }
.pref-label-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.pref-label-desc  { font-size: 12px; color: var(--text-secondary); }

/* -- Theme toggle (inside menu pref row) -- */
.theme-icon { pointer-events: none; }
.menu-panel .theme-toggle {
  position: static;
  z-index: auto;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.menu-panel .theme-toggle:hover { background: var(--card-bg-hover); transform: scale(1.1); }

/* -- Toggle switch -- */
.pref-toggle {
  flex-shrink: 0;
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--card-border);
  border-radius: 13px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.pref-toggle[aria-checked="true"] { background: var(--accent-color, #3b82f6); }
.pref-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.pref-toggle[aria-checked="true"]::after { transform: translateX(22px); }

/* -- Clear records button -- */
.clear-records-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.clear-records-btn:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.6); }

/* -- Mobile -- */
@media (max-width: 640px) {
  .menu-btn { top: 16px; right: 16px; width: 44px; height: 44px; font-size: 20px; }
  .menu-overlay { padding: 0; align-items: flex-end; }
  .menu-panel {
    max-width: 100%;
    margin: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 28px 20px 40px;
  }
}
