/**
 * PSBDx Smart Report Management — "Dark" built-in theme.
 *
 * Every rule here is scoped under `.psbdx-theme-dark` (applied to the
 * modal/inline form wrapper and, on the ticket response page, to
 * `.psbdx-report-page`) so it can never affect a form or page that has a
 * different theme selected. Loaded after assets/css/public.css, so these
 * rules only need to state what's *different* from the Light look.
 *
 * @package PSBDx_Smart_Report_Management
 * @since   1.0.0
 */

/* ── Re-point the shared custom properties first — most rules in the core
      stylesheet reference these, so this alone flips the bulk of the UI. ── */
.psbdx-theme-dark {
	--psbdx-primary:      #818cf8;
	--psbdx-primary-dark: #6366f1;
	--psbdx-danger:       #f87171;
	--psbdx-text:         #e2e8f0;
	--psbdx-muted:        #94a3b8;
	--psbdx-border:       #334155;
	--psbdx-surface:      #0f172a;
	--psbdx-shadow:       0 20px 60px rgba( 0, 0, 0, 0.55 );
}

/* ── Modal backdrop can stay near-black either way; darken slightly more ── */
.psbdx-theme-dark.psbdx-modal {
	background: rgba( 2, 6, 23, 0.82 );
}

/* ── Panels / wrappers ────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-modal-panel,
.psbdx-theme-dark.psbdx-inline-form-wrap,
.psbdx-theme-dark .psbdx-history-wrap,
.psbdx-theme-dark .psbdx-report-page-card,
.psbdx-theme-dark .psbdx-report-hero {
	background:  var( --psbdx-surface );
	border-color: var( --psbdx-border );
	color:       var( --psbdx-text );
}

/* ── Modal icon badge ─────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-modal-icon {
	background: rgba( 129, 140, 248, 0.18 );
	color:      #a5b4fc;
}

/* ── Context bar / notices ────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-context-bar {
	background:  rgba( 248, 113, 113, 0.12 );
	color:       #fca5a5;
	border-color: rgba( 248, 113, 113, 0.35 );
}

.psbdx-theme-dark .psbdx-order-tag {
	background: rgba( 192, 132, 252, 0.18 );
	color:      #d8b4fe;
}

.psbdx-theme-dark .psbdx-notice-warn  { background: rgba( 250, 204, 21, 0.12 );  border-color: rgba( 250, 204, 21, 0.35 );  color: #fde68a; }
.psbdx-theme-dark .psbdx-notice-error { background: rgba( 248, 113, 113, 0.12 ); border-color: rgba( 248, 113, 113, 0.35 ); color: #fca5a5; }
.psbdx-theme-dark .psbdx-notice-info  { background: rgba( 96, 165, 250, 0.12 );  border-color: rgba( 96, 165, 250, 0.35 );  color: #93c5fd; }

/* ── Identity card ─────────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-identity-card {
	background: rgba( 148, 163, 184, 0.08 );
	border-color: var( --psbdx-border );
}
.psbdx-theme-dark .psbdx-identity-name { color: var( --psbdx-text ); }

/* ── Form fields ───────────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-field label {
	color: #cbd5e1;
}

.psbdx-theme-dark input[type="text"],
.psbdx-theme-dark input[type="email"],
.psbdx-theme-dark input[type="tel"],
.psbdx-theme-dark input[type="number"],
.psbdx-theme-dark input[type="url"],
.psbdx-theme-dark textarea,
.psbdx-theme-dark select {
	background:   #1e293b;
	border:       1px solid var( --psbdx-border );
	color:        var( --psbdx-text );
}

.psbdx-theme-dark input::placeholder,
.psbdx-theme-dark textarea::placeholder {
	color: #64748b;
}

.psbdx-theme-dark input:focus,
.psbdx-theme-dark textarea:focus,
.psbdx-theme-dark select:focus {
	border-color: var( --psbdx-primary );
	outline:      none;
	box-shadow:   0 0 0 3px rgba( 129, 140, 248, 0.25 );
}

.psbdx-theme-dark .psrm-field-hint { color: #64748b; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-submit-btn {
	background: var( --psbdx-primary );
	color:      #0f172a;
}
.psbdx-theme-dark .psbdx-submit-btn:hover:not( :disabled ),
.psbdx-theme-dark .psbdx-submit-btn:active:not( :disabled ) {
	background: var( --psbdx-primary-dark );
	color:      #fff;
}

.psbdx-theme-dark .psbdx-trigger-btn {
	background: var( --psbdx-primary );
	color:      #0f172a;
}

.psbdx-theme-dark .psbdx-modal-close {
	color: var( --psbdx-muted );
}

/* ── Success / ticket ID ──────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-success h3 { color: #4ade80; }
.psbdx-theme-dark .psbdx-ticket-code {
	background:  #1e293b;
	border-color: var( --psbdx-border );
	color:       var( --psbdx-text );
}

/* ── History table ─────────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-history-table th {
	color: var( --psbdx-muted );
	border-bottom-color: var( --psbdx-border );
}
.psbdx-theme-dark .psbdx-history-table td {
	border-bottom-color: var( --psbdx-border );
	color: var( --psbdx-text );
}
.psbdx-theme-dark .psbdx-muted { color: var( --psbdx-muted ); }

/* ── Conversation thread ──────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-thread-msg-user  { background: rgba( 129, 140, 248, 0.14 ); }
.psbdx-theme-dark .psbdx-thread-msg-admin { background: rgba( 148, 163, 184, 0.10 ); }
.psbdx-theme-dark .psbdx-thread-msg-ai    { background: rgba( 74, 222, 128, 0.10 ); }
.psbdx-theme-dark .psbdx-thread-msg-author { color: var( --psbdx-text ); }
.psbdx-theme-dark .psbdx-thread-msg-body   { color: var( --psbdx-text ); }
.psbdx-theme-dark .psbdx-thread-reply-input {
	background: #1e293b;
	border-color: var( --psbdx-border );
	color: var( --psbdx-text );
}
.psbdx-theme-dark .psbdx-thread-msg-attachment-deleted {
	background: rgba( 148, 163, 184, 0.08 );
	border-color: var( --psbdx-border );
	color: var( --psbdx-muted );
}

/* ── Ticket / response page ──────────────────────────────────────────── */
.psbdx-theme-dark.psbdx-report-page {
	color: var( --psbdx-text );
}
.psbdx-theme-dark .psbdx-report-hero-eyebrow { color: var( --psbdx-muted ); }
.psbdx-theme-dark .psbdx-report-hero-date    { color: var( --psbdx-muted ); }
.psbdx-theme-dark .psbdx-report-page-label   { color: var( --psbdx-muted ); }
.psbdx-theme-dark .psbdx-report-page-value   { color: var( --psbdx-text ); }
.psbdx-theme-dark .psbdx-report-page-heading { color: var( --psbdx-text ); }
.psbdx-theme-dark .psbdx-report-page-content { color: var( --psbdx-text ); }

/* ── Agent portal buttons (in case Agent Tools renders on a dark form's
      report page) ───────────────────────────────────────────────────── */
.psbdx-theme-dark .psbdx-agent-btn {
	background:  #1e293b;
	border-color: var( --psbdx-border );
	color:       var( --psbdx-text );
}
.psbdx-theme-dark .psbdx-agent-btn-primary {
	background: var( --psbdx-primary );
	color:      #0f172a;
}
.psbdx-theme-dark .psbdx-agent-btn-danger {
	background: rgba( 248, 113, 113, 0.18 );
	color:      #fca5a5;
}
