/* «Не с понедельника» — светлая тема с тёмно-синими акцентами */

:root {
  --navy-900: #0a1838;
  --navy-800: #102451;
  --navy-700: #16306b;
  --navy-600: #1e3f8a;
  --blue-500: #2b5cd9;
  --blue-400: #4f7df5;
  --sky-100: #e6eeff;
  --bg: #f4f7ff;
  --surface: #ffffff;
  --text: #14233f;
  --text-soft: #5a6a8c;
  --border: #dfe7f7;
  --shadow: 0 6px 24px rgba(16, 36, 81, 0.08);
  --shadow-lift: 0 16px 40px rgba(16, 36, 81, 0.16);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, .logo, .login-mark { font-family: 'Unbounded', 'Inter', sans-serif; }

/* --- Фоновые «орбы» --- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: drift 24s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; top: -180px; right: -120px; background: radial-gradient(circle, #c9d9ff, transparent 70%); }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; bottom: -160px; left: -120px; background: radial-gradient(circle, #d7e4ff, transparent 70%); animation-delay: -8s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; top: 40%; left: 55%; background: radial-gradient(circle, #e3ecff, transparent 70%); animation-delay: -16s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-50px, 40px) scale(1.12); }
}

/* --- Шапка --- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 17px; font-weight: 700; color: var(--navy-900);
  text-decoration: none; line-height: 1; letter-spacing: -.3px;
}
.logo span { display: block; font-size: 11px; font-weight: 500; color: var(--blue-500); }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  color: var(--text-soft); font-weight: 600; font-size: 14px;
  transition: all .2s;
}
.nav-link:hover { color: var(--navy-800); background: var(--sky-100); }
.nav-admin { color: var(--blue-500); }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-700), var(--blue-400));
  color: #fff; font-weight: 700; font-size: 14px;
}
.username { font-weight: 600; font-size: 14px; }
.logout { font-size: 13px; color: var(--text-soft); text-decoration: none; }
.logout:hover { color: var(--navy-800); }

/* --- Контейнер --- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 36px 28px 64px; flex: 1; }
.center-page { display: flex; align-items: center; justify-content: center; }

/* --- Hero --- */
.hero { padding: 28px 0 40px; animation: rise .6s ease both; }
.hero h1 {
  font-size: clamp(30px, 5vw, 46px); font-weight: 700; letter-spacing: -1px;
  background: linear-gradient(100deg, var(--navy-900) 20%, var(--blue-500) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin-top: 12px; font-size: 17px; color: var(--text-soft); max-width: 560px; }

.hero-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--blue-500); margin-bottom: 12px; font-family: 'Inter', sans-serif;
}
.hero-compact { padding: 8px 0 28px; }
.hero-emoji { font-size: .85em; }

/* --- Блок ближайшего события --- */
.event-block { margin-bottom: 44px; animation: rise .55s ease both; animation-delay: 120ms; }
.event-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(115deg, var(--navy-900), var(--navy-700) 55%, var(--blue-500) 130%);
  border-radius: 22px; padding: 26px 30px;
  box-shadow: 0 18px 44px rgba(16, 36, 81, .3);
}
.event-card::after {
  content: ''; position: absolute; right: -70px; top: -90px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 160, 255, .35), transparent 70%);
  animation: pulse 5s ease-in-out infinite alternate;
}
@keyframes pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.25); opacity: 1; } }
.event-badge {
  align-self: flex-start;
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: #bcd0ff; background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
}
.event-main { flex: 1; min-width: 220px; }
.event-title { font-size: 20px; font-weight: 700; color: #fff; font-family: 'Unbounded', sans-serif; letter-spacing: -.3px; }
.event-when { margin-top: 8px; font-size: 15px; font-weight: 600; color: #b9ccff; }
.event-next { margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, .55); }
.btn-light { background: #fff; color: var(--navy-800); position: relative; z-index: 1; }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }

/* --- Карточки групп --- */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.group-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; min-height: 168px;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 70ms);
}
.group-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: var(--blue-400); }
.group-emoji {
  width: 52px; height: 52px; border-radius: 16px; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--sky-100), #d4e2ff);
}
.group-info h3 { font-size: 16px; letter-spacing: -.3px; color: var(--navy-900); }
.group-info p { margin-top: 6px; font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }
.group-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.group-count {
  font-size: 12px; font-weight: 700; color: var(--blue-500);
  background: var(--sky-100); border-radius: 999px; padding: 4px 12px;
}
.group-arrow { color: var(--blue-400); font-size: 18px; transition: transform .25s; }
.group-card:hover .group-arrow { transform: translateX(6px); }

.card-tags { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.card-tags .card-date { margin-top: 0; }

/* --- Секции потоков --- */
.stream-section { margin-bottom: 48px; }
.stream-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.stream-head h2 { font-size: 21px; font-weight: 700; color: var(--navy-900); }
.stream-count {
  font-size: 12px; font-weight: 700; color: var(--blue-500);
  background: var(--sky-100); border-radius: 999px; padding: 4px 12px;
}

/* --- Сетка карточек --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card {
  display: block; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 60ms);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: var(--blue-400); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--navy-900); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.05); }
.thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-600) 60%, var(--blue-500));
  color: rgba(255, 255, 255, .85); font-size: 34px;
}
.thumb-placeholder.small { font-size: 18px; border-radius: 10px; }
.thumb-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 24, 56, 0); transition: background .25s;
}
.play-btn {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .94); color: var(--navy-800);
  font-size: 18px; padding-left: 4px;
  opacity: 0; transform: scale(.7); transition: all .25s ease;
  box-shadow: 0 8px 24px rgba(10, 24, 56, .35);
}
.card:hover .thumb-overlay { background: rgba(10, 24, 56, .28); }
.card:hover .play-btn { opacity: 1; transform: scale(1); }
.card-body { padding: 16px 18px 18px; }
.card-body h3 { font-size: 15px; font-weight: 600; line-height: 1.4; font-family: 'Inter', sans-serif; }
.card-date { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--blue-500); }
.card-desc {
  margin-top: 8px; font-size: 13.5px; color: var(--text-soft); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Страница видео --- */
.breadcrumbs { margin-bottom: 22px; animation: rise .4s ease both; }
.breadcrumbs a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--navy-700); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; box-shadow: var(--shadow);
  transition: all .2s ease;
}
.breadcrumbs a:hover {
  border-color: var(--blue-400); color: var(--blue-500);
  transform: translateX(-3px); box-shadow: var(--shadow-lift);
}
.video-page { animation: rise .5s ease both; }
.player-wrap {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--navy-900); box-shadow: var(--shadow-lift);
}
.player-wrap iframe, .player-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-external { display: flex; align-items: center; justify-content: center; text-align: center; }
.player-external p { color: rgba(255, 255, 255, .75); margin-bottom: 18px; font-size: 15px; }
.video-meta { padding: 26px 6px 10px; max-width: 820px; }
.video-tags { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tag {
  font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: 999px;
  background: var(--sky-100); color: var(--navy-700);
}
.tag-muted { background: #eef1f8; color: var(--text-soft); }
.tag-warn { background: #fff3e0; color: #b26a00; }
.video-meta h1 { font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -.5px; color: var(--navy-900); }
.video-desc {
  margin-top: 16px; font-size: 15.5px; line-height: 1.7; color: #33405e;
  white-space: pre-line;
}

/* --- Логин --- */
.login-card {
  width: 100%; max-width: 460px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 26px; padding: 48px 40px; box-shadow: var(--shadow-lift);
  animation: rise .55s ease both;
}
.login-mark { font-size: 20px; font-weight: 700; color: var(--navy-900); margin-bottom: 26px; line-height: 1.1; }
.login-mark span { display: block; font-size: 13px; color: var(--blue-500); font-weight: 500; }
.login-card h1 { font-size: 26px; letter-spacing: -.5px; }
.login-sub { margin: 14px 0 28px; color: var(--text-soft); font-size: 15px; line-height: 1.6; }
.tg-widget { display: flex; justify-content: center; min-height: 46px; }
.btn-tg { width: 100%; }
.wait-note {
  margin-top: 18px; font-size: 13.5px; color: var(--text-soft); line-height: 1.6;
  background: var(--sky-100); border-radius: 12px; padding: 12px 16px;
}
.wait-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue-500); margin-right: 6px;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.dev-login {
  margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.dev-label { font-size: 12px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .8px; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 22px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: all .2s ease;
}
.btn-primary {
  background: linear-gradient(120deg, var(--navy-700), var(--blue-500));
  color: #fff; box-shadow: 0 8px 20px rgba(43, 92, 217, .3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(43, 92, 217, .4); }
.btn-ghost { background: var(--sky-100); color: var(--navy-700); }
.btn-ghost:hover { background: #d8e4ff; }
.btn-danger { background: #ffe9e9; color: #c0392b; }
.btn-danger:hover { background: #ffd6d6; }
.btn-lg { padding: 14px 30px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }

/* --- Формы --- */
input, textarea, select {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--border); background: #fbfcff;
  font-family: 'Inter', sans-serif; font-size: 14.5px; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus { outline: 0; border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(79, 125, 245, .14); background: #fff; }
textarea { resize: vertical; line-height: 1.6; }

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
  max-width: 760px; margin-bottom: 24px; animation: rise .5s ease both;
}
.form-card h1 { font-size: 24px; margin-bottom: 24px; letter-spacing: -.5px; }
.form-card h2 { font-size: 17px; margin-bottom: 16px; }
.video-form { display: flex; flex-direction: column; gap: 20px; }
.video-form label { display: flex; flex-direction: column; gap: 8px; }
.video-form label > span { font-size: 13.5px; font-weight: 700; color: var(--navy-800); }
.video-form small { font-size: 12.5px; color: var(--text-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input[name="telegram_id"] { max-width: 200px; }

/* --- Админка --- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; animation: rise .4s ease both; }
.admin-head h1 { font-size: 28px; letter-spacing: -.5px; }
.admin-actions { display: flex; gap: 10px; }
.count-badge {
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; vertical-align: middle;
  background: var(--sky-100); color: var(--blue-500); border-radius: 999px; padding: 4px 12px;
}
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
  animation: rise .45s ease both; animation-delay: calc(var(--i, 0) * 40ms);
}
.admin-row:hover { border-color: var(--blue-400); }
.admin-order { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.order-btn {
  width: 30px; height: 26px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--navy-700); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s; line-height: 1;
}
.order-btn:hover:not(:disabled) { border-color: var(--blue-400); color: var(--blue-500); background: var(--sky-100); }
.order-btn:disabled { opacity: .3; cursor: default; }
.admin-thumb { width: 120px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-info { flex: 1; min-width: 0; }
.admin-row-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.admin-row-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-row-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-soft); padding: 8px 12px; }
.users-table td { padding: 10px 12px; border-top: 1px solid var(--border); }

.info-banner {
  background: #e9f7ef; color: #1e7a45; border-radius: 14px; padding: 14px 20px;
  font-size: 14px; font-weight: 500; margin-bottom: 22px;
}
.info-banner.warn { background: #fff7e6; color: #9a6700; }

/* --- Прочее --- */
.alert {
  background: #ffe9e9; color: #c0392b; border-radius: 12px;
  padding: 12px 18px; font-size: 14px; font-weight: 500; margin-bottom: 18px;
}
.empty-state { text-align: center; padding: 80px 20px; animation: rise .5s ease both; }
.empty-icon { font-size: 44px; margin-bottom: 16px; }
.empty-state h2 { font-size: 22px; margin-bottom: 10px; }
.empty-state p { color: var(--text-soft); margin-bottom: 24px; }
.footer { text-align: center; padding: 28px; color: var(--text-soft); font-size: 13px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; gap: 12px; }
  .username { display: none; }
  .container { padding: 24px 16px 48px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-row { flex-wrap: wrap; }
  .admin-thumb { width: 90px; }
  .admin-row-actions { width: 100%; justify-content: flex-end; }
  .inline-form { flex-direction: column; }
  .inline-form input[name="telegram_id"] { max-width: none; }
}
