﻿:root {
  color-scheme: light;
  --ink: #0e1b2e;
  --muted: #5f6b7a;
  --accent: #f06449;
  --accent-soft: #fff0ea;
  --chip: #edf3fb;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(14, 27, 46, 0.18);
  --border: rgba(14, 27, 46, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #ffe9df 0%, transparent 45%),
    radial-gradient(circle at 80% 0%, #e4f0ff 0%, transparent 55%),
    linear-gradient(130deg, #f9fafc 0%, #f1f4f8 60%, #f7efe8 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px clamp(20px, 6vw, 80px) 48px;
  position: relative;
  overflow: hidden;
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0.5;
  filter: blur(0px);
  z-index: 0;
}

.page::before {
  width: 420px;
  height: 420px;
  background: rgba(240, 100, 73, 0.15);
  top: -160px;
  right: -120px;
}

.page::after {
  width: 360px;
  height: 360px;
  background: rgba(47, 110, 214, 0.12);
  bottom: -160px;
  left: -120px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: clamp(32px, 4.4vw, 44px);
  width: auto;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.lang-select select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
  background: var(--card);
  color: var(--ink);
}

.search-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 700px;
}

.tagline {
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--muted);
  line-height: 1.4;
}

.search-card {
  width: min(820px, 100%);
  background: var(--card);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise 0.8s ease;
}

.mode-toggle {
  display: inline-flex;
  background: var(--chip);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  align-self: center;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 16px rgba(240, 100, 73, 0.2);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.input-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 220px;
}

#patternInput {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 46px 14px 22px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink);
  background: #fdfdfd;
}

#patternInput:focus {
  outline: none;
  border-color: rgba(240, 100, 73, 0.7);
  box-shadow: 0 0 0 3px rgba(240, 100, 73, 0.2);
}

#clearBtn {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  background: rgba(14, 27, 46, 0.08);
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: none;
}

#clearBtn:hover {
  background: rgba(14, 27, 46, 0.16);
}

#searchBtn {
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#searchBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(240, 100, 73, 0.25);
}

.help {
  color: var(--muted);
  font-size: 14px;
  background: var(--accent-soft);
  padding: 10px 16px;
  border-radius: 16px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.controls input {
  width: 90px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.advanced-fields {
  display: none;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.advanced-fields.active {
  display: block;
}

.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  text-align: left;
}

.adv-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.adv-actions button {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adv-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(240, 100, 73, 0.25);
}
.adv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.adv-field input,
.adv-field select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink);
  background: #fdfdfd;
}

.adv-clear button {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fdfdfd;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.adv-clear button:hover {
  background: rgba(14, 27, 46, 0.06);
}

.status {
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
}

.results {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  animation: fadeIn 0.6s ease;
}

.app-promo {
  width: min(900px, 100%);
  margin-top: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(14, 27, 46, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.app-text {
  font-size: 15px;
  color: var(--muted);
  max-width: 460px;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badges img {
  height: 46px;
  width: auto;
  display: block;
}

.pagination {
  margin-top: 10px;
}

#loadMoreBtn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
  display: none;
}

#loadMoreBtn:hover {
  background: rgba(14, 27, 46, 0.12);
}

.result-pill {
  background: var(--chip);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink);
}

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: auto;
  position: relative;
  z-index: 1;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .search-card {
    padding: 20px;
  }

  .controls {
    justify-content: center;
  }

  #searchBtn {
    width: 100%;
  }
}
