/* Light theme — overrides :root tokens when html[data-theme="light"] */

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f8fafc;
  --border: #e2e8f0;
  --border-soft: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent-glow: rgba(99, 102, 241, 0.14);
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  --card: #ffffff;
}

html[data-theme="light"] .login-page {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(34, 211, 238, 0.08), transparent),
    var(--bg);
}

html[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.98);
}

html[data-theme="light"] .sidebar-nav a:hover,
html[data-theme="light"] .sidebar-nav a.active {
  background: rgba(99, 102, 241, 0.1);
}

html[data-theme="light"] .btn:not(.primary) {
  background: rgba(99, 102, 241, 0.06);
}

html[data-theme="light"] .btn:not(.primary):hover {
  background: rgba(99, 102, 241, 0.12);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .panel,
html[data-theme="light"] .channel-card,
html[data-theme="light"] .schedule-card,
html[data-theme="light"] .order-row,
html[data-theme="light"] .campaign-card {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .channel-pick-overlay {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .platform-pick-card,
html[data-theme="light"] .media-upload-tile,
html[data-theme="light"] .tiktok-option-chip,
html[data-theme="light"] .scheduled-stat {
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .platform-pick-card.is-checked {
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 1px var(--platform-color), 0 4px 12px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .schedule-field input[type="datetime-local"] {
  color-scheme: light;
  background: linear-gradient(135deg, #ffffff 0%, rgba(99, 102, 241, 0.06) 100%);
}

html[data-theme="light"] .tiktok-post-panel {
  border-color: rgba(0, 242, 234, 0.35);
  background: linear-gradient(145deg, rgba(0, 242, 234, 0.06), rgba(99, 102, 241, 0.04));
}

html[data-theme="light"] .tiktok-option-chip.is-on {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.45);
  color: #15803d;
}

html[data-theme="light"] .home-view-hero {
  background: linear-gradient(135deg, var(--bg) 0%, rgba(99, 102, 241, 0.06) 100%);
}

html[data-theme="light"] .countdown-badge--soon {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

html[data-theme="light"] .post-outcome--ok {
  background: rgba(34, 197, 94, 0.1);
}

html[data-theme="light"] .post-outcome--err {
  background: rgba(239, 68, 68, 0.08);
}

/* Settings — theme segment */
.settings-panel {
  max-width: 28rem;
}

.settings-panel label:first-child {
  margin-top: 0;
}

.settings-field {
  width: 100%;
  margin-bottom: 0.25rem;
}

.settings-theme-label {
  display: block;
  margin-top: 1.5rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
}

.settings-theme-hint {
  margin: 0.35rem 0 0.85rem;
}

.theme-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.theme-segment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-hover);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.theme-segment-btn:hover {
  border-color: var(--accent);
}

.theme-segment-btn.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.08));
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.theme-segment-btn span:first-child {
  font-size: 1.15rem;
  line-height: 1;
}

html[data-theme="light"] .theme-segment-btn.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.06));
}

.login-theme-fab {
  position: fixed;
  top: 1rem;
  inset-inline-end: 1rem;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.login-theme-fab:hover {
  border-color: var(--accent);
}
