/* =========================================================
   Kiryat Moshe Free — Modern, Colorful & Clean Stylesheet
   ========================================================= */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.13);

  /* Category Palette */
  --sofas-bg: #ffe4e6;
  --sofas-text: #be123c;
  --sofas-solid: #f43f5e;

  --tables-bg: #fef3c7;
  --tables-text: #b45309;
  --tables-solid: #f59e0b;

  --beds-bg: #ede9fe;
  --beds-text: #6d28d9;
  --beds-solid: #8b5cf6;

  --cabinets-bg: #ccfbf1;
  --cabinets-text: #0f766e;
  --cabinets-solid: #14b8a6;

  --kids-bg: #fce7f3;
  --kids-text: #be185d;
  --kids-solid: #ec4899;

  --misc-bg: #e0f2fe;
  --misc-text: #0369a1;
  --misc-solid: #0ea5e9;

  /* WhatsApp Green */
  --wa-green: #25d366;
  --wa-green-hover: #1ebe5d;
}

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

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   Vibrant Hero Banner
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 48%, #10b981 100%);
  color: #ffffff;
  padding: 56px 0 72px;
  text-align: center;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.35;
  pointer-events: none;
}

.hero-blob-1 {
  width: 320px;
  height: 320px;
  background: #facc15;
  top: -110px;
  left: -80px;
}

.hero-blob-2 {
  width: 360px;
  height: 360px;
  background: #f472b6;
  bottom: -140px;
  right: -80px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-subtitle {
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  color: rgba(255, 255, 255, 0.94);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  justify-content: center;
}

.btn-giveaway {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff7a18 0%, #ff5252 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 15px 28px;
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 26px rgba(255, 82, 82, 0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-giveaway:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(255, 82, 82, 0.48);
  filter: brightness(1.04);
}

.btn-giveaway:active {
  transform: translateY(0);
}

.btn-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  font-size: 1.2rem;
  line-height: 1;
}

/* =========================================================
   Search & Category Filter Bar
   ========================================================= */

.main-content {
  margin-top: -32px;
  padding-bottom: 64px;
  position: relative;
  z-index: 2;
}

.controls-bar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 30px;
}

.search-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text);
  background: #f8fafc;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.search-input:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Color-coded pills */
.pill-all {
  background: #f1f5f9;
  color: #334155;
}
.pill-all.active {
  background: #1e293b;
  color: #ffffff;
}

.pill-sofas {
  background: var(--sofas-bg);
  color: var(--sofas-text);
}
.pill-sofas.active {
  background: var(--sofas-solid);
  color: #ffffff;
}

.pill-tables {
  background: var(--tables-bg);
  color: var(--tables-text);
}
.pill-tables.active {
  background: var(--tables-solid);
  color: #ffffff;
}

.pill-beds {
  background: var(--beds-bg);
  color: var(--beds-text);
}
.pill-beds.active {
  background: var(--beds-solid);
  color: #ffffff;
}

.pill-cabinets {
  background: var(--cabinets-bg);
  color: var(--cabinets-text);
}
.pill-cabinets.active {
  background: var(--cabinets-solid);
  color: #ffffff;
}

.pill-kids {
  background: var(--kids-bg);
  color: var(--kids-text);
}
.pill-kids.active {
  background: var(--kids-solid);
  color: #ffffff;
}

.pill-misc {
  background: var(--misc-bg);
  color: var(--misc-text);
}
.pill-misc.active {
  background: var(--misc-solid);
  color: #ffffff;
}

/* =========================================================
   Results Header & Responsive Furniture Grid
   ========================================================= */

.results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.results-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.results-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #e2e8f0;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* 1 column on phones */
.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* 2 columns on tablets */
@media (min-width: 640px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3 columns on laptops & desktops */
@media (min-width: 1024px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   Furniture Cards
   ========================================================= */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-media img {
  transform: scale(1.04);
}

/* Color-coded Category Badges */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.badge-sofas {
  background: var(--sofas-solid);
  color: #ffffff;
}

.badge-tables {
  background: var(--tables-solid);
  color: #ffffff;
}

.badge-beds {
  background: var(--beds-solid);
  color: #ffffff;
}

.badge-cabinets {
  background: var(--cabinets-solid);
  color: #ffffff;
}

.badge-kids {
  background: var(--kids-solid);
  color: #ffffff;
}

.badge-misc {
  background: var(--misc-solid);
  color: #ffffff;
}

/* Condition Tags */
.condition-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.condition-like-new {
  color: #047857;
}

.condition-good {
  color: #0369a1;
}

.condition-gently {
  color: #b45309;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.card-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0284c7;
}

.card-location svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.card-desc {
  margin: 0 0 18px;
  font-size: 0.93rem;
  color: var(--text-muted);
  flex: 1;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Green WhatsApp Pickup Button */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--wa-green);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.28);
  transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.btn-whatsapp:hover {
  background: var(--wa-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.36);
}

.btn-whatsapp svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* Subtle Mark as Taken Button */
.btn-taken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn-taken:hover {
  background: #f1f5f9;
  color: var(--text);
  border-color: #cbd5e1;
}

/* =========================================================
   Give Away Modal (Hidden until opened by app.js)
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0284c7;
  margin-bottom: 2px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-close {
  border: none;
  background: #f1f5f9;
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #e2e8f0;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-error {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.req {
  color: #e11d48;
}

.field-hint {
  font-weight: 500;
  color: var(--text-muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #ffffff;
}

.field input.input-invalid {
  border-color: #f43f5e;
  background: #fff1f2;
}

.pin-input {
  max-width: 150px;
  letter-spacing: 0.25em;
  font-weight: 800;
  text-align: center;
}

/* Photo Upload & Preview */
.photo-upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.photo-upload-box:hover {
  border-color: #0ea5e9;
  background: #f0f9ff;
}

.photo-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-upload-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.photo-upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.photo-upload-text strong {
  font-size: 0.92rem;
  color: var(--text);
}

.photo-upload-text small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.photo-preview-wrap[hidden] {
  display: none;
}

.photo-preview-img {
  width: 78px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.photo-preview-meta {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.photo-size-info {
  font-size: 0.84rem;
  font-weight: 700;
  color: #15803d;
}

.btn-remove-photo {
  border: none;
  background: #ffffff;
  color: #be123c;
  border: 1px solid #fecdd3;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-remove-photo:hover {
  background: #fff1f2;
}

.btn-submit {
  margin-top: 6px;
  border: none;
  cursor: pointer;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff7a18 0%, #ff5252 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(255, 82, 82, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-submit:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

/* =========================================================
   Empty State & Cheerful Confirmation Toast
   ========================================================= */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.15rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 14px 32px rgba(5, 150, 105, 0.36);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

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

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}
