/* ============================================
   Poklon Savetnik - Stylesheet
   Dizajn: Topao, veseo, moderan
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Sora:wght@700;800&display=swap');

:root {
  --primary:    #FF6B6B;
  --primary-dk: #e85555;
  --secondary:  #4ECDC4;
  --accent:     #FFE66D;
  --accent2:    #A8E6CF;
  --dark:       #2C3E50;
  --muted:      #7F8C8D;
  --bg:         #FFF9F0;
  --card-bg:    #FFFFFF;
  --border:     #F0E6D3;
  --shadow:     0 4px 24px rgba(44,62,80,.10);
  --shadow-lg:  0 12px 40px rgba(44,62,80,.16);
  --radius:     18px;
  --radius-sm:  10px;
  --font-main:  'Nunito', sans-serif;
  --font-head:  'Sora', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Header ───────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #C0392B 0%, #E84C1E 60%, #c94d0a 100%);
  padding: 48px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.site-header h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.4rem);
  color: #fff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
  position: relative;
}
.site-header h1 span { color: var(--accent); }
.site-header p {
  color: rgba(255,255,255,.95);
  font-size: 1.1rem;
  margin-top: 10px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
  position: relative;
}
.header-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ─── Layout ──────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

main { padding: 40px 0 80px; }

/* ─── Card ─────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  border: 1.5px solid var(--border);
  margin-bottom: 32px;
}

/* ─── Form ─────────────────────────────────── */
.form-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 24px 18px; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-group.full { grid-column: 1 / -1; }

label {
  font-weight: 700;
  font-size: .92rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
label .lbl-icon { font-size: 1.1em; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: .97rem;
  color: var(--dark);
  background: #FAFAFA;
  transition: border .2s, box-shadow .2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,107,.15);
  background: #fff;
}
textarea { resize: vertical; min-height: 90px; }

.hint {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── Budget slider ────────────────────────── */
.budget-display {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--primary);
  text-align: center;
  margin: 4px 0 8px;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--pct,50%), var(--border) var(--pct,50%), var(--border) 100%);
  border: none;
  cursor: pointer;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(255,107,107,.4);
  cursor: pointer;
  transition: transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ─── Submit button ────────────────────────── */
.btn-submit {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #C0392B, #E84C1E);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .5px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 6px 20px rgba(192,57,43,.35);
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(192,57,43,.45);
}
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled {
  opacity: .7; cursor: not-allowed;
}

/* ─── Loader ────────────────────────────────── */
.loader-wrap {
  text-align: center;
  padding: 48px 0;
}
.loader {
  display: inline-block;
  width: 64px; height: 64px;
  border: 6px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

/* ─── Error ─────────────────────────────────── */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error {
  background: #FFF0F0;
  border: 2px solid #FFBDBD;
  color: #C0392B;
}
.alert-error ul { margin: 6px 0 0 20px; }

/* ─── Results header ────────────────────────── */
.results-header {
  text-align: center;
  margin-bottom: 32px;
}
.results-header h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--dark);
}
.results-header p { color: var(--muted); font-size: .97rem; margin-top: 6px; }
.results-header .summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.chip {
  background: var(--accent);
  color: var(--dark);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 800;
}
.chip.chip-blue { background: #D5F0FD; }
.chip.chip-pink { background: #FFD6E0; }
.chip.chip-green { background: var(--accent2); }

/* ─── Gift cards ────────────────────────────── */
.gift-grid {
  display: grid;
  gap: 22px;
}

.gift-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  animation: fadeUp .4s ease both;
}
.gift-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gift-card-top {
  padding: 22px 24px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.gift-rank {
  min-width: 38px; height: 38px;
  background: linear-gradient(135deg, #C0392B, #E84C1E);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(192,57,43,.35);
}

.gift-info { flex: 1; }
.gift-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}
.gift-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.badge {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-toy     { background: #FFE4B5; color: #8B6914; }
.badge-tech    { background: #D6EAF8; color: #1A6798; }
.badge-creative{ background: #E8DAEF; color: #6C3483; }
.badge-edu     { background: #D5F5E3; color: #1E8449; }
.badge-exp     { background: #FDEDEC; color: #A93226; }
.badge-fashion { background: #FDEBD0; color: #784212; }
.badge-other   { background: #EAECEE; color: #566573; }

.gift-price {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 400;
}

.gift-body {
  padding: 0 24px 20px;
  border-top: 1.5px solid var(--border);
  padding-top: 16px;
}

.gift-desc {
  font-size: .93rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 12px;
}

.gift-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media(max-width:520px){ .gift-meta { grid-template-columns: 1fr; } }

.meta-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.meta-item .meta-label {
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.meta-item .meta-val {
  font-size: .9rem;
  font-weight: 700;
  color: var(--dark);
}

/* Score bars */
.scores-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.score-item { flex: 1; min-width: 120px; }
.score-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.score-bar-bg {
  background: var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.score-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #C0392B, #E84C1E);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.score-bar.bar-green {
  background: linear-gradient(90deg, var(--secondary), #27AE60);
}
.score-num {
  font-weight: 800;
  font-size: .8rem;
  color: var(--dark);
  margin-left: 6px;
}

/* Where to buy */
.buy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.buy-label {
  font-size: .8rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.buy-tag {
  background: var(--secondary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}

.safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #D5F5E3;
  color: #1E8449;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
}

/* Search link */
.search-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #C0392B;
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
  margin-top: 12px;
  transition: opacity .15s;
}
.search-link:hover { opacity: .75; text-decoration: underline; }

/* ─── Back button ───────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  color: #C0392B;
  border: 2px solid #C0392B;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-bottom: 28px;
}
.btn-back:hover {
  background: #C0392B;
  color: #fff;
}

/* ─── Footer ─────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 24px;
  font-size: .85rem;
}
.site-footer a { color: var(--accent); text-decoration: none; }

/* ─── Scroll animation delay ─────────────────── */
.gift-card:nth-child(1)  { animation-delay: .05s; }
.gift-card:nth-child(2)  { animation-delay: .10s; }
.gift-card:nth-child(3)  { animation-delay: .15s; }
.gift-card:nth-child(4)  { animation-delay: .20s; }
.gift-card:nth-child(5)  { animation-delay: .25s; }
.gift-card:nth-child(6)  { animation-delay: .30s; }
.gift-card:nth-child(7)  { animation-delay: .35s; }
.gift-card:nth-child(8)  { animation-delay: .40s; }
.gift-card:nth-child(9)  { animation-delay: .45s; }
.gift-card:nth-child(10) { animation-delay: .50s; }

/* ─── Responsive tweaks ─────────────────────── */
@media (max-width: 500px) {
  .site-header { padding: 36px 16px 48px; }
  main { padding: 24px 0 60px; }
}
