/* ==========================================================================
   СЕМЕЙНЫЙ НОВОГОДНИЙ ПОРТАЛ 2027 // STYLESHEET
   Дизайн: Modern Frosted Glass, Winter Emerald, Deep Midnight Navy, Gold
   Аппаратное ускорение (60 FPS), Pixel-Perfect & Mobile-First
   ========================================================================== */

:root {
  --bg-primary: #070d18;
  --bg-secondary: #0b1526;
  --card-bg: rgba(16, 28, 48, 0.72);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-hover: rgba(26, 44, 76, 0.85);
  
  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.35);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);
  --accent-cyan: #38bdf8;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Снегопад Canvas */
#snowCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.app-container {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   HERO ШАПКА
   ========================================================================== */
.hero-header {
  text-align: center;
  padding: 24px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #e2e8f0 70%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  max-width: 620px;
}

/* ==========================================================================
   НАВИГАЦИОННЫЕ ВКЛАДКИ
   ========================================================================== */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  margin-top: 14px;
  width: 100%;
  max-width: 680px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1;
  min-width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.tab-btn.admin-tab.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(244, 63, 94, 0.25));
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.25);
}

/* ==========================================================================
   КОНТЕЙНЕРЫ И КАРТОЧКИ
   ========================================================================== */
.main-content {
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-pane.active {
  display: flex;
}

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

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 4px;
}

.pane-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
}

.pane-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

/* ==========================================================================
   1. ТАЙМЛАЙН / РАСПИСАНИЕ
   ========================================================================== */
.timeline-summary-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.timeline-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.timeline-card:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateX(4px);
}

.timeline-time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.timeline-start-time {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.timeline-dur-badge {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 500;
}

.timeline-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-icon {
  font-size: 1.3rem;
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.timeline-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.timeline-delete-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   2. ГОЛОСОВАНИЕ ПО ДАТАМ
   ========================================================================== */
.voting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.vote-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.vote-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.vote-card.selected {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.vote-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.vote-date-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.vote-count-badge {
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
}

.vote-card.selected .vote-count-badge {
  background: var(--accent-emerald);
  color: #ffffff;
}

.vote-note {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.vote-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.voters-avatars-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.voter-tag {
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.user-vote-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.vote-box-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.vote-input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.vote-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ==========================================================================
   3. КОНКУРС ДЕТЕЙ
   ========================================================================== */
.contest-rules-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(16, 185, 129, 0.08));
  border-color: rgba(251, 191, 36, 0.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rules-badge {
  background: var(--accent-gold);
  color: #000000;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.rules-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rule-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.rule-col strong {
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.contestant-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.2s ease;
}

.contestant-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

.contestant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contestant-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.contestant-category {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.contestant-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.detail-row {
  display: flex;
  gap: 6px;
}

.detail-label {
  color: var(--text-dim);
  min-width: 75px;
}

.detail-val {
  color: var(--text-main);
  font-weight: 500;
}

.contestant-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.like-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  transform: scale(1.05);
}

.like-btn.liked {
  background: var(--accent-rose);
  color: #ffffff;
}

/* ==========================================================================
   4. КАБИНЕТ ОРГАНИЗАТОРА (ЧОЛПОНКА)
   ========================================================================== */
.auth-card {
  max-width: 440px;
  margin: 30px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lock-icon {
  font-size: 2.5rem;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.auth-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-input-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.auth-note {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(16, 185, 129, 0.1));
  border-color: rgba(251, 191, 36, 0.3);
}

.admin-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
}

.greeting-icon {
  font-size: 2rem;
}

.admin-greeting h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-greeting p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title-row h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   ИНПУТЫ И КНОПКИ
   ========================================================================== */
.custom-input {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  width: 100%;
}

.custom-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.primary-btn:active {
  transform: translateY(1px);
}

.primary-btn.add-btn {
  width: 100%;
  padding: 12px;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.danger-btn {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.danger-btn:hover {
  background: var(--accent-rose);
  color: #ffffff;
}

/* ==========================================================================
   ПОДВАЛ И УВЕДОМЛЕНИЯ
   ========================================================================== */
.app-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-emerald);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.3);
  z-index: 999;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   АДАПТИВНОСТЬ (MOBILE-FIRST)
   ========================================================================== */
@media (max-width: 640px) {
  .app-container {
    padding: 16px 12px 40px;
    gap: 16px;
  }
  
  .timeline-card {
    grid-template-columns: 70px 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }
  
  .timeline-start-time {
    font-size: 1.1rem;
  }
  
  .rules-columns {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .nav-tabs {
    border-radius: var(--radius-md);
  }
  
  .tab-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .admin-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .admin-actions {
    width: 100%;
  }
  
  .admin-actions button {
    flex: 1;
  }
}
