/* ==========================================================================
   Salkkamalka (Buy or Not) — brand theme
   Palette mirrors the Flutter app themes:
   - light_theme.dart : primary #10b981, bg #f8fafc, surface #ffffff
   - dark_theme.dart  : primary #10b981, bg #111827, surface #1f2937
   - splash gradient  : light #34d399→#10b981→#059669, dark #047857→#065f46→#064e3b
   ========================================================================== */

/* ---------- Theme variables ---------- */
:root {
  color-scheme: light;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f8fafc;

  --text-strong: #1f2937;
  --text: #4b5563;
  --text-muted: #6b7280;

  --border: #e5e7eb;

  --primary: #10b981;
  --primary-strong: #059669;
  --link: #047857;
  --on-primary: #ffffff;

  --hero-grad: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
  --icon-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --nav-bg: rgba(255, 255, 255, 0.92);
  --nav-solid: rgba(255, 255, 255, 0.98);
  --nav-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);

  --shadow-sm: 0 4px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.1);
  --shadow-phone: 0 20px 40px rgba(15, 23, 42, 0.3);

  --footer-bg: #1f2937;
  --footer-border: #374151;

  --warn-bg: #fef3c7;
  --warn-border: #f59e0b;
  --warn-strong: #92400e;
  --badge-bg: #fbbf24;
  --badge-text: #78350f;

  --img-ring: rgba(15, 23, 42, 0.06);
}

/* Dark palette — applied via manual toggle (data-theme) */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111827;
  --bg-alt: #0d1420;
  --surface: #1f2937;
  --surface-alt: #1f2937;

  --text-strong: #f9fafb;
  --text: #d1d5db;
  --text-muted: #9ca3af;

  --border: #374151;

  --primary: #10b981;
  --primary-strong: #059669;
  --link: #34d399;
  --on-primary: #ffffff;

  --hero-grad: linear-gradient(135deg, #047857 0%, #065f46 50%, #064e3b 100%);
  --icon-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --nav-bg: rgba(17, 24, 39, 0.92);
  --nav-solid: rgba(17, 24, 39, 0.98);
  --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-phone: 0 20px 40px rgba(0, 0, 0, 0.6);

  --footer-bg: #1f2937;
  --footer-border: #374151;

  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: #f59e0b;
  --warn-strong: #fbbf24;
  --badge-bg: #fbbf24;
  --badge-text: #78350f;

  --img-ring: rgba(255, 255, 255, 0.14);
}

/* System dark fallback (no stored choice / JS disabled) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #111827;
    --bg-alt: #0d1420;
    --surface: #1f2937;
    --surface-alt: #1f2937;

    --text-strong: #f9fafb;
    --text: #d1d5db;
    --text-muted: #9ca3af;

    --border: #374151;

    --primary: #10b981;
    --primary-strong: #059669;
    --link: #34d399;
    --on-primary: #ffffff;

    --hero-grad: linear-gradient(135deg, #047857 0%, #065f46 50%, #064e3b 100%);
    --icon-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);

    --nav-bg: rgba(17, 24, 39, 0.92);
    --nav-solid: rgba(17, 24, 39, 0.98);
    --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
    --shadow-phone: 0 20px 40px rgba(0, 0, 0, 0.6);

    --footer-bg: #1f2937;
    --footer-border: #374151;

    --warn-bg: rgba(245, 158, 11, 0.12);
    --warn-border: #f59e0b;
    --warn-strong: #fbbf24;
    --badge-bg: #fbbf24;
    --badge-text: #78350f;

    --img-ring: rgba(255, 255, 255, 0.14);
  }
}

/* ---------- Reset and base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: rgba(16, 185, 129, 0.25);
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: var(--nav-solid);
  box-shadow: var(--nav-shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--link);
}

.nav-logo i {
  margin-right: 0.5rem;
  font-size: 1.8rem;
}

.nav-logo img {
  box-shadow: 0 0 0 1px var(--img-ring);
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--link);
}

/* Language selector */
#languageSelect {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#languageSelect:hover {
  border-color: var(--primary);
}

/* Theme toggle + hamburger group */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle:hover {
  color: var(--link);
  border-color: var(--link);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-strong);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu.active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--nav-solid);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 0;
  box-shadow: var(--nav-shadow);
  gap: 0;
}

.nav-menu.active li {
  padding: 0.75rem 20px;
  border-bottom: 1px solid var(--border);
}

.nav-menu.active li:last-child {
  border-bottom: none;
}

/* ---------- Hero section ---------- */
.hero {
  padding: 120px 0 80px;
  background: var(--hero-grad);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.92;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn i {
  margin-right: 0.5rem;
}

.btn-primary {
  background: #ffffff;
  color: #047857;
}

.btn-primary:hover {
  background: #ecfdf5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.btn-secondary:hover {
  background: #ffffff;
  color: #047857;
}

/* ---------- Phone mockup ---------- */
.phone-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-screen {
  width: 280px;
  height: 560px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 20px;
  box-shadow: var(--shadow-phone);
  position: relative;
}

.app-preview {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
  height: 100%;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  color: #ffffff;
}

.preview-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.preview-icon img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.preview-text {
  text-align: center;
  margin-bottom: 15px;
}

.preview-text h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.preview-text p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.ticket-display {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---------- Features section ---------- */
.features {
  padding: 80px 0;
  background: var(--bg-alt);
  transition: background-color 0.3s ease;
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-strong);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: var(--icon-grad);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.feature-icon i {
  font-size: 2rem;
  color: #ffffff;
}

.feature-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-strong);
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Download section ---------- */
.download {
  padding: 80px 0;
  background: var(--bg);
  transition: background-color 0.3s ease;
}

.download h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-strong);
}

.download > .container > p {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.download-options {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.download-card {
  display: flex;
  align-items: center;
  padding: 2rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  min-width: 250px;
}

.download-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.download-card i {
  font-size: 3rem;
  margin-right: 1rem;
  color: var(--primary);
}

.download-text h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

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

/* ---------- About section ---------- */
.about {
  padding: 80px 0;
  background: var(--bg-alt);
  transition: background-color 0.3s ease;
}

.about h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-strong);
}

.about-content {
  display: flex;
  justify-content: center;
  align-items: start;
}

.about-text {
  max-width: 800px;
  width: 100%;
}

.about-text h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-strong);
}

.about-text p {
  margin-bottom: 2rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.about-text ul {
  list-style: none;
  margin-bottom: 2rem;
}

.about-text li {
  padding: 0.75rem 0;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: start;
}

.about-text li::before {
  content: "✓";
  color: var(--primary);
  font-weight: bold;
  margin-right: 10px;
  font-size: 1.2rem;
}

.about-text li:last-child {
  border-bottom: none;
}

/* ---------- Legal / document pages (privacy, terms) ---------- */
.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 110px 20px 60px 20px;
  line-height: 1.8;
}

.privacy-content h1 {
  color: var(--text-strong);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.privacy-content h2 {
  color: var(--text-strong);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
}

.privacy-content h3 {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem 0;
}

.privacy-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.privacy-content ul,
.privacy-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.privacy-content li {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.privacy-content strong {
  color: var(--text);
}

.privacy-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.privacy-content th,
.privacy-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  color: var(--text-muted);
  text-align: left;
}

.privacy-content th {
  background: var(--surface-alt);
  color: var(--text-strong);
}

.back-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 12px;
  margin-bottom: 2rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.back-link:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.back-link i {
  margin-right: 0.5rem;
}

.contact-info {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
  border-left: 4px solid var(--primary);
}

.contact-info h3 {
  color: var(--text-strong);
  margin-bottom: 1rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.contact-info i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.highlight-box {
  background: var(--warn-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid var(--warn-border);
  margin: 1.5rem 0;
}

.highlight-box strong {
  color: var(--warn-strong);
}

/* ---------- FAQ pages ---------- */
.faq-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 110px 20px 60px 20px;
}

.faq-content h1 {
  color: var(--text-strong);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.faq-item h3 {
  color: var(--text-strong);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.faq-item p {
  color: var(--text-muted);
  line-height: 1.8;
}

.faq-question {
  color: var(--text-strong);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: start;
}

.faq-question i {
  color: var(--primary);
  margin-right: 0.75rem;
  margin-top: 0.25rem;
}

.faq-answer {
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 2rem;
}

.faq-answer ul {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

.faq-answer li {
  margin-bottom: 0.5rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--footer-bg);
  color: #ffffff;
  padding: 60px 0 20px;
  transition: background-color 0.3s ease;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: #ffffff;
}

.footer-section p {
  color: #d1d5db;
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #d1d5db;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #34d399;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--footer-border);
  color: #9ca3af;
}

/* ---------- Responsive design ---------- */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-solid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0;
    box-shadow: var(--nav-shadow);
  }

  .nav-menu li {
    padding: 0.75rem 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .hamburger {
    display: flex;
  }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .about-content {
    flex-direction: column;
  }

  .download-options {
    flex-direction: column;
    align-items: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .phone-screen {
    width: 240px;
    height: 480px;
  }
}
