/* QuickGigs — UX overhaul layer (trust, a11y, mobile, polish). Additive; does not rename CSS vars. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 10px 16px;
  background: #6b3fa0;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 0 10px 0;
  text-decoration: none;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 2px solid #c8a8e9;
  outline-offset: 2px;
}

main#main,
#main.qg-main {
  animation: qgMainIn 0.25s ease;
}
@keyframes qgMainIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

:focus-visible {
  outline: 2px solid var(--purple-light, #9b6fc4);
  outline-offset: 2px;
}

body {
  overflow-x: hidden;
  font-size: max(14px, 1em);
  line-height: 1.5;
}

/* Readable muted text (WCAG-minded) */
.tc-cat,
.tc-info,
.tab-lbl,
.app-legal-footer,
.signup-trust,
.field-hint,
.modal-sub,
.results-txt,
.empty-txt,
.signup-subtitle {
  color: rgba(255, 255, 255, 0.55) !important;
}
body.light .tc-cat,
body.light .tc-info,
body.light .tab-lbl,
body.light .app-legal-footer,
body.light .field-hint,
body.light .modal-sub,
body.light .results-txt,
body.light .empty-txt {
  color: rgba(45, 27, 78, 0.62) !important;
}

.nav-beta-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.28);
  vertical-align: middle;
  white-space: nowrap;
}

.qg-trust-footer {
  text-align: center;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  font-size: 12px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.5);
  border-top: 0.5px solid rgba(200, 168, 233, 0.12);
}
body.light .qg-trust-footer { color: rgba(45, 27, 78, 0.55); border-top-color: #eee8ff; }
.qg-trust-footer .qg-foot-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--lavender, #c8a8e9);
  margin-bottom: 6px;
}
.qg-trust-footer .qg-foot-co { margin-bottom: 8px; }
.qg-trust-footer a {
  color: var(--purple-light, #9b6fc4);
  text-decoration: none;
}
body.light .qg-trust-footer a { color: var(--purple, #6b3fa0); }
.qg-trust-footer .qg-foot-links { margin: 8px 0; }
.qg-trust-footer .qg-foot-email { word-break: break-word; }

.qg-pipeda-line {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}
body.light .qg-pipeda-line { color: rgba(45, 27, 78, 0.6); }

.qg-field-error {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  color: #ef4444;
  line-height: 1.4;
}
.qg-field-error.show { display: block; }
.qg-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}
.qg-submit-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  margin-top: 8px;
  min-height: 1.2em;
}
body.light .qg-submit-hint { color: rgba(45, 27, 78, 0.55); }

.qg-tip-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.qg-tip-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0.5px solid rgba(200, 168, 233, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: var(--lavender, #c8a8e9);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.qg-tip-pop {
  display: none;
  position: absolute;
  z-index: 80;
  left: 0;
  top: calc(100% + 6px);
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: #1a0a30;
  border: 0.5px solid rgba(200, 168, 233, 0.25);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
body.light .qg-tip-pop {
  background: #fff;
  color: #2d1b4e;
  border-color: #e8e0ff;
}
.qg-tip-wrap.open .qg-tip-pop { display: block; }

.qg-onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 0, 15, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.qg-onboard-overlay.open { display: flex; }
.qg-onboard-card {
  width: min(400px, 100%);
  border-radius: 20px;
  padding: 24px 22px;
  background: #140628;
  border: 0.5px solid rgba(200, 168, 233, 0.2);
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
body.light .qg-onboard-card { background: #fff; color: #2d1b4e; }
.qg-onboard-step { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #9b6fc4; margin-bottom: 8px; }
.qg-onboard-title { font-size: 18px; font-weight: 500; margin-bottom: 8px; line-height: 1.35; }
.qg-onboard-sub { font-size: 14px; line-height: 1.55; color: rgba(255, 255, 255, 0.55); margin-bottom: 20px; }
body.light .qg-onboard-sub { color: rgba(45, 27, 78, 0.6); }
.qg-onboard-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6b3fa0, #9b6fc4);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.qg-onboard-skip {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.light .qg-onboard-skip { color: rgba(45, 27, 78, 0.55); }
.qg-onboard-skip:hover { color: #c8a8e9; }
body.light .qg-onboard-skip:hover { color: #6b3fa0; }

.qg-hint-banner {
  margin: 10px 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(107, 63, 160, 0.15);
  border: 0.5px solid rgba(200, 168, 233, 0.25);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}
body.light .qg-hint-banner {
  background: #f5f0ff;
  border-color: #e0d8ff;
  color: #2d1b4e;
}

.qg-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
  margin-left: 6px;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .price-grid,
  .field-row,
  .mode-grid,
  .actions-grid,
  .stats-grid,
  .modal-btns,
  .confirm-btns {
    grid-template-columns: 1fr !important;
  }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }

  .modal-overlay.open,
  .confirm-overlay.open {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-overlay.open .modal,
  .confirm-overlay.open .confirm-box,
  .qg-sheet {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh;
    overflow: auto;
  }
  .modal-handle,
  .qg-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(200, 168, 233, 0.25);
    margin: 8px auto 14px;
  }

  .mode-row,
  .cat-row,
  .chips-row,
  .filter-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mode-row::-webkit-scrollbar,
  .cat-row::-webkit-scrollbar,
  .chips-row::-webkit-scrollbar { display: none; }

  .tc-title,
  .task-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .bubble,
  .tc-desc,
  .task-desc {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .act-btn,
  .accept-btn,
  .submit-btn,
  .empty-btn {
    min-height: 48px;
    margin: 4px 0;
  }

  .qg-sticky-post-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    padding: 10px 16px;
    background: linear-gradient(180deg, transparent, rgba(11, 1, 24, 0.95) 30%);
  }
  body.light .qg-sticky-post-bar {
    background: linear-gradient(180deg, transparent, rgba(250, 250, 254, 0.96) 30%);
  }
  .qg-sticky-post-bar .submit-btn,
  .qg-sticky-post-bar #postBtn,
  .qg-sticky-post-bar .post-btn {
    width: 100%;
    min-height: 52px;
  }
  body.qg-page-posttask {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.qg-section {
  padding: 16px;
}
@media (min-width: 768px) {
  .qg-section { padding: 24px; }
}

.tab-bar .tab-item {
  min-height: 48px;
  gap: 4px;
}
.tab-bar .tab-lbl { font-size: 10px; }
.tab-unread-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
}
.tab-item { position: relative; }
.tab-item.has-unread .tab-unread-badge { display: inline-flex; }

.qg-beta-free-note {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}
body.light .qg-beta-free-note { color: #6b6580; }

.qg-field-hint,
.field-hint.qg-field-hint {
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0 8px;
  color: rgba(255, 255, 255, 0.62);
}
body.light .qg-field-hint,
body.light .field-hint.qg-field-hint { color: #6b6580; }

/* Contrast / readability pass — informational muted text floor */
:root, body {
  --text-muted: rgba(255, 255, 255, 0.68);
  --text-faint: rgba(255, 255, 255, 0.62);
  --time-color: rgba(255, 255, 255, 0.55);
  --desc-color: rgba(255, 255, 255, 0.62);
  --info-color: rgba(255, 255, 255, 0.62);
  --results-color: rgba(255, 255, 255, 0.62);
  --empty-color: rgba(200, 168, 233, 0.78);
  --read-preview: rgba(255, 255, 255, 0.62);
  --pill-inactive-color: rgba(255, 255, 255, 0.62);
  --cat-inactive-color: rgba(255, 255, 255, 0.62);
}
body.light {
  --text-muted: #6b6580;
  --text-faint: #6b6580;
  --time-color: #6b6580;
  --desc-color: #6b6580;
  --info-color: #6b6580;
  --results-color: #8a84a0;
  --empty-color: #6b6580;
  --read-preview: #6b6580;
  --pill-inactive-color: #6b6580;
  --cat-inactive-color: #6b6580;
}

/* Chat timestamps + read receipts */
.bubble-time,
.bubble-check,
.date-divider {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
body.light .bubble-time,
body.light .bubble-check,
body.light .date-divider {
  color: #6b6580;
}

/* Notification panel body (titles stay as-is) */
.qg-bell-item-body {
  color: rgba(255, 255, 255, 0.65);
}
body.light .qg-bell-item-body {
  color: #6b6580;
}
.qg-bell-item-time,
.qg-bell-empty {
  color: rgba(255, 255, 255, 0.62);
}
body.light .qg-bell-item-time,
body.light .qg-bell-empty {
  color: #6b6580;
}

/* Task card price stands out in meta / price row */
.tc-price,
.tc-meta-price,
.task-price {
  color: #4ade80;
  font-weight: 500;
}
body.light .tc-price,
body.light .tc-meta-price,
body.light .task-price {
  color: #16a34a;
  font-weight: 500;
}
.tc-meta {
  color: rgba(255, 255, 255, 0.62);
}
body.light .tc-meta {
  color: #6b6580;
}
.tc-info {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}
body.light .tc-info {
  color: #6b6580;
}

.empty-state .empty-btn { margin-top: 14px; }

@media (max-width: 640px) {
  .modal-handle,
  .qg-sheet-handle {
    display: block;
  }
}
@media (min-width: 641px) {
  .modal-handle,
  .qg-sheet-handle { display: none; }
}
