/* Tidebet seasonal themes (body[data-theme="…"]) */

body[data-theme="default"] {
  --tb-accent: #2563eb;
  --tb-header-bg: rgb(12 16 43);
}

body[data-theme="christmas"] {
  --tb-accent: #16a34a;
  --tb-accent-secondary: #dc2626;
  --tb-header-bg: rgb(12 16 43);
}

body[data-theme="halloween"] {
  --tb-accent: #f97316;
  --tb-accent-secondary: #a855f7;
  --tb-header-bg: rgb(18 10 32);
}

body[data-theme="summer"] {
  --tb-accent: #0ea5e9;
  --tb-accent-secondary: #fbbf24;
  --tb-header-bg: rgb(10 22 48);
}

body[data-theme="default"] .theme-fx-layer {
  display: none;
}

body[data-theme] {
  --site-header-bg: var(--tb-header-bg, rgb(12 16 43));
}

.site-header-themed {
  background: var(--tb-header-bg, var(--site-header-bg)) !important;
}

.theme-fx-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
}

#theme-snow-canvas {
  width: 100%;
  height: 100%;
  opacity: 1;
}

body[data-theme="christmas"] button:not(:disabled) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

body[data-theme="christmas"] button:not(:disabled) > * {
  position: relative;
  z-index: 1;
}

body[data-theme="christmas"] button:not(:disabled)[data-snow-cap]::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 0;
  height: var(--snow-cap-height, 10px);
  pointer-events: none;
  background-color: #ffffff;
  border-top-left-radius: var(--snow-cap-radius-tl, 8px);
  border-top-right-radius: var(--snow-cap-radius-tr, 8px);
  clip-path: var(--snow-cap-clip);
  box-shadow: inset 0 -1px 0 rgba(203, 213, 225, 0.55);
}

.admin-theme-card {
  cursor: pointer;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.15s, transform 0.15s;
}

.admin-theme-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.admin-theme-card--active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.admin-theme-card__preview {
  height: 64px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.admin-theme-card__preview--default {
  background: rgb(12 16 43);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

.admin-theme-card__preview--christmas {
  background: rgb(12 16 43);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
  position: relative;
  overflow: hidden;
}

.admin-theme-card__preview--christmas::before,
.admin-theme-card__preview--christmas::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.85;
}

.admin-theme-card__preview--christmas::before {
  top: 12px;
  left: 24%;
}

.admin-theme-card__preview--christmas::after {
  top: 28px;
  right: 20%;
  width: 4px;
  height: 4px;
}

.admin-theme-card__preview--halloween {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgb(18 10 32), rgb(67 20 7));
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35);
}

.admin-theme-card__preview--halloween::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f97316;
  top: 18px;
  left: 30%;
  opacity: 0.9;
}

.admin-theme-card__preview--summer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgb(10 22 48), rgb(14 116 144));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.25);
}

.admin-theme-card__preview--summer::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef3c7, #fbbf24);
  top: 14px;
  right: 22%;
}

/* Admin: Telegram settings form */
.admin-tg-form {
  display: grid;
  gap: 18px;
}

.admin-field {
  display: grid;
  gap: 6px;
}

.admin-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.admin-field__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
}

.admin-field__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.admin-field__count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #64748b;
}

.admin-field__count--over {
  color: #f87171;
  font-weight: 700;
}

.admin-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgb(15 20 44);
  color: #f1f5f9;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.admin-input:focus {
  border-color: var(--tb-accent, #2563eb);
}

.admin-input[aria-invalid="true"] {
  border-color: #f87171;
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.admin-toggle__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.admin-toggle__track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.55);
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.admin-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.admin-toggle__input:checked + .admin-toggle__track {
  background: var(--tb-accent, #2563eb);
}

.admin-toggle__input:checked + .admin-toggle__track .admin-toggle__thumb {
  transform: translateX(18px);
}

.admin-toggle__input:focus-visible + .admin-toggle__track {
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.8);
}

.admin-toggle__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
}

.admin-tg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-status--ok {
  color: #4ade80 !important;
}

.admin-status--error {
  color: #f87171 !important;
}
