/* Public schedule calendar (templates/schedule.html)
   - Adds Week/Month toggle + calendar grid + selected-day list
   - Must work across themes via html[data-theme="..."] overrides
*/

.schedule-cal {
  --cal-surface: var(--schedule-surface, rgba(0, 0, 0, 0.12));
  --cal-border: var(--schedule-border, rgba(0, 0, 0, 0.10));
  --cal-text: var(--schedule-text, #ffffff);
  --cal-muted: var(--schedule-text-muted, rgba(255, 255, 255, 0.72));
  --cal-item-bg: var(--schedule-item-bg, rgba(0, 0, 0, 0.06));
  --cal-item-border: var(--schedule-item-border, rgba(0, 0, 0, 0.08));
  --cal-accent: var(--schedule-accent, var(--color-primary, #32b8c6));

  margin: 10px 0 22px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--cal-border);
  background: var(--cal-surface);
  box-shadow: var(--schedule-shadow, 0 18px 46px rgba(15, 23, 42, 0.10));
}

/* Top-level view toggle (List vs Calendar) */
.schedule-public__view-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 8px 0 14px;
  flex-wrap: wrap;
}

.schedule-public__view-btn {
  /* Keep buttons "not white" even in light themes */
  appearance: none;
  /* IMPORTANT: do NOT rely on color-mix() here (can be unsupported in some browsers) */
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.92), rgba(11, 18, 32, 0.82));
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 14px;
  padding: 14px 22px;
  min-width: 210px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition:
    transform 0.14s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.schedule-public__view-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.schedule-public__view-btn.is-active {
  /* Active is accent-colored; readable in all themes */
  background: var(--cal-accent);
  border-color: var(--cal-accent);
  color: #ffffff;
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.32),
    0 0 0 3px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.schedule-public__view-btn::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0;
  transform: rotate(12deg);
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.schedule-public__view-btn:hover::after,
.schedule-public__view-btn.is-active::after {
  opacity: 1;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .schedule-public__view-btn,
  .schedule-public__view-btn:hover,
  .schedule-public__view-btn.is-active {
    transition: none !important;
    animation: none !important;
  }
}

/* === THEME: LIGHT / LIGHT_JAPAN ===
   User request: never white buttons in light theme. Keep premium dark look. */
html[data-theme="light"] .schedule-public__view-btn,
html[data-theme="light_japan"] .schedule-public__view-btn {
  border-color: rgba(0, 0, 0, 0.24);
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.94), rgba(11, 18, 32, 0.84));
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

html[data-theme="light"] .schedule-public__view-btn:hover,
html[data-theme="light_japan"] .schedule-public__view-btn:hover {
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.30),
    0 0 0 3px rgba(11, 18, 32, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* === THEME: NEON === */
@keyframes scheduleViewNeonPulse {
  0%   { box-shadow: 0 22px 56px rgba(0,0,0,0.45), 0 0 0 3px rgba(0, 243, 255, 0.18), 0 0 22px rgba(0, 243, 255, 0.22), inset 0 1px 0 rgba(255,255,255,0.20); }
  100% { box-shadow: 0 22px 56px rgba(0,0,0,0.45), 0 0 0 3px rgba(188, 19, 254, 0.22), 0 0 28px rgba(0, 243, 255, 0.30), inset 0 1px 0 rgba(255,255,255,0.24); }
}

html[data-theme="neon"] .schedule-public__view-btn {
  border-color: rgba(0, 243, 255, 0.42);
  background: linear-gradient(180deg, rgba(4, 8, 20, 0.92), rgba(4, 8, 20, 0.78));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(0, 243, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

html[data-theme="neon"] .schedule-public__view-btn:hover {
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.60),
    0 0 0 3px rgba(0, 243, 255, 0.18),
    0 0 26px rgba(0, 243, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

html[data-theme="neon"] .schedule-public__view-btn.is-active {
  background: linear-gradient(135deg, var(--color-primary, #00f3ff), var(--color-purple, #bc13fe));
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  animation: scheduleViewNeonPulse 1.8s ease-in-out infinite alternate;
}

/* === THEME: HARD_JAPAN (red + gold) === */
@keyframes scheduleViewJapanPulse {
  0%   { box-shadow: 0 20px 52px rgba(0,0,0,0.55), 0 0 0 3px rgba(201, 24, 43, 0.18), inset 0 1px 0 rgba(255,255,255,0.18); }
  100% { box-shadow: 0 20px 52px rgba(0,0,0,0.55), 0 0 0 3px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255,255,255,0.22); }
}

html[data-theme="hard_japan"] .schedule-public__view-btn {
  border-color: rgba(201, 24, 43, 0.45);
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.92), rgba(16, 16, 16, 0.86));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.60),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="hard_japan"] .schedule-public__view-btn:hover {
  border-color: rgba(201, 24, 43, 0.75);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.65),
    0 0 0 3px rgba(201, 24, 43, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html[data-theme="hard_japan"] .schedule-public__view-btn.is-active {
  background: var(--accent-primary, #c9182b);
  border-color: rgba(212, 175, 55, 0.72); /* gold edge */
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.65),
    0 0 22px rgba(201, 24, 43, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: scheduleViewJapanPulse 1.9s ease-in-out infinite alternate;
}

.schedule-public__view {
  display: none;
}

.schedule-public__view.is-active {
  display: block;
}

.schedule-public__view--calendar.is-active {
  display: block;
}

.schedule-public__view--list.is-active {
  display: block;
}

/* Light themes: keep surfaces light and text dark */
html[data-theme="light"] .schedule-cal,
html[data-theme="light_japan"] .schedule-cal {
  --cal-text: #0b1220;
  --cal-muted: rgba(11, 18, 32, 0.70);
  --cal-border: rgba(0, 0, 0, 0.12);
  --cal-item-bg: rgba(255, 255, 255, 0.92);
  --cal-item-border: rgba(0, 0, 0, 0.12);
}

/* Dark-ish themes: bump borders */
html[data-theme="neon"] .schedule-cal,
html[data-theme="hard_japan"] .schedule-cal {
  --cal-border: rgba(255, 255, 255, 0.14);
  --cal-item-border: rgba(255, 255, 255, 0.12);
}

.schedule-cal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.schedule-cal__modes {
  display: inline-flex;
  gap: 8px;
  background: color-mix(in srgb, var(--cal-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cal-accent) 35%, var(--cal-border));
  border-radius: 999px;
  padding: 4px;
}

.schedule-cal__mode {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cal-text);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.schedule-cal__mode:hover {
  transform: translateY(-1px);
}

.schedule-cal__mode.is-active {
  background: var(--cal-accent);
  color: #ffffff;
}

.schedule-cal__nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.schedule-cal__nav-title {
  min-width: 160px;
  text-align: center;
  font-weight: 900;
  color: var(--cal-text);
  letter-spacing: 0.02em;
}

.schedule-cal__nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--cal-item-border);
  background: var(--cal-item-bg);
  color: var(--cal-text);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease;
}

.schedule-cal__nav-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cal-accent) 40%, var(--cal-item-border));
  background: color-mix(in srgb, var(--cal-accent) 10%, var(--cal-item-bg));
}

.schedule-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
  color: var(--cal-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.schedule-cal--week .schedule-cal__weekdays {
  display: none;
}

.schedule-cal__grid {
  display: grid;
  gap: 8px;
}

.schedule-cal--week .schedule-cal__grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-cal--month .schedule-cal__grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-cal__cell {
  position: relative;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--cal-item-border);
  background: var(--cal-item-bg);
  color: var(--cal-text);
  padding: 10px 10px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease;
}

.schedule-cal__cell:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cal-accent) 35%, var(--cal-item-border));
  background: color-mix(in srgb, var(--cal-accent) 10%, var(--cal-item-bg));
}

.schedule-cal__cell.is-outside {
  opacity: 0.45;
  cursor: default;
}

.schedule-cal__cell.is-outside:hover {
  transform: none;
}

.schedule-cal__cell.is-selected {
  border-color: color-mix(in srgb, var(--cal-accent) 70%, var(--cal-item-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cal-accent) 18%, transparent);
}

.schedule-cal__daynum {
  font-weight: 900;
  font-size: 14px;
}

.schedule-cal__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cal-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.schedule-cal__day {
  margin-top: 14px;
  border-top: 1px solid var(--cal-border);
  padding-top: 14px;
}

.schedule-cal__day-title {
  color: var(--cal-text);
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 10px;
}

.schedule-cal__empty {
  color: var(--cal-muted);
  font-weight: 800;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--cal-item-border);
  background: transparent;
}

.schedule-cal__release {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-cal__meta {
  min-width: 0;
}

.schedule-cal__title {
  font-weight: 900;
  color: var(--cal-text);
  font-size: 15px;
  line-height: 1.15;
}

.schedule-cal__sub {
  margin-top: 4px;
  color: var(--cal-muted);
  font-weight: 800;
  font-size: 12px;
}

@media (max-width: 768px) {
  .schedule-cal {
    padding: 14px;
  }
  .schedule-cal__nav-title {
    min-width: 120px;
  }
  .schedule-cal__cell {
    min-height: 44px;
    /* На узких экранах 7 колонок очень тесные.
       Даём место под бейдж количества релизов, чтобы он не налезал на число дня. */
    padding: 8px 8px 10px;
    padding-right: 26px;
  }
  .schedule-cal__daynum {
    font-size: 13px;
  }
  .schedule-cal__badge {
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
  }
  .schedule-public__view-btn {
    min-width: 170px;
    padding: 14px 16px;
  }
}

