/* МелМК — декоративные эффекты (новые классы mm-*) */

.mm-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.mm-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.55;
  will-change: transform;
}

.mm-blob--a {
  width: 140px;
  height: 140px;
  top: -48px;
  left: -24px;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}

.mm-blob--b {
  width: 120px;
  height: 120px;
  top: -36px;
  right: 40px;
  background: color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.mm-blob--c {
  width: 90px;
  height: 90px;
  bottom: -40px;
  right: 10%;
  background: color-mix(in srgb, var(--accent-3) 35%, transparent);
}

.mm-nav-pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: calc(20% - 4px);
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.mm-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
  margin-top: var(--space-3);
}

.mm-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--hero-grad);
  transition: width 400ms linear;
}

.mm-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    var(--bg-muted) 0%,
    color-mix(in srgb, var(--bg-elev) 80%, var(--accent-soft)) 50%,
    var(--bg-muted) 100%
  );
  background-size: 200% 100%;
  animation: mm-shimmer 1.2s ease-in-out infinite;
  min-height: 72px;
  margin-bottom: var(--space-2);
}

.mm-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgb(255 255 255 / 35%);
  pointer-events: none;
  animation: mm-ripple 520ms ease-out forwards;
}

[data-theme="dark"] .mm-ripple {
  background: rgb(255 255 255 / 18%);
}

.mm-day-enter {
  animation: mm-day-slide 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mm-stagger > .lesson-card:nth-child(1) { animation-delay: 0ms; }
.mm-stagger > .lesson-card:nth-child(2) { animation-delay: 40ms; }
.mm-stagger > .lesson-card:nth-child(3) { animation-delay: 80ms; }
.mm-stagger > .lesson-card:nth-child(4) { animation-delay: 120ms; }
.mm-stagger > .lesson-card:nth-child(5) { animation-delay: 160ms; }
.mm-stagger > .lesson-card:nth-child(6) { animation-delay: 200ms; }
.mm-stagger > .lesson-card:nth-child(7) { animation-delay: 240ms; }
.mm-stagger > .lesson-card:nth-child(8) { animation-delay: 280ms; }

.mm-theme-flash {
  animation: mm-theme-flash 420ms ease;
}

@keyframes mm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes mm-ripple {
  to {
    transform: scale(2.4);
    opacity: 0;
  }
}

@keyframes mm-day-slide {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes mm-theme-flash {
  0% { filter: saturate(1.2) brightness(1.05); }
  100% { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mm-blob,
  .mm-nav-pill,
  .mm-skeleton,
  .mm-ripple,
  .mm-day-enter,
  .mm-theme-flash,
  .mm-progress__bar {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .mm-blob {
    opacity: 0.35;
    filter: blur(22px);
  }
}

/* ========== Анимированный фон ========== */
.mm-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.mm-bg__shape {
  position: absolute;
  border-radius: 40% 60% 55% 45% / 50% 45% 55% 50%;
  opacity: 0.22;
  filter: blur(2px);
  will-change: transform;
  animation: mm-float 28s ease-in-out infinite;
}

[data-theme="dark"] .mm-bg__shape {
  opacity: 0.14;
}

.mm-bg__shape--1 {
  width: min(48vw, 320px);
  height: min(48vw, 320px);
  top: -8%;
  left: -10%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  animation-duration: 32s;
}

.mm-bg__shape--2 {
  width: min(42vw, 280px);
  height: min(42vw, 280px);
  top: 18%;
  right: -12%;
  background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--accent-2) 50%, transparent), transparent 70%);
  animation-duration: 36s;
  animation-delay: -8s;
  border-radius: 60% 40% 45% 55% / 45% 55% 45% 55%;
}

.mm-bg__shape--3 {
  width: min(36vw, 240px);
  height: min(36vw, 240px);
  bottom: 22%;
  left: 8%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent-3) 40%, transparent), transparent 70%);
  animation-duration: 40s;
  animation-delay: -14s;
}

.mm-bg__shape--4 {
  width: min(28vw, 180px);
  height: min(28vw, 180px);
  bottom: 8%;
  right: 18%;
  background: radial-gradient(circle at 40% 60%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
  animation-duration: 26s;
  animation-delay: -4s;
  border-radius: 50%;
}

.mm-bg__shape--5 {
  width: min(22vw, 140px);
  height: min(22vw, 140px);
  top: 42%;
  left: 42%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 70%);
  animation-duration: 44s;
  animation-delay: -20s;
  border-radius: 35% 65% 50% 50% / 60% 40% 60% 40%;
}

@keyframes mm-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  33% { transform: translate3d(18px, -22px, 0) rotate(8deg) scale(1.04); }
  66% { transform: translate3d(-16px, 14px, 0) rotate(-6deg) scale(0.97); }
}

/* ========== Расписание звонков ========== */
.mm-bells {
  margin: 0 var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mm-bells__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: 0 var(--space-4);
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.mm-bells__toggle-icon {
  font-size: 1.1rem;
}

.mm-bells__toggle-text {
  flex: 1;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}

.mm-bells__chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 220ms ease;
  margin-bottom: 4px;
}

.mm-bells.is-open .mm-bells__chevron {
  transform: rotate(225deg);
  margin-bottom: 0;
  margin-top: 4px;
}

.mm-bells__panel {
  padding: 0 var(--space-3) var(--space-3);
}

.mm-bells__panel[hidden] {
  display: none;
}

.mm-bells__scroll {
  display: grid;
  gap: var(--space-3);
}

.mm-bells__card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.mm-bells__title {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
  background: var(--hero-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mm-bells__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

.mm-bells__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  min-width: 280px;
}

.mm-bells__table th,
.mm-bells__table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.mm-bells__table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 800;
  background: var(--bg-muted);
}

.mm-bells__table tbody tr:last-child td {
  border-bottom: none;
}

.mm-bells__table td:nth-child(2) {
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
  color: var(--accent);
}

.mm-bells__table td:nth-child(3) {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.mm-bells__special td:first-child {
  font-weight: 700;
  color: var(--accent-3);
  max-width: 160px;
  line-height: 1.3;
}

.mm-bells__special {
  background: color-mix(in srgb, var(--accent-3) 8%, transparent);
}

@media (min-width: 720px) {
  .mm-bells {
    margin-inline: var(--space-5);
  }
  .mm-bells__scroll {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .mm-bells__table th,
  .mm-bells__table td {
    padding: 8px 8px;
    font-size: 0.75rem;
  }
  .mm-bells__special td:first-child {
    max-width: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mm-bg__shape {
    animation: none !important;
  }
}

@media print {
  .mm-bg,
  .mm-bells {
    display: none !important;
  }
}
