/* ── Цвета из AppTheme (app_theme.dart) ────────────────────── */
:root {
  --bg: #F8FAFC;          /* AppTheme.background */
  --surface: #FFFFFF;     /* AppTheme.surface */
  --border: #E2E8F0;      /* AppTheme.border */
  --borderLight: #F1F5F9; /* AppTheme.borderLight */
  --primary: #1E5ABD;     /* AppTheme.primary */
  --accent: #0091EB;      /* AppTheme.accent */
  --textSec: #64748B;     /* AppTheme.textSecondary */
  --glass: rgba(255, 255, 255, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { margin: 0; overflow: hidden; background: var(--bg); }

/* ── Контейнер скелетона ───────────────────────────────────── */
#splash {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: opacity 0.4s ease;
}
#splash.hiding { opacity: 0; pointer-events: none; }

/* ── Шиммер-анимация ──────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0;  }
}
.sk {
  background: linear-gradient(90deg, var(--borderLight) 25%, #E8EDF2 50%, var(--borderLight) 75%);
  background-size: 1200px 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* ── Общие компоненты (Header, Progress) ──────────────────── */
.sk-header {
  height: 80px; /* Desktop default */
  background: var(--surface);
  border-bottom: 1px solid var(--borderLight);
  display: flex; align-items: center;
  padding: 0 32px;
  gap: 24px;
  flex-shrink: 0;
}
.sk-logo { width: 120px; height: 40px; border-radius: 8px; }
.sk-search {
  width: 380px; height: 36px; border-radius: 12px;
  border: 1.5px solid rgba(30,90,189,0.3);
  display: flex; overflow: hidden;
}
.sk-search-icon { width: 46px; height: 100%; flex-shrink: 0; background: var(--primary); }
.sk-search-field { flex: 1; }
.sk-header-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sk-nav { width: 80px; height: 32px; border-radius: 12px; }
.sk-account { width: 80px; height: 36px; border-radius: 12px; border: 1px solid var(--border); }
.sk-lang { width: 54px; height: 28px; border-radius: 12px; border: 1px solid rgba(226,232,240,0.5); }

/* ── Центрированный лоадер (Premium) ───────────────────────── */
.sk-loader-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  z-index: 1000;
  width: 280px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.sk-loader-icon {
  width: 80px; height: 80px;
  background: var(--surface);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 16px rgba(30, 90, 189, 0.15);
  position: relative;
  overflow: hidden;
}

.sk-loader-icon::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent, rgba(30, 90, 189, 0.1), transparent);
  animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.sk-loader-text {
  font-size: 18px; font-weight: 600; color: var(--primary);
  margin-bottom: 8px; text-align: center;
  letter-spacing: -0.02em;
}

.sk-loader-subtext {
  font-size: 13px; color: var(--textSec);
  margin-bottom: 24px; text-align: center; opacity: 0.8;
}

.sk-progress-container {
  width: 100%; height: 6px;
  background: rgba(30, 90, 189, 0.1);
  border-radius: 10px; overflow: hidden;
}

@keyframes progressMove {
  0% { width: 5%; }
  30% { width: 40%; }
  60% { width: 75%; }
  100% { width: 95%; }
}

.sk-progress-fill {
  height: 100%; width: 5%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(30, 90, 189, 0.4);
  animation: progressMove 7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Старый прогресс-бар удаляем или скрываем */
.sk-progress { display: none; }

/* ── Стили для Home ───────────────────────────────────────── */
.sk-slogan-area { height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 20px; gap: 12px; flex-shrink: 0; }
.sk-slogan-line1 { width: 480px; max-width: 70%; height: 36px; border-radius: 8px; }
.sk-slogan-line2 { width: 280px; max-width: 40%; height: 14px; border-radius: 4px; }
.sk-topics { display: flex; gap: 8px; padding: 8px 31px; flex-shrink: 0; align-items: center; }
.sk-topics-label { width: 100px; height: 22px; border-radius: 6px; flex-shrink: 0; }
.sk-pill { height: 36px; border-radius: 100px; flex-shrink: 0; }
.sk-body { flex: 1; display: flex; padding: 0 20px; gap: 24px; overflow: hidden; }
.sk-sidebar { width: 220px; flex-shrink: 0; padding: 24px 16px; display: flex; flex-direction: column; gap: 2px; }
.sk-sidebar-item { height: 44px; border-radius: 8px; }
.sk-grid { flex: 1; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-content: start; }
.sk-card { height: 176px; background: var(--surface); border: 1px solid var(--borderLight); border-radius: 12px; padding: 12px 12px 10px 12px; display: flex; flex-direction: column; }
.sk-card-row { flex: 1; display: flex; gap: 12px; }
.sk-card-img { width: 110px; height: 110px; border-radius: 8px; flex-shrink: 0; }
.sk-card-text { flex: 1; display: flex; flex-direction: column; justify-content: space-between; height: 110px; }
.sk-card-title { height: 16px; width: 90%; border-radius: 4px; }
.sk-card-title2 { height: 14px; width: 65%; border-radius: 4px; margin-top: 6px; }
.sk-card-bar { height: 24px; width: 100%; border-radius: 8px; }
.sk-card-meta { height: 24px; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.sk-card-badge { height: 18px; width: 70px; border-radius: 4px; }
.sk-card-heart { height: 18px; width: 24px; border-radius: 4px; }

/* ── Стили для Auth ───────────────────────────────────────── */
.sk-auth-bg { position: fixed; inset: 0; background: linear-gradient(to bottom, var(--bg), var(--surface)); z-index: -1; }
.sk-auth-circle { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.4; }
.sk-auth-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.sk-auth-logo { width: 160px; height: 160px; border-radius: 20px; margin-bottom: 40px; }
.sk-auth-card { width: 100%; max-width: 440px; background: rgba(255,255,255,0.8); backdrop-filter: blur(16px); border-radius: 16px; border: 1px solid rgba(30,90,189,0.12); padding: 32px; display: flex; flex-direction: column; gap: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.sk-auth-title { height: 28px; width: 50%; align-self: center; border-radius: 6px; }
.sk-auth-input { height: 50px; width: 100%; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.sk-auth-btn { height: 48px; width: 100%; border-radius: 12px; background: var(--primary); }
.sk-auth-oauth { height: 48px; width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.sk-auth-footer { height: 20px; width: 60%; align-self: center; border-radius: 4px; }

/* ── Стили для Account ────────────────────────────────────── */
.sk-acc-content { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 140px; overflow-y: auto; }
.sk-acc-container { width: 100%; max-width: 1400px; padding: 0 40px 40px 40px; display: flex; gap: 24px; }
.sk-acc-sidebar { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 21px; }
.sk-acc-tabs { flex: 1; background: var(--glass); border: 1px solid var(--border); border-radius: 16px; min-height: 600px; display: flex; flex-direction: column; }
.sk-acc-tab-bar { height: 56px; display: flex; border-bottom: 1px solid rgba(0,0,0,0.06); }
.sk-acc-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sk-acc-tab-line { height: 14px; width: 60px; border-radius: 4px; }

.sk-profile-card { background: var(--glass); border: 1px solid var(--border); border-radius: 16px; padding: 26px; display: flex; align-items: center; gap: 18px; position: relative; }
.sk-avatar { width: 68px; height: 68px; border-radius: 12px; background: rgba(30,90,189,0.1); border: 1.5px solid var(--primary); }
.sk-profile-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-name { height: 22px; width: 80%; border-radius: 4px; }
.sk-email { height: 14px; width: 60%; border-radius: 4px; }

.sk-balance-card { background: linear-gradient(135deg, var(--primary), #15459b); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 20px rgba(30,90,189,0.3); }
.sk-balance-label { height: 12px; width: 40%; background: rgba(255,255,255,0.3); border-radius: 3px; }
.sk-balance-val { height: 48px; width: 70%; background: rgba(255,255,255,0.2); border-radius: 6px; }
.sk-balance-btns { display: flex; gap: 12px; margin-top: 12px; }
.sk-balance-btn { flex: 1; height: 48px; border-radius: 12px; background: rgba(255,255,255,0.15); }

.sk-list-item { height: 70px; width: 100%; border-bottom: 1px solid rgba(0,0,0,0.03); display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.sk-list-icon { width: 40px; height: 40px; border-radius: 10px; }
.sk-list-text { flex: 1; display: flex; flex-direction: column; gap: 6px; }

/* ── Стили для News ───────────────────────────────────────── */
.sk-news-content { flex: 1; display: flex; flex-direction: column; padding-top: 70px; overflow-y: auto; }
.sk-news-header { padding: 0 80px; margin-bottom: 48px; }
.sk-news-grid { padding: 0 80px 100px 80px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.sk-news-card { height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.sk-news-img { flex: 5; background: rgba(30,90,189,0.05); }
.sk-news-text { flex: 4; padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* ── Стили для About ──────────────────────────────────────── */
.sk-about-hero { padding: 64px 80px; background: var(--primary); display: flex; flex-direction: column; gap: 16px; margin-top: 70px; }
.sk-about-content { padding: 64px 80px; display: flex; gap: 64px; }
.sk-about-img { width: 100%; height: 280px; background: #F3F4F6; border-radius: 12px; border: 1px solid var(--border); }

/* ── Стили для Help ───────────────────────────────────────── */
.sk-help-content { max-width: 800px; margin: 70px auto 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 32px; }
.sk-help-faq { height: 60px; border: 1px solid var(--border); border-radius: 12px; }

/* ── Стили для Event Detail ───────────────────────────────── */
.sk-event-content { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 70px; overflow-y: auto; }
.sk-event-container { width: 100%; max-width: 1400px; padding: 24px; display: flex; flex-direction: column; gap: 32px; }
.sk-event-info { display: flex; gap: 16px; align-items: flex-start; }
.sk-event-img { width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; }
.sk-event-title-stack { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.sk-event-title { width: 70%; height: 32px; border-radius: 8px; }
.sk-event-meta-row { display: flex; gap: 12px; align-items: center; }
.sk-event-badge { width: 140px; height: 20px; border-radius: 4px; }
.sk-event-main { display: flex; gap: 32px; }
.sk-event-left { flex: 2; display: flex; flex-direction: column; gap: 24px; }
.sk-event-chart { height: 400px; width: 100%; border-radius: 4px; border: 1px solid var(--borderLight); }
.sk-event-rules { height: 200px; width: 100%; border-radius: 12px; }
.sk-event-right { width: 380px; flex-shrink: 0; }
.sk-event-panel { height: 500px; width: 100%; border-radius: 12px; background: var(--surface); border: 1px solid var(--borderLight); }

/* ── Адаптивность (Synchronized with Responsive.dart) ─────── */
/* Mobile < 640px */
@media (max-width: 639px) {
  .sk-header { height: 64px; padding: 0 16px; gap: 12px; }
  .sk-logo { height: 32px; width: 90px; }
  .sk-search, .sk-nav, .sk-account { display: none; }
  .sk-slogan-area { padding: 12px 20px; height: auto; }
  .sk-topics { padding: 8px 21px; }
  .sk-topics-label, .sk-sidebar { display: none; }
  .sk-body { padding: 0 12px; gap: 0; }
  .sk-grid { grid-template-columns: 1fr; gap: 12px; }
  .sk-card { height: 162px; }
  
  .sk-event-container { padding: 16px; gap: 20px; }
  .sk-event-img { width: 48px; height: 48px; }
  .sk-event-title { width: 100%; height: 24px; }
  .sk-event-main { flex-direction: column; gap: 20px; }
  .sk-event-right { width: 100%; }

  .sk-news-header { padding: 0 20px; }
  .sk-news-grid { grid-template-columns: 1fr; padding: 0 12px 60px 12px; }
  
  .sk-acc-container { padding: 16px; flex-direction: column; }
  .sk-acc-sidebar { width: 100%; }
}

/* Tablet 768px+ (640-1023) */
@media (min-width: 640px) and (max-width: 1023px) {
  .sk-header { height: 64px; padding: 0 24px; }
  .sk-sidebar { display: none; }
  .sk-grid { grid-template-columns: repeat(2, 1fr); padding: 0 20px; }
  .sk-card { height: 166px; }
  .sk-topics { padding: 8px 26px; }

  .sk-event-right { width: 100%; }
  .sk-event-main { flex-direction: column; }

  .sk-news-header { padding: 0 40px; }
  .sk-news-grid { grid-template-columns: repeat(2, 1fr); padding: 0 40px; }
}

/* Desktop >= 1024px */
@media (min-width: 1024px) {
  .sk-header { height: 80px; padding: 0 32px; }
  .sk-topics { padding: 8px 31px; }
  .sk-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

