:root {
  /* Rugser marka paleti */
  --blue: #43766C;        /* ana renk: yeşil */
  --blue-dark: #356057;
  --gold: #B19470;        /* vurgu: kum */
  --gold-dark: #9a7f5e;
  --cream: #E4D9C8;       /* açık kum tonu (kenarlıklar) */
  --white: #FFFFFF;       /* saf beyaz zemin */
  --ink: #76453B;         /* koyu kahve (metin/vurgu) */
  --radius: 14px;
  --shadow: 0 4px 18px rgba(67, 118, 108, 0.18);
}

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

html, body {
  background: var(--white);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100%;
}

/* ---------- Üst bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--blue);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-logo {
  height: 26px;
  display: block;
  /* logoyu saf beyaza çevir */
  filter: brightness(0) invert(1);
}

.brand-sub { font-size: 12px; color: var(--cream); }

.icon-btn {
  background: var(--gold);
  color: var(--ink);
  border: none;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.icon-btn:active { background: var(--gold-dark); }

/* ---------- Adım 1 ---------- */
.step { padding: 20px 18px 40px; max-width: 860px; margin: 0 auto; }

.hero { text-align: center; margin: 28px 0 24px; }
.hero h1 { font-size: 26px; color: var(--blue); margin-bottom: 8px; }
.hero p { color: var(--ink); opacity: 0.75; font-size: 15px; }

.upload-card {
  background: var(--white);
  border: 2px dashed var(--cream);
  border-radius: var(--radius);
  padding: 34px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}

.big-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.big-btn.primary { background: var(--blue); color: var(--white); }
.big-btn.primary:active { background: var(--blue-dark); }

.hint { margin-top: 16px; font-size: 13px; opacity: 0.65; line-height: 1.5; }

/* ---------- Görüntüleyici ---------- */
#stepViewer { padding-top: 12px; }

.canvas-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--cream);
  touch-action: none;
}

#viewCanvas { display: block; width: 100%; height: auto; }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(83, 113, 136, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--white);
  font-weight: 600;
}

.spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kontroller ---------- */
.controls { margin-top: 14px; }

.control-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--cream);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.slider-group { flex: 1; min-width: 130px; }
.slider-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chip-btn {
  background: var(--white);
  border: 1.5px solid var(--blue);
  color: var(--blue);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.chip-btn:active { background: var(--cream); }
a.chip-btn { text-decoration: none; display: inline-flex; align-items: center; }
.chip-btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.chip-btn.gold:active { background: var(--gold-dark); }
.chip-btn.active { background: var(--blue); color: var(--white); }

/* ---------- Katalog ---------- */
.catalog { margin-top: 20px; }
.catalog h2 {
  font-size: 15px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.rug-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.rug-thumb {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid var(--cream);
  cursor: pointer;
  background: var(--white);
  padding: 0;
}
.rug-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rug-thumb.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }

/* ---------- Modal ---------- */
[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 58, 69, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  max-width: 340px;
  width: 100%;
}
.modal-card h2 { color: var(--blue); margin-bottom: 14px; }
.modal-card img { width: 220px; height: 220px; margin-bottom: 10px; }
.qr-url { font-size: 13px; color: var(--blue); word-break: break-all; margin-bottom: 16px; }

@media (max-width: 600px) {
  .brand-sub { display: none; }
  .hero h1 { font-size: 22px; }
  .step { padding: 14px 12px 30px; }
}
