/* ═══════════════════════════════════════════════════════════
   CenterNotes — Shared Module Theme (dark mode + UI uplift)
   Loaded after each module's own styles.css
   ═══════════════════════════════════════════════════════════ */

/* ── Dark: override CSS variables ───────────────────────────── */
html[data-theme="dark"] {
  --bg:             #131210;
  --bg-deep:        #1c1a15;
  --paper:          #1c1a16;
  --surface:        rgba(38, 34, 28, 0.97);
  --surface-strong: rgba(44, 40, 33, 0.99);
  --ink:            #f0e6d5;
  --muted:          rgba(240, 230, 213, 0.52);
  --line:           rgba(240, 230, 213, 0.11);
  --table-line:     rgba(240, 230, 213, 0.18);
  --shadow:         0 28px 80px rgba(0, 0, 0, 0.6);
  background: #131210 !important;
}

html[data-theme="dark"] body {
  background: #131210 !important;
}

/* Page orbs dim in dark */
html[data-theme="dark"] .page-orb,
html[data-theme="dark"] .page-glow {
  opacity: 0.12 !important;
}

/* ── Dark: panels — hardcoded so backdrop-filter can't bleed ── */
html[data-theme="dark"] .hero {
  background: #26221c !important;
  border: 1px solid rgba(240, 230, 213, 0.1) !important;
  border-radius: 32px !important;
  padding: clamp(1.5rem, 4vw, 2.5rem) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .hero-copy {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .panel {
  background: #26221c !important;
  border-color: rgba(240, 230, 213, 0.1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .preview-toolbar {
  background: #2e2921 !important;
  border-color: rgba(240, 230, 213, 0.1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .report-sheet {
  background: #1c1a16 !important;
  border-color: rgba(240, 230, 213, 0.1) !important;
}

/* ── Dark: inputs ─────────────────────────────────────────── */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(240, 230, 213, 0.16) !important;
  color: #f0e6d5 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] select::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(240, 230, 213, 0.38) !important;
}

html[data-theme="dark"] input[readonly] {
  background: rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: rgba(45, 127, 114, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(45, 127, 114, 0.14) !important;
}

/* ── Dark: buttons ───────────────────────────────────────── */
html[data-theme="dark"] .button-ghost {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(240, 230, 213, 0.16) !important;
  color: #f0e6d5 !important;
}

/* ── Dark: domain pills ──────────────────────────────────── */
html[data-theme="dark"] .domain-pill {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(240, 230, 213, 0.14) !important;
  color: #f0e6d5 !important;
}

/* ── Dark: mockup / sample banners ──────────────────────── */
html[data-theme="dark"] .mockup-banner {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.1) !important;
}

html[data-theme="dark"] .mockup-banner span,
html[data-theme="dark"] .mockup-banner strong {
  color: #f0e6d5;
}

/* ── Dark: example / collapse cards ─────────────────────── */
html[data-theme="dark"] .example-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.1) !important;
}

/* ── Dark: sync / PIN card ───────────────────────────────── */
html[data-theme="dark"] .sync-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(240, 230, 213, 0.14) !important;
}

html[data-theme="dark"] .qrcode {
  background: #fff !important;
}

/* ── Dark: photo items ───────────────────────────────────── */
html[data-theme="dark"] .photo-item,
html[data-theme="dark"] .preview-photo-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.1) !important;
}

html[data-theme="dark"] .remove-photo {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f0e6d5 !important;
}

html[data-theme="dark"] .upload-field {
  background: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .empty-photos {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(240, 230, 213, 0.12) !important;
  color: rgba(240, 230, 213, 0.5) !important;
}

/* ── Dark: report meta/content cards ────────────────────── */
html[data-theme="dark"] .meta-card,
html[data-theme="dark"] .content-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.08) !important;
}

html[data-theme="dark"] .foundation-strip {
  background: rgba(45, 127, 114, 0.12) !important;
  border-color: rgba(240, 230, 213, 0.08) !important;
}

/* ── Dark: parent-responses cards & chips ────────────────── */
html[data-theme="dark"] .response-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(240, 230, 213, 0.12) !important;
}

html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .tag {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(240, 230, 213, 0.14) !important;
  color: #f0e6d5 !important;
}

/* ── Dark: parent-responses preview copy box ─────────────── */
html[data-theme="dark"] .response-preview-copy {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(240, 230, 213, 0.12) !important;
  color: #f0e6d5 !important;
}

html[data-theme="dark"] .response-preview-copy::after {
  background: linear-gradient(180deg, rgba(26, 22, 18, 0), #1a1612) !important;
}

/* ── Dark: weekly-intention summary cards ────────────────── */
html[data-theme="dark"] .summary-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.09) !important;
}

html[data-theme="dark"] .summary-card-wide {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ── Dark: weekly-intention day cards & table elements ───── */
html[data-theme="dark"] .day-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.09) !important;
}

html[data-theme="dark"] .intention-table thead th {
  background: rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .section-heading {
  background: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .mini-upload {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(240, 230, 213, 0.2) !important;
}

/* ── Dark: weekly-intention table ────────────────────────── */
html[data-theme="dark"] td,
html[data-theme="dark"] th {
  border-color: rgba(240, 230, 213, 0.12) !important;
}

/* ── Dark: text colors ───────────────────────────────────── */
html[data-theme="dark"] .panel-kicker,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .report-kicker,
html[data-theme="dark"] .meta-label {
  opacity: 0.85;
}

html[data-theme="dark"] .panel-note,
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .helper-copy,
html[data-theme="dark"] .photo-caption,
html[data-theme="dark"] .draft-status,
html[data-theme="dark"] .preview-note {
  color: rgba(240, 230, 213, 0.55) !important;
}

html[data-theme="dark"] .placeholder {
  color: rgba(240, 230, 213, 0.3) !important;
}

/* ── Dark: module bar suite links ────────────────────────── */
html[data-theme="dark"] .suite-link {
  color: #f0e6d5 !important;
}

html[data-theme="dark"] .suite-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ═══════════════════════════════════════════════════════════
   UI UPLIFT — both themes
   ═══════════════════════════════════════════════════════════ */

/* ── Hero & Hero Copy Unified (matches Parent Responses) ── */
.hero {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 32px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}

.hero-copy {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ── Module Bar ──────────────────────────────────────────── */
.module-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: background 0.25s, border-color 0.25s;
}

html[data-theme="dark"] .module-bar {
  background: rgba(22, 19, 15, 0.92) !important;
  border-color: rgba(240, 230, 213, 0.12) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5) !important;
}

.suite-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.suite-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.module-bar-sep {
  width: 1px;
  height: 1.2rem;
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

html[data-theme="dark"] .module-bar-sep {
  background: rgba(240, 230, 213, 0.18) !important;
}

.module-bar-spacer { flex: 1; }

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
  color: inherit;
  font-family: inherit;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(240, 230, 213, 0.22) !important;
  color: #f0e6d5 !important;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

/* ── Lang Switcher ───────────────────────────────────────── */
.lang-switcher {
  font-size: 0.8rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.lang-active { font-weight: 700; }
.lang-sep { margin: 0 0.3rem; opacity: 0.3; }
.lang-link { text-decoration: none; font-weight: 600; opacity: 0.65; transition: opacity 0.15s; }
.lang-link:hover { opacity: 1; }

/* ── Buttons ─────────────────────────────────────────────── */
.button {
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.button-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.25);
}

.button-ghost:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* ── Print: always force light ───────────────────────────── */
@media print {
  html[data-theme="dark"] {
    background: #fff !important;
  }
  html[data-theme="dark"] body {
    background: #fff !important;
  }
  html[data-theme="dark"] .panel,
  html[data-theme="dark"] .hero-copy,
  html[data-theme="dark"] .preview-toolbar,
  html[data-theme="dark"] .report-sheet {
    background: #fff !important;
    border-color: rgba(29, 47, 54, 0.1) !important;
  }
  html[data-theme="dark"] input,
  html[data-theme="dark"] textarea {
    background: #fff !important;
    color: #1d2f36 !important;
  }
  html[data-theme="dark"] .meta-card,
  html[data-theme="dark"] .content-card {
    background: #fff !important;
  }
}
