/* ==========================================================================
   대한민국 로또6/45 종합 정보·분석 플랫폼 - 글로벌 스타일 & 테마
   Vanilla CSS with CSS Variables & Modern Flex/Grid Layout
   ========================================================================== */

:root {
  /* 색상 팔레트 - Light Theme */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* 테마 포인트 컬러 */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-glow: rgba(37, 99, 235, 0.15);

  --accent: #059669;
  --accent-light: #d1fae5;
  --warning: #d97706;
  --danger: #dc2626;

  /* 로또 볼 공식 컬러 (그라데이션 및 그림자) */
  --ball-1-10: radial-gradient(circle at 35% 35%, #fde047 0%, #ca8a04 100%);
  --ball-1-10-text: #713f12;
  --ball-1-10-shadow: rgba(202, 138, 4, 0.35);

  --ball-11-20: radial-gradient(circle at 35% 35%, #60a5fa 0%, #2563eb 100%);
  --ball-11-20-text: #ffffff;
  --ball-11-20-shadow: rgba(37, 99, 235, 0.35);

  --ball-21-30: radial-gradient(circle at 35% 35%, #f87171 0%, #dc2626 100%);
  --ball-21-30-text: #ffffff;
  --ball-21-30-shadow: rgba(220, 38, 38, 0.35);

  --ball-31-40: radial-gradient(circle at 35% 35%, #94a3b8 0%, #475569 100%);
  --ball-31-40-text: #ffffff;
  --ball-31-40-shadow: rgba(71, 85, 105, 0.35);

  --ball-41-45: radial-gradient(circle at 35% 35%, #4ade80 0%, #16a34a 100%);
  --ball-41-45-text: #ffffff;
  --ball-41-45-shadow: rgba(22, 163, 74, 0.35);

  --ball-bonus: radial-gradient(circle at 35% 35%, #a855f7 0%, #7e22ce 100%);
  --ball-bonus-text: #ffffff;
  --ball-bonus-shadow: rgba(126, 34, 206, 0.35);

  /* 레이아웃 & 섀도우 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Malgun Gothic", "맑은 고딕", Roboto, Helvetica, Arial, sans-serif;
  --container-max: 1200px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-surface: #111827;
  --bg-surface-hover: #1f2937;
  --bg-elevated: #1a2234;
  --bg-subtle: #0f172a;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-color: #1e293b;
  --border-focus: #60a5fa;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e3a8a;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --accent: #10b981;
  --accent-light: #064e3b;

  --ball-1-10: radial-gradient(circle at 35% 35%, #fef08a 0%, #eab308 100%);
  --ball-1-10-text: #422006;
  --ball-1-10-shadow: rgba(234, 179, 8, 0.5);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
}

/* 기본 리셋 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

main {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* 접근성 유틸리티 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   PWA Install UI Styles
   ========================================================================== */
.pwa-install-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  max-width: 380px;
  width: calc(100% - 3rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pwa-install-container.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.pwa-install-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.pwa-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.pwa-card-content {
  flex: 1;
  min-width: 0;
}

.pwa-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.pwa-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 0.2rem;
}

.pwa-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-btn-primary {
  padding: 0.45rem 0.85rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pwa-btn-primary:hover {
  background: var(--primary-hover);
}

.pwa-btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.pwa-btn-close:hover {
  color: var(--text-primary);
}

.pwa-toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.pwa-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

