/* theme.css — dark-mode override layer for files NOT yet tokenized.
   Loaded last. Phases A.1 + A.2 drained all ACHAT-owned surfaces:
   landing, listings, listing-detail, auth, bulletin, shell, mobile
   menu, dashboard, dashboard-hero, forms, search, my-listings,
   payment, transactions, messaging, admin, error — every one of
   those reads dark values from tokens.css directly.

   What remains is parallel-work surfaces (comments, notifications,
   reviews, wishlist) and a small floor of cross-file rules that
   would be brittle to inline (general .btn-secondary variants,
   site-wide form inputs that haven't been tokenized for dark bg).
   Each future port trims more from this file. */

html[data-theme="dark"] {
    /* Legacy --lp-* tokens — still used by comments.css, reviews.css,
       notifications.css, wishlist.css (parallel work). When those
       files port, the block goes. */
    --lp-ink: #ece7f5;
    --lp-muted: #a79dbf;
    --lp-border: #382c52;
    --lp-card-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
    --lp-purple: #9b6cf2;
    --lp-purple-dark: #845ae6;
    --lp-purple-pale: #2c2244;

    /* --dk-* tokens used by this file's own overrides + parallel-work
       CSS files that still reference them directly. */
    --dk-bg: #14101e;
    --dk-surface: #211a31;
    --dk-elevated: #2b2240;
    --dk-text: #ece7f5;
    --dk-muted: #a79dbf;
    --dk-border: #382c52;
    --dk-accent: #9b6cf2;
}

/* --- Generic secondary buttons (used app-wide, untokenized) ------- */
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline {
    background: var(--dk-surface);
    border-color: var(--dk-border);
    color: var(--dk-accent);
}

/* --- Generic form inputs (site-wide; per-file dark bg untokenized) - */
html[data-theme="dark"] .field input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-card .field input,
html[data-theme="dark"] .form-card .field textarea,
html[data-theme="dark"] .form-card .field select,
html[data-theme="dark"] .form-card .field input[type="file"] {
    background: var(--dk-elevated);
    border-color: var(--dk-border);
    color: var(--dk-text);
}

/* --- Warning alert (color tokens are red/danger, amber separate) -- */
html[data-theme="dark"] .warning {
    background: #3a2e15;
    border-color: #6e521f;
    color: #fcd34d;
}

/* --- Mobile hamburger panel: needs a heavier shadow on dark to
   maintain the 'floating panel' feel. Inlining into shell-menu.css
   would be cleaner but the shadow recipe is small enough that
   carrying it here is harmless until a future shell-menu polish. */
html[data-theme="dark"] .app-menu {
    background: var(--dk-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .app-menu-link.is-active .messaging-unread-badge {
    background: var(--dk-elevated);
    color: var(--dk-text);
}

/* --- Product reviews (Phase C1, parallel work) -------------------- */
html[data-theme="dark"] .reviews-section,
html[data-theme="dark"] .review-card { background: var(--dk-surface); border-color: var(--dk-border); color: var(--dk-text); }
html[data-theme="dark"] .review-vendor-response { background: var(--dk-elevated); border-left-color: var(--dk-accent); color: var(--dk-text); }
html[data-theme="dark"] .review-vendor-response-label { color: var(--dk-accent); }
html[data-theme="dark"] .review-vendor-response-text,
html[data-theme="dark"] .review-comment { color: var(--dk-text); }
html[data-theme="dark"] .reviews-section h2,
html[data-theme="dark"] .review-name { color: var(--dk-text); }
html[data-theme="dark"] .review-date,
html[data-theme="dark"] .reviews-empty,
html[data-theme="dark"] .reviews-count { color: var(--dk-muted); }
html[data-theme="dark"] .reviews-flash { background: var(--dk-elevated); border-color: var(--dk-border); color: var(--dk-accent); }
html[data-theme="dark"] .review-respond-details > summary { color: var(--dk-accent); }
html[data-theme="dark"] .review-respond-form textarea,
html[data-theme="dark"] .review-form-card textarea { background: var(--dk-elevated); border-color: var(--dk-border); color: var(--dk-text); }
html[data-theme="dark"] .txn-review-link a { color: var(--dk-accent); }
html[data-theme="dark"] .review-avatar { background: var(--dk-elevated); color: var(--dk-accent); }

/* --- Wishlist / Favoris (Phase C2, parallel work) ----------------- */
html[data-theme="dark"] body.wishlist-page { background: var(--dk-bg); color: var(--dk-text); }
html[data-theme="dark"] .wishlist-page .listing-card { background: var(--dk-surface); border-color: var(--dk-border); color: var(--dk-text); }
html[data-theme="dark"] .wishlist-page .listing-card-title,
html[data-theme="dark"] .wishlist-page .listing-card-price { color: var(--dk-text); }
html[data-theme="dark"] .wishlist-page .listing-card-photo,
html[data-theme="dark"] .wishlist-page .listing-card-photo-empty { background: var(--dk-elevated); }
html[data-theme="dark"] .wishlist-hero h1 { color: var(--dk-text); }
html[data-theme="dark"] .wishlist-hero .page-subhead { color: var(--dk-muted); }
html[data-theme="dark"] .wishlist-remove-btn { background: var(--dk-surface); border-color: var(--dk-border); color: var(--dk-accent); }
html[data-theme="dark"] .wishlist-remove-btn:hover { background: var(--dk-elevated); border-color: var(--dk-accent); }
html[data-theme="dark"] .wishlist-page .empty-state { background: var(--dk-surface); border-color: var(--dk-border); color: var(--dk-text); }
html[data-theme="dark"] .wishlist-page .empty-state-title { color: var(--dk-text); }
html[data-theme="dark"] .wishlist-page .empty-state-text { color: var(--dk-muted); }
html[data-theme="dark"] .wishlist-toggle-btn { color: var(--dk-muted); border-color: var(--dk-border); background: var(--dk-surface); }
html[data-theme="dark"] .wishlist-toggle-btn:hover { color: var(--dk-accent); border-color: var(--dk-accent); }
html[data-theme="dark"] .wishlist-toggle-btn.is-favorited { background: var(--dk-elevated); color: var(--dk-accent); border-color: var(--dk-accent); }
