/* ==========================================================================
   Lotto 6/45 Mobile-First Design System
   Site: lotto.kwgo.co.kr
   ========================================================================== */

:root {
  --lotto-primary: #ff6d00;
  --lotto-primary-dark: #e65100;
  --lotto-secondary: #2b8a3e;
  --lotto-bg-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --lotto-card-bg: #ffffff;
  --lotto-card-border: #e2e8f0;
  --lotto-text-dark: #0f172a;
  --lotto-text-muted: #64748b;
  
  /* Lotto Ball Colors */
  --ball-yellow: linear-gradient(135deg, #ffd43b 0%, #f59f00 100%);
  --ball-blue: linear-gradient(135deg, #4dabf7 0%, #1c7ed6 100%);
  --ball-red: linear-gradient(135deg, #ff8787 0%, #e03131 100%);
  --ball-gray: linear-gradient(135deg, #ced4da 0%, #495057 100%);
  --ball-green: linear-gradient(135deg, #51cf66 0%, #2f9e44 100%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Base Mobile Layout */
body {
  background-color: #f8fafc;
  color: var(--lotto-text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  padding-bottom: 70px; /* Space for bottom mobile action bar */
  -webkit-tap-highlight-color: transparent;
}

.lotto-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 16px;
  box-sizing: border-box;
}

/* Header & Top-Fold Hero Section */
.lotto-hero {
  background: var(--lotto-bg-gradient);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.lotto-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 109, 0, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

/* Draw Selector Nav */
.lotto-draw-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.lotto-draw-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lotto-draw-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.96);
}

.lotto-draw-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0;
}

.lotto-draw-date {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
  margin-bottom: 16px;
}

/* Winning Balls Container */
.lotto-balls-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 16px 0 20px 0;
}

.lotto-ball {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
  flex-shrink: 0;
}

.lotto-ball::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 10px;
  width: 14px;
  height: 8px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: rotate(-25deg);
}

.ball-yellow { background: var(--ball-yellow); color: #212529; text-shadow: none; }
.ball-blue   { background: var(--ball-blue); }
.ball-red    { background: var(--ball-red); }
.ball-gray   { background: var(--ball-gray); }
.ball-green  { background: var(--ball-green); }

.lotto-plus-sign {
  font-size: 1.2rem;
  font-weight: 800;
  color: #cbd5e1;
  margin: 0 2px;
}

/* Prize Summary Banner */
.lotto-prize-hero {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.lotto-prize-item {
  text-align: center;
}

.lotto-prize-label {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 2px;
}

.lotto-prize-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde047;
}

/* AI Gemini Summary Card */
.ai-summary-card {
  background: var(--lotto-card-bg);
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--lotto-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.ai-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff7ed;
  color: var(--lotto-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid #ffedd5;
}

.ai-summary-text {
  font-size: 0.93rem;
  line-height: 1.55;
  color: #334155;
  margin: 0;
}

/* Section Titles */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px 0;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--lotto-text-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-more-link {
  font-size: 0.82rem;
  color: var(--lotto-primary);
  text-decoration: none;
  font-weight: 700;
}

/* 1st Prize Winning Store List Cards */
.store-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-card {
  background: var(--lotto-card-bg);
  border: 1px solid var(--lotto-card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-card:active {
  transform: translateY(1px);
}

.store-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.store-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.store-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.badge-auto { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-manual { background: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }
.badge-semi { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.store-addr {
  font-size: 0.85rem;
  color: #64748b;
  margin: 4px 0 8px 0;
  line-height: 1.4;
}

.store-landmark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Quick Nav Cards */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat-card {
  background: var(--lotto-card-bg);
  border: 1px solid var(--lotto-card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}

.stat-card-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.stat-card-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 2px 0;
}

.stat-card-desc {
  font-size: 0.75rem;
  color: var(--lotto-text-muted);
  margin: 0;
}

/* Mobile Fixed Bottom Bar (Thumb-Zone) */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  width: 25%;
  height: 100%;
}

.mobile-bottom-item.active {
  color: var(--lotto-primary);
  font-weight: 800;
}

.mobile-bottom-icon {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

/* Responsive adjustments */
@media (min-width: 601px) {
  .lotto-container {
    padding-top: 24px;
  }
  .lotto-ball {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
  .mobile-bottom-bar {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* ==========================================================================
   Top Horizontal Quick Navigation Bar
   ========================================================================== */

.lotto-top-quick-bar-wrapper {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 60px; /* below header */
  z-index: 990;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
  margin: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.lotto-top-quick-bar-wrapper .container {
  padding: 0;
}

.lotto-top-quick-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  white-space: nowrap;
}

.lotto-top-quick-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.top-quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 13px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.top-quick-chip:hover {
  background: #e8f0fe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.top-quick-chip.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Dark mode support */
[data-theme="dark"] .lotto-top-quick-bar-wrapper {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: #334155;
}

[data-theme="dark"] .top-quick-chip {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

[data-theme="dark"] .top-quick-chip:hover {
  background: #1e40af;
  color: #ffffff;
  border-color: #3b82f6;
}

[data-theme="dark"] .top-quick-chip.active {
  background: #2563eb;
  color: #ffffff;
}

/* ==========================================================================
   Mobile Slide-out Drawer Menu
   ========================================================================== */

.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.mobile-drawer-overlay.open {
  display: block;
}

.mobile-drawer-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: #ffffff;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
}

.mobile-drawer-menu.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #0f172a;
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.mobile-drawer-title {
  font-size: 1rem;
  font-weight: 900;
  color: #f1f5f9;
}

.mobile-drawer-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 8px;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.mobile-drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.mobile-drawer-body {
  padding: 16px;
}

.drawer-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.drawer-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.drawer-grid-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.drawer-grid-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.drawer-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-link-list li a {
  display: block;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.drawer-link-list li a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Dark mode drawer */
[data-theme="dark"] .mobile-drawer-menu {
  background: #0f172a;
}

[data-theme="dark"] .mobile-drawer-body {
  color: #f1f5f9;
}

[data-theme="dark"] .drawer-grid-link {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .drawer-grid-link:hover {
  background: #1e40af;
  border-color: #3b82f6;
  color: #ffffff;
}

[data-theme="dark"] .drawer-link-list li a {
  color: #cbd5e1;
}

[data-theme="dark"] .drawer-link-list li a:hover {
  background: #1e293b;
  color: #93c5fd;
}
