/* =======================================================
   OB Kampanya Simülatörü (Trendyol Temalı - Mavi)
   ======================================================= */

:root {
  --obcamp-primary: #2563eb;       /* Canlı Mavi (Ana Renk) */
  --obcamp-primary-hover: #1d4ed8;
  --obcamp-dark-bg: #1e293b;       /* Koyu Lacivert/Siyah */
  --obcamp-dark-surface: #0f172a;
  --obcamp-border: #e2e8f0;
  --obcamp-text: #334155;          /* Genel Metin */
  --obcamp-input-text: #1e293b;    /* Koyu Metin */
  --obcamp-muted: #64748b;         /* Silik Metin */
  --obcamp-success: #10b981;       /* Kâr/Toplam Yeşili */
  --obcamp-radius: 12px;
}

.ob-camp {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--obcamp-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ob-camp * {
  box-sizing: border-box;
}

.ob-camp__title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 0.5rem; 
  color: #1e293b;
  letter-spacing: -0.02em;
  text-align: center;
}

/* Ana grid: Sol form – Sağ sonuç */
.ob-camp__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.ob-camp__card {
  border-radius: var(--obcamp-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Sol kart (form) */
.ob-camp__card--form {
  background: #ffffff;
  border: 1px solid var(--obcamp-border);
  padding: 1.25rem;
}

/* Sağ kart (sonuçlar) */
.ob-camp__card--result {
  background: linear-gradient(145deg, var(--obcamp-dark-bg), var(--obcamp-dark-surface));
  color: #f1f5f9;
  border: none;
  padding: 1.25rem; 
}

/* Form satırları */
.ob-camp .row {
  margin-bottom: 1rem;
}

/* Aynı satırda iki kolon */
.ob-camp .row.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.ob-camp .lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--obcamp-text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

/* Kısa açıklama yazıları */
.ob-camp .hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--obcamp-muted);
  line-height: 1.4;
}

/* =======================
   İnputlar ve Kutu Çözümleri
   ======================= */

.ob-camp .inp-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ob-camp .inp-prefix {
    position: absolute;
    left: 14px !important; 
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 600;
    color: var(--obcamp-muted);
    pointer-events: none;
    z-index: 2;
}

/* Normal inputlar */
.ob-camp .inp {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 500;
  color: var(--obcamp-input-text);
  padding: 0 16px !important;
  outline: none;
  transition: all 0.2s ease-in-out;
}

/* Simgesi olan inputlara soldan boşluk ver */
.ob-camp .inp-prefix + .inp {
    padding-left: 36px !important;
}

.ob-camp .inp:focus {
  background: #fff;
  border-color: var(--obcamp-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Select için ok işareti yapısı */
.ob-camp .select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ob-camp .select-wrap::after {
  content: "▾";
  position: absolute;
  right: 16px;
  color: var(--obcamp-muted);
  font-weight: 900;
  font-size: 14px;
  pointer-events: none;
}
.ob-camp select.inp {
  appearance: none;
  padding-right: 32px !important;
  cursor: pointer;
}

/* =======================
   KDV Seçenekleri (Buton/Pill Stili)
   ======================= */
.ob-camp__vat {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.ob-camp .vat-pill {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.ob-camp .vat-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ob-camp .vat-pill span, 
.ob-camp .vat-custom-input {
  height: 40px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--obcamp-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s ease;
}

.ob-camp .vat-pill span:hover {
  color: var(--obcamp-primary);
}

.ob-camp .vat-pill input[type="radio"]:checked + span {
  background: #ffffff;
  color: var(--obcamp-input-text);
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ob-camp .vat-pill--custom { padding: 0; }
.ob-camp .vat-custom-input {
  width: 100%;
  outline: none;
  padding: 0 10px !important;
}
.ob-camp .vat-custom-input::placeholder { color: var(--obcamp-muted); font-weight: 600; }
.ob-camp .vat-pill--custom input[type="radio"]:checked ~ .vat-custom-input {
  background: #ffffff;
  color: var(--obcamp-input-text);
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Number spin butonlarını kaldır */
.ob-camp .vat-custom-input::-webkit-outer-spin-button,
.ob-camp .vat-custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ob-camp .vat-custom-input[type="number"] { -moz-appearance: textfield; }

/* =======================
   Trendyol Tarzı Switch (Komisyon KDV Dahil)
   ======================= */
.ob-camp .switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--obcamp-text);
}

.ob-camp .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ob-camp .slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.ob-camp .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.ob-camp .switch input:checked + .slider {
    background-color: var(--obcamp-primary);
}

.ob-camp .switch input:checked + .slider:before {
    transform: translateX(16px);
}

/* Komisyon satırı düzeni */
.ob-camp__commission-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ob-camp__commission-inline .inp-wrap { flex: 1; }

/* =======================
   Vergi Ayarları (Yan Yana)
   ======================= */
.ob-camp .row--tax { margin-top: 1rem; }
.ob-camp__tax-options {
    display: flex; 
    flex-wrap: wrap;
    gap: 1rem; 
    align-items: center;
    margin-bottom: 0.5rem;
}
.ob-camp .tax-opt { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 13px; font-weight: 500; color: var(--obcamp-text); cursor: pointer; }
.ob-camp .tax-opt input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--obcamp-primary); cursor: pointer; }

/* =======================
   Adet Bazlı İndirim Alanı 
   ======================= */
.ob-camp__rules-row { 
    display: grid; 
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr); 
    gap: 0.75rem; 
    background: #f8fafc; 
    padding: 12px; 
    border-radius: 8px; 
    border: 1px dashed #cbd5e1; 
}
.ob-camp__rules-label { padding-top: 2px; }
.ob-camp-rules-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.ob-camp-rules { display: flex; flex-direction: column; gap: 0.5rem; }

/* JS ile eklenen satırların uyumu (GÜNCELLENDİ: Metin sıkışması çözüldü) */
.ob-camp-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.ob-camp-rule-row .inp {
  height: 40px !important;
  padding: 0 10px !important; /* Metnin sığması için sağ-sol boşlukları azaltıldı */
  font-size: 13px !important; /* "% İndirim" yazısının sığması için küçültüldü */
}

.ob-camp-rule-row select.inp {
  padding-right: 22px !important; /* Sadece ok işareti için gereken minimum boşluk */
}

.ob-camp-rule-remove { 
    border: none; 
    background: #fee2e2; 
    color: #991b1b; 
    width: 32px; 
    height: 32px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 16px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s ease; 
}
.ob-camp-rule-remove:hover { background: #fecaca; color: #7f1d1d; }
.ob-camp-rules-actions { margin-top: 0.5rem; }

/* Butonlar */
.ob-camp .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ob-camp .btn.primary { background: var(--obcamp-primary); color: #fff; border: none; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.ob-camp .btn.primary:hover { background: var(--obcamp-primary-hover); transform: translateY(-1px); }
.ob-camp .btn.ghost { background: #fff; border: 1px solid var(--obcamp-border); color: var(--obcamp-muted); }
.ob-camp .btn.ghost:hover { background: #f8fafc; color: var(--obcamp-text); }
.ob-camp .btn.lg { height: 44px; font-size: 15px; }

/* Hesapla & Temizle – YAN YANA */
.ob-camp .actions { margin-top: auto; padding-top: 1.5rem; display: flex; flex-direction: row; gap: 12px; }
.ob-camp .actions .btn { flex: 1; min-width: 0; }

/* =======================
   Sağ Kart: Sonuçlar (Koyu Tema)
   ======================= */
.ob-camp__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.ob-camp__col .col-title {
  margin: 0 0 1rem;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

/* Sonuç satırları */
.ob-camp .res {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ob-camp .res:last-child { border-bottom: none; }
.ob-camp .res > div:first-child { color: #94a3b8; }
.ob-camp .res > div:last-child { font-weight: 600; color: #f8fafc; font-variant-numeric: tabular-nums; }

/* Net Kâr gibi ara vurgular */
.ob-camp .res.highlight-sm {
  background: rgba(255,255,255,0.05);
  margin: 0.25rem -10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
}
.ob-camp .res.highlight-sm > div:first-child { color: #fff; font-weight: 700; }
.ob-camp .res.highlight-sm > div:last-child { color: #fff; font-weight: 700; font-size: 15px;}

/* En Alttaki Büyük Kâr Farkı Özeti */
.ob-camp__diff {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(255,255,255,0.2);
}

.ob-camp__diff .res.strong.big {
  background: var(--obcamp-success);
  margin-bottom: 1rem;
  padding: 16px 1.25rem;
  border-radius: 8px;
  border: none;
}
.ob-camp__diff .res.strong.big div:first-child { color: #ffffff; font-size: 16px; font-weight: 700; }
.ob-camp__diff .res.strong.big div:last-child { color: #ffffff; font-size: 24px; font-weight: 800; }

.ob-camp__diff .res { border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Uyarı & Notlar */
.ob-camp__note { margin-top: 1.5rem; font-size: 12px; color: #94a3b8; line-height: 1.5; }
.ob-camp__result-error { margin-top: 1rem; padding: 12px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 13px; font-weight: 500;}
.ob-camp__result--error-hidden { display: none; }


/* ============================
   YASAL UYARI + AÇIKLAMA 
   ============================ */
.ob-camp__meta{
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Kırmızı/pembe uyarı kutusu */
.ob-camp__legal{
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 12px;
  padding: 1.25rem;
}

.ob-camp__legal-head{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #991b1b;
  font-size: 14px;
}

.ob-camp__legal-ico{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  background: #ef4444;
}

.ob-camp__legal-text{
  margin: 0.5rem 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #7f1d1d;
}

/* Hesaplama mantığı kutusu */
.ob-camp__explain{
  border: 1px solid var(--obcamp-border);
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.25rem;
}

.ob-camp__explain-title{
  margin: 0 0 0.8rem;
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
}

.ob-camp__explain-list{
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--obcamp-text);
  font-size: 13px;
  line-height: 1.6;
}

.ob-camp__explain-list li{ margin: 0.3rem 0; }

.ob-camp__formulas{
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ob-camp__formula{
  border: 1px dashed #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
}

.ob-camp__formula strong{ font-size: 13px; color: #1e293b; }
.ob-camp__formula span{ font-size: 13px; color: var(--obcamp-muted); line-height: 1.5; }

.ob-camp__explain-note{
  margin: 1rem 0 0;
  font-size: 12px;
  color: var(--obcamp-muted);
  line-height: 1.5;
}

/* ============================
   Responsive (Mobil Uyum)
   ============================ */
@media (max-width: 900px) {
  .ob-camp__grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .ob-camp { padding: 0 0.5rem; margin: 0 auto 2rem; font-size: 13px; }
  .ob-camp__title { font-size: 20px; margin-bottom: 1rem; }
  
  .ob-camp__card--form { padding: 1.25rem !important; }
  .ob-camp .row.two { grid-template-columns: 1fr; }

  /* MOBİL: KDV kutuları yan yana */
  .ob-camp__vat { grid-template-columns: repeat(4, 1fr) !important; gap: 4px; }
  .ob-camp .vat-pill span, .ob-camp .vat-custom-input { font-size: 13px; padding: 0 4px !important; }

  /* Mobil: Komisyon checkbox satırda kalsın */
  .ob-camp__commission-inline { gap: 0.5rem; }
  .ob-camp__commission-vatopt { padding: 0; }

  /* Mobil: Adet bazlı indirim satırını dikey yap */
  .ob-camp__rules-row { grid-template-columns: 1fr; padding: 10px; }
  
  .ob-camp-rule-row { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 0.5rem; 
  }
  .ob-camp-rule-row .inp { width: 100%; flex: none; }
  .ob-camp-rule-remove { grid-column: span 2; width: 100%; height: 36px; border-radius: 8px; margin-top: 4px; }

  /* Mobil: Hesapla & Temizle yan yana kalsın */
  .ob-camp .actions { flex-direction: row; gap: 8px; padding-top: 1.25rem; }
  .ob-camp .btn.lg { height: 44px; font-size: 14px; }
  
  /* Büyük Kâr Farkı Kutusu tam genişlik */
  .ob-camp__diff .res.strong.big { margin-left: -1.25rem; margin-right: -1.25rem; border-radius: 0; }

  /* Uyarı Kartları padding */
  .ob-camp__legal, .ob-camp__explain { padding: 1rem; }
}