/* ==========================================================================
   GameChecklist.top — Ultra-Minimal, Icon-First UI
   GTA 6 Palette: Vice Dusk (Default) | Leonida Daylight (Light)
   ========================================================================== */

:root {
  --bg-primary: #110c1c;
  --bg-secondary: #191329;
  --bg-tertiary: #231b38;
  --bg-hover: #2b2144;
  --bg-glass: rgba(17, 12, 28, 0.92);

  --text-primary: #fdf8ff;
  --text-secondary: #c4b5d8;
  --text-muted: #8b7aa3;

  --accent-pink: #ff2e93;
  --accent-orange: #ff7b54;
  --accent-gold: #ffd166;
  --accent-cyan: #2de2e6;
  --accent-green: #10e898;
  --accent-danger: #ff476f;

  --border-subtle: rgba(255, 165, 220, 0.09);
  --border-strong: rgba(255, 165, 220, 0.2);

  --gradient-progress: linear-gradient(90deg, #ff2e93 0%, #ff7b54 55%, #ffd166 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --tap-min: 44px;
}

[data-theme="light"] {
  --bg-primary: #fff8f4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f9eef4;
  --bg-hover: #f3e3ec;
  --bg-glass: rgba(255, 248, 244, 0.94);

  --text-primary: #1c102b;
  --text-secondary: #5a446e;
  --text-muted: #826d96;

  --accent-pink: #d91b74;
  --accent-orange: #e8592c;
  --accent-gold: #d97706;
  --accent-cyan: #0091a8;
  --accent-green: #059669;
  --accent-danger: #e11d48;

  --border-subtle: rgba(28, 16, 43, 0.09);
  --border-strong: rgba(28, 16, 43, 0.18);

  --gradient-progress: linear-gradient(90deg, #d91b74 0%, #e8592c 60%, #f59e0b 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: 56px;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* ==========================================================================
   Unified Sticky Top Bar (Brand + Inline Progress + Icon Buttons)
   ========================================================================== */
.sticky-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-group h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-muted {
  font-weight: 500;
  color: var(--text-secondary);
  display: none;
}

@media (min-width: 520px) {
  .brand-muted {
    display: inline;
  }
}

/* Inline Progress Bar */
.overall-progress-wrap {
  flex: 1;
  max-width: 780px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.progress-percent {
  font-size: 1.45rem;
  font-weight: 900;
  background: var(--gradient-progress);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.progress-counts {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-track {
  flex: 1;
  height: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-progress);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 46, 147, 0.45);
  transition: width 0.25s ease;
}

/* Icon Buttons & Dropdown Menu */
.icon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-tertiary);
}

.icon-btn.active,
.icon-btn[aria-pressed="true"] {
  color: var(--accent-pink);
  border-color: rgba(255, 46, 147, 0.45);
  background: rgba(255, 46, 147, 0.12);
}

.icon-btn-badge {
  font-size: 0.72rem;
  font-weight: 700;
  display: none;
}

@media (min-width: 640px) {
  .icon-btn-badge {
    display: inline;
  }
}

/* Overflow Menu Dropdown */
.menu-wrap {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 80;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-item {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}

.dropdown-toggle-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-pink);
  cursor: pointer;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.dropdown-danger {
  color: var(--accent-danger);
}

.dropdown-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-danger);
}

/* ==========================================================================
   Main 2-Column Layout (>= 1024px: 72% Checklist / 28% Sidebar)
   ========================================================================== */
.app-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 36px;
}

@media (min-width: 1024px) {
  .app-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .main-column {
    width: 75%;
    flex: 0 0 calc(75% - 12px);
    min-width: 0;
  }

  .sidebar-column {
    width: 25%;
    flex: 0 0 calc(25% - 12px);
    position: sticky;
    top: 82px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
}

/* ==========================================================================
   Compact Filter Bar (Search + Status Toggle + Region Pills)
   ========================================================================== */
.filter-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-top-row {
  display: flex;
  gap: 8px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.98rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

.clear-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: none;
}

.clear-search-btn.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.segmented-toggle {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  height: 44px;
}

.seg-btn {
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Region Pills */
.pill-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pill-list::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: var(--accent-pink);
  color: #ffffff;
  border-color: var(--accent-pink);
  font-weight: 600;
}

/* ==========================================================================
   Category Accordions & Minimal Checklist Rows
   ========================================================================== */
.categories-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.category-header {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease;
}

.category-header:hover {
  background: var(--bg-hover);
}

.category-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  font-size: 1.15rem;
}

.category-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
}

.category-stats-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-badge {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.category-badge.complete {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.accordion-chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.category-card.collapsed .accordion-chevron {
  transform: rotate(-90deg);
}

.category-card.collapsed .category-body {
  display: none;
}

.category-body {
  border-top: 1px solid var(--border-subtle);
}

/* Single-Line Focused Checklist Row (Hints hidden until toggled) */
.checklist-item {
  display: flex;
  flex-direction: column;
  padding: 2px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.12s ease, opacity 0.2s ease;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item:hover {
  background: var(--bg-hover);
}

.checklist-item.completed {
  opacity: 0.42;
}

.checklist-item.completed .item-title {
  text-decoration: line-through;
}

.item-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--tap-min);
}

.item-tap-label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-height: var(--tap-min);
  cursor: pointer;
  user-select: none;
  min-width: 0;
  padding: 6px 0;
}

.item-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--accent-pink);
  flex-shrink: 0;
}

.item-title {
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .item-title {
    white-space: normal;
  }
}

.item-right-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.item-region-pill {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Compact Icon Row Actions (Info ⓘ, Video ▶, Spoiler 👁) */
.row-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
}

.row-icon-btn:hover,
.row-icon-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  text-decoration: none;
}

.row-icon-video {
  color: var(--accent-pink);
}

/* On-Demand Location Hint Drawer */
.item-hint-drawer {
  display: none;
  padding: 0 0 12px 34px;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.checklist-item.show-hint .item-hint-drawer,
body.show-all-hints .item-hint-drawer {
  display: block;
}

/* Spoiler Blur */
.spoiler-masked .item-title,
.spoiler-masked .item-hint-drawer {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}

/* Empty State */
.empty-state {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 36px 16px;
  text-align: center;
  display: none;
}

.empty-state.visible {
  display: block;
}

.empty-state p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ==========================================================================
   Right Sidebar: Minimal Progress Bars & Ad Slot
   ========================================================================== */
.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.category-summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-summary-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-summary-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.cat-summary-name {
  color: var(--text-secondary);
}

.cat-summary-count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cat-summary-bar {
  height: 7px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
}

.cat-summary-fill {
  height: 100%;
  background: var(--gradient-progress);
  width: 0%;
  transition: width 0.25s ease;
}

.ad-slot-sidebar {
  min-height: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.ad-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ad-placeholder-box {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Minimal 1-Line Footer & Mobile Ad
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 18px 0 24px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-inner a {
  color: var(--text-secondary);
}

.mobile-anchor-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 50px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 40px 4px 16px;
}

.mobile-anchor-ad.dismissed {
  display: none;
}

.ad-anchor-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .mobile-anchor-ad {
    display: none;
  }
  body {
    padding-bottom: 0;
  }
}

.anchor-dismiss-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

/* ==========================================================================
   Modals, Buttons & Toast
   ========================================================================== */
.btn-ghost {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
}

.btn-primary {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
}

.btn-danger-solid {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent-danger);
  color: #fff;
  border: none;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 11, 16, 0.76);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h2 {
  font-size: 0.98rem;
}

.btn-icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.save-string-textarea {
  width: 100%;
  min-height: 70px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--text-primary);
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.gear-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gear-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  text-decoration: none;
}

.gear-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.gear-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.gear-cta {
  color: var(--text-secondary);
}

.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-details {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.faq-details summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.faq-details p {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 120;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}
