/* =========================
   THEME SYSTEM
========================= */

/* DARK (default) */
:root{
  --bg: #0f1115;
  --card: #171a21;
  --text: #ffffff;
  --muted: #a9b1c3;
  --border: #2a2f3a;
  --accent: #5c8cff;
}

/* LIGHT */
body.light{
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #101114;
  --muted: #5b6475;
  --border: #dfe3eb;
  --accent: #4c7dff;
}


/*---------------------------------------------------------------------------------*/
:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body{
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: bold;
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav a {
  color: var(--muted);
}

.nav a:hover {
  color: white;
}

.nav .lang {
  padding: 6px 10px;
  background: var(--primary);
  border-radius: 6px;
  color: white;
}

.nav .disabled {
  opacity: 0.4;
  pointer-events: none;
}

.wrap {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  margin-top: 10px;
}

.nav a.active {
  color: white;
  font-weight: 700;
}

/*-----------------------------------------------------*/
.seo{
  margin-top:24px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,0.02);
}
.seo h2{ margin:0 0 10px; }
.seo h3{ margin:14px 0 8px; }
.seo p, .seo li{ line-height:1.6; }
.seo ul{ padding-left:18px; }
.seo a{ text-decoration:underline; }


/*--------------------------------------------------------*/

/* =========================
   PREMIUM HEADER (Top Nav)
   ========================= */

:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,0.04);
  --panel2: rgba(255,255,255,0.06);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --border: rgba(255,255,255,0.12);
  --accent: #3b82f6;
  --accent2: #60a5fa;
}

/* global background polish (safe) */
body{
  background: radial-gradient(1200px 500px at 20% -10%, rgba(96,165,250,0.25), transparent 55%),
              radial-gradient(900px 450px at 90% 0%, rgba(59,130,246,0.18), transparent 60%),
              var(--bg);
  color: var(--text);
}

/* header container */
header.top{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11,18,32,0.82), rgba(11,18,32,0.55));
  border-bottom: 1px solid var(--border);
}

/* inner layout */
header.top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
}

/* logo */
header.top .logo{
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

/* nav row */
header.top .nav{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* nav links */
header.top .nav a{
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, color .12s ease;
}

/* hover */
header.top .nav a:hover{
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  transform: translateY(-1px);
}

/* active link (we already set active class in JS) */
header.top .nav a.active{
  color: var(--text);
  background: linear-gradient(180deg, rgba(59,130,246,0.22), rgba(59,130,246,0.12));
  border-color: rgba(96,165,250,0.35);
}

/* language button */
header.top .nav a.lang{
  color: var(--text);
  background: linear-gradient(180deg, rgba(59,130,246,0.85), rgba(59,130,246,0.55));
  border-color: rgba(96,165,250,0.55);
  padding: 8px 12px;
}

/* page container polish */
main.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
}

/* mobile: nav scroll instead of wrapping mess */
@media (max-width: 720px){
  header.top{
    padding: 10px 12px;
  }
  header.top .nav{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }
  header.top .nav::-webkit-scrollbar{
    height: 6px;
  }
  header.top .nav::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,0.16);
    border-radius: 10px;
  }
  header.top .nav a{
    white-space: nowrap;
  }
}



/* Copy feedback: 0.7s green flash */
.btn.copied{
  background: rgba(34,197,94,0.22) !important;
  border-color: rgba(34,197,94,0.55) !important;
  transition: background .25s ease, border-color .25s ease;
}

/*---------------------------------------------------------------------------------------------------------*/


/* =========================
   BUTTONS ONLY (Minimal Dark)
   ========================= */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 12px;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);

  font-weight: 750;
  cursor: pointer;

  transition: transform .10s ease, background .12s ease, border-color .12s ease, filter .12s ease;
}

.btn:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.btn:active{
  transform: translateY(1px);
  filter: brightness(0.98);
}

/* Primary (Hesapla/Calculate) */
button[type="submit"].btn{
  background: rgba(59,130,246,0.92);
  border-color: rgba(96,165,250,0.55);
  color: #fff;
}

button[type="submit"].btn:hover{
  filter: brightness(1.05);
}

/* Ghost buttons (Kopyala/Sıfırla/Formül) */
.btn.ghost{
  background: transparent;
}

/* Copied flash (0.7s) */
.btn.copied{
  background: rgba(34,197,94,0.22) !important;
  border-color: rgba(34,197,94,0.55) !important;
}


/* =========================
   THEME UPGRADE (Dark, subtle, clear)
   ========================= */

/* Background: subtle premium */
body{
  background:
    radial-gradient(900px 450px at 15% -10%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(700px 380px at 85% 0%, rgba(34,197,94,0.10), transparent 60%),
    #0b1220;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  transition: background .25s ease, border .25s ease;
}


.card::before{
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(600px 180px at 20% 0%, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}

/* Labels + inputs a bit bigger (clearer) */
label{
  font-size: 14px;
  color: rgba(255,255,255,0.78);
}

input, select{
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}


/* Buttons: more attractive but still clean */
button[type="submit"].btn{
  background: linear-gradient(180deg, rgba(59,130,246,0.98), rgba(59,130,246,0.62));
  border-color: rgba(96,165,250,0.70);
  box-shadow: 0 10px 24px rgba(59,130,246,0.18);
  position: relative;
  overflow: hidden;
}

/* subtle shine on hover */
button[type="submit"].btn::after{
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 60%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: rotate(18deg);
  opacity: 0;
  transition: opacity .18s ease;
}

button[type="submit"].btn:hover::after{
  opacity: 1;
}

/* Ghost buttons slightly clearer */
.btn.ghost{
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.12);
}

/* Focus ring for accessibility (nice polish) */
.btn:focus-visible,
input:focus-visible,
select:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.20);
}

/* Result row: keep simple but a bit cleaner */
.result{
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  padding: 10px 12px;
}


/* =========================
   TUNE PACK (requested)
   ========================= */

/* label biraz büyüsün */
label{
  font-size: 15px;
}

/* input biraz küçülsün */
input, select{
  padding: 10px 12px;
  font-size: 14px;
}

/* sonuçtaki dashed border kalksın */
.result{
  border: none;
  background: transparent;
  padding: 6px 0;
}

/* =========================
   GLASS BUTTON STYLE
   ========================= */

.btn.ghost,
button[data-action="copy"],
button[data-action="formula"],
button[data-reset],
button[data-reset-1],
button[data-reset-2],
button[data-reset-vat],
button[data-reset-discount],
button[data-reset-change],
button[data-reset-reverse],
button[data-reset-profit-1],
button[data-reset-profit-2],
button[data-reset-ratio],
button[data-reset-simple],
button[data-reset-compound]{
  
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 650;

  transition: all .15s ease;
}

/* hover */
.btn.ghost:hover,
button[data-action="copy"]:hover,
button[data-action="formula"]:hover{
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

/* click */
.btn.ghost:active,
button[data-action="copy"]:active,
button[data-action="formula"]:active{
  transform: translateY(1px);
}

/* copied flash zaten çalışıyor */


/* =========================
   BUTTON + BORDER UPGRADE
   ========================= */

/* 1) HESAPLA daha büyük */
button[type="submit"].btn{
  padding: 12px 18px;
  font-size: 15px;
  border-radius: 14px;
}

/* 2) Strong glass for secondary buttons */
.btn.ghost,
button[data-action="copy"],
button[data-action="formula"],
button[data-reset],
button[data-reset-1],
button[data-reset-2],
button[data-reset-vat],
button[data-reset-discount],
button[data-reset-change],
button[data-reset-reverse],
button[data-reset-profit-1],
button[data-reset-profit-2],
button[data-reset-ratio],
button[data-reset-simple],
button[data-reset-compound]{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.30),
    0 1px 0 rgba(255,255,255,0.10) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  padding: 9px 13px;
  border-radius: 14px;
  font-weight: 700;
}

/* glass hover */
.btn.ghost:hover,
button[data-action="copy"]:hover,
button[data-action="formula"]:hover{
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

/* glass active */
.btn.ghost:active,
button[data-action="copy"]:active,
button[data-action="formula"]:active{
  transform: translateY(1px);
}

/* 3) Solid border (no dashed) for result boxes */
.result{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 10px 12px;
}


/* =========================
   GLASS++ TUNING
   ========================= */

/* 1) Labels biraz büyüsün */
label{
  font-size: 16px;
  letter-spacing: 0.1px;
}

/* 2) Formülü Göster butonu biraz daha büyük */
button[data-action="formula"]{
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 16px;
}

/* 3) Stronger glass feel for secondary buttons */
.btn.ghost,
button[data-action="copy"],
button[data-action="formula"],
button[data-reset],
button[data-reset-1],
button[data-reset-2],
button[data-reset-vat],
button[data-reset-discount],
button[data-reset-change],
button[data-reset-reverse],
button[data-reset-profit-1],
button[data-reset-profit-2],
button[data-reset-ratio],
button[data-reset-simple],
button[data-reset-compound]{

  /* more glass */
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.26);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  /* more depth */
  box-shadow:
    0 18px 40px rgba(0,0,0,0.40),
    0 1px 0 rgba(255,255,255,0.14) inset;

  position: relative;
  overflow: hidden;
}

/* glass shine (subtle moving highlight) */
.btn.ghost::after,
button[data-action="copy"]::after,
button[data-action="formula"]::after{
  content: "";
  position: absolute;
  top: -70%;
  left: -40%;
  width: 60%;
  height: 240%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: rotate(18deg);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}

.btn.ghost:hover::after,
button[data-action="copy"]:hover::after,
button[data-action="formula"]:hover::after{
  opacity: 1;
}

/* hover a bit more premium */
.btn.ghost:hover,
button[data-action="copy"]:hover,
button[data-action="formula"]:hover{
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
}


/* =========================
   COPY/RESET GLOW + MOBILE SAFE
   ========================= */

/* Reset butonlarını biraz büyüt */
button[data-reset],
button[data-reset-1],
button[data-reset-2],
button[data-reset-vat],
button[data-reset-discount],
button[data-reset-change],
button[data-reset-reverse],
button[data-reset-profit-1],
button[data-reset-profit-2],
button[data-reset-ratio],
button[data-reset-simple],
button[data-reset-compound]{
  padding: 10px 16px;     /* biraz daha büyük */
  font-size: 14px;
}

/* Copy + Reset için hafif ışık (glow) */
button[data-action="copy"],
button[data-copy],
button[data-reset],
button[data-reset-1],
button[data-reset-2],
button[data-reset-vat],
button[data-reset-discount],
button[data-reset-change],
button[data-reset-reverse],
button[data-reset-profit-1],
button[data-reset-profit-2],
button[data-reset-ratio],
button[data-reset-simple],
button[data-reset-compound]{
  box-shadow:
    0 18px 40px rgba(0,0,0,0.40),
    0 1px 0 rgba(255,255,255,0.14) inset,
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 0 22px rgba(59,130,246,0.08);  /* hafif mavi ışık */
}

/* Hover animasyonu sadece hover destekleyen cihazlarda çalışsın (mobilde saçmalamasın) */
@media (hover: hover) and (pointer: fine){
  button[data-action="copy"]:hover,
  button[data-copy]:hover,
  button[data-reset]:hover,
  button[data-reset-1]:hover,
  button[data-reset-2]:hover,
  button[data-reset-vat]:hover,
  button[data-reset-discount]:hover,
  button[data-reset-change]:hover,
  button[data-reset-reverse]:hover,
  button[data-reset-profit-1]:hover,
  button[data-reset-profit-2]:hover,
  button[data-reset-ratio]:hover,
  button[data-reset-simple]:hover,
  button[data-reset-compound]:hover{
    transform: translateY(-2px);
  }
}

/* Mobilde “tıklama hissi” active ile gelir (dokununca) */
button[data-action="copy"]:active,
button[data-copy]:active,
button[data-reset]:active,
button[data-reset-1]:active,
button[data-reset-2]:active,
button[data-reset-vat]:active,
button[data-reset-discount]:active,
button[data-reset-change]:active,
button[data-reset-reverse]:active,
button[data-reset-profit-1]:active,
button[data-reset-profit-2]:active,
button[data-reset-ratio]:active,
button[data-reset-simple]:active,
button[data-reset-compound]:active{
  transform: translateY(1px);
}


.card{
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(0,0,0,0.42);
}

.card::after{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(700px 220px at 20% 0%, rgba(59,130,246,0.05), transparent 60%);
  pointer-events:none;
  opacity: .9;
}

/*-------------------------------------------------------------------------------------------------------------------*/

/* Percent page: compact single line */
.percent-line{
  display: grid;
  grid-template-columns: 260px 220px auto auto; /* sayı | yüzde | hesapla | formül */
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 12px;
}

.percent-line .row{
  display: grid;
  gap: 6px;
  margin: 0;
}

.percent-line > .btn{
  height: 44px;
  align-self: end;
}

.result.compact{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 10px;
  align-items: center;
}

/* kopyala butonu alta insin */
.result.compact .btn{
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 4px;
}

/* Mobile: stack */
@media (max-width: 900px){
  .percent-line{ grid-template-columns: 1fr; }
  .result.compact{ grid-template-columns: 1fr auto; }
  .result.compact .result-label{ grid-column: 1 / -1; }
}

/*--------------------------------------------------------------------------------------------------------*/

.formula-box{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.formula-box .formula-copy{
  margin-bottom: 10px;
}

.formula-box .formula-text{
  color: var(--muted);
  white-space: pre-line; /* çok satırlı formüller düzgün görünsün */
  line-height: 1.45;
}


/*-------------------------------------------------------------------------------------------------------------------*/

select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: inherit;
  outline: none;
}
select:focus{
  border-color: rgba(255,255,255,0.18);
}

/*------------------------------------------------------------------------------------------------------*/

/* =========================
   SIMPLE INTEREST UI POLISH
   (CSS only - no code change)
   ========================= */

/* 1) Formu daha sade, düzenli yap */
.card form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.card label{
  font-size:14px;
  font-weight:600;
  opacity:.95;
  margin:0;
}

.card input,
.card select{
  width:100%;
  max-width:520px;         /* inputlar aşırı uzamasın */
}

/* Aynı satırda yan yana duran şeyler varsa taşmadan dursun */
.row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

/* 2) Select dropdown (açılır liste) görünür olsun (Windows/Chrome fix) */
select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;

  background: rgba(255,255,255,0.06);
  color: var(--text, #eaf0ff);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;

  padding: 12px 14px;
  line-height: 1.2;

  /* önemli: tarayıcıya “dark UI” olduğunu söyle */
  color-scheme: dark;
}

select:focus{
  outline:none;
  border-color: rgba(90,170,255,0.8);
  box-shadow: 0 0 0 4px rgba(60,140,255,0.18);
}

/* Açılır listede seçenekler beyaz kalıp görünmeme problemi */
select option{
  background: #0b1220;     /* koyu arkaplan */
  color: #eaf0ff;          /* açık yazı */
}

/* 3) Butonlar daha temiz ve düzenli */
.actions,
.inline-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:6px;
}

.btn{
  border-radius: 14px;
}

/* 4) Sonuç kutuları daha sade, daha az “karmaşık” */
.result{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,0.14);
  border-radius:14px;
  background: rgba(255,255,255,0.04);
  max-width:720px;
}

.result-label{
  min-width:110px;
  font-weight:600;
  opacity:.95;
}

.result-value{
  font-size:18px;
  font-weight:800;
  letter-spacing:.2px;
}

/* Kopyala butonu sonuç bloğunda daha küçük dursun */
.result .btn{
  margin-left:auto;
  padding:10px 14px;
  border-radius:12px;
}

/* Mobilde daha düzgün */
@media (max-width: 720px){
  .card input,
  .card select{
    max-width:100%;
  }
  .result{
    flex-wrap:wrap;
  }
  .result .btn{
    margin-left:0;
  }
}


.btn{
  background: var(--accent);
  color: white;
}


.theme-toggle{
  margin-left: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}


/*-----------------------------------------------------------------------------------------------------------*/

/* =========================================================
   FULL THEME OVERRIDE (Dark default + Light toggle)
   Paste at END of style.css
   ========================================================= */

/* 1) Color tokens (Dark default) */
:root{
  --bg: #0e1118;
  --bg2: #0b0e14;
  --card: rgba(255,255,255,0.04);
  --card2: rgba(255,255,255,0.06);
  --text: #eaf0ff;
  --muted: rgba(234,240,255,0.70);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --accent: #5c8cff;
  --accent2: rgba(92,140,255,0.20);
  --good: #20c874;
  --good2: rgba(32,200,116,0.25);
}

/* 2) Light tokens */
body.light{
  --bg: #f4f6fb;
  --bg2: #eef2f9;
  --card: rgba(255,255,255,0.92);
  --card2: rgba(255,255,255,0.98);
  --text: #0e1220;
  --muted: rgba(14,18,32,0.72);
  --border: rgba(14,18,32,0.12);
  --shadow: 0 18px 60px rgba(14,18,32,0.10);
  --accent: #3f73ff;
  --accent2: rgba(63,115,255,0.16);
  --good: #11a85e;
  --good2: rgba(17,168,94,0.18);
}

/* 3) Page background + global text */
html, body{
  background: radial-gradient(1200px 700px at 15% -10%, var(--accent2), transparent 55%),
              radial-gradient(900px 600px at 90% 0%, rgba(255,255,255,0.06), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  transition: background .25s ease, color .25s ease;
}

/* 4) Links */
a{ color: var(--text); }
a:hover{ opacity: .9; }

/* 5) Header / Nav / Banner look */
header.top{
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

body.light header.top{
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
}

.nav a{
  color: var(--muted);
}
.nav a.active{
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
body.light .nav a.active{
  background: rgba(14,18,32,0.04);
}

/* 6) Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: background .25s ease, border .25s ease, box-shadow .25s ease;
}

/* 7) Inputs / Selects */
input, select, textarea{
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: background .2s ease, border .2s ease, box-shadow .2s ease;
}

body.light input, body.light select, body.light textarea{
  background: rgba(14,18,32,0.03);
}

input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: rgba(92,140,255,0.7);
  box-shadow: 0 0 0 4px var(--accent2);
}

/* Select dropdown options visibility (Windows/Chrome fix) */
select{
  color-scheme: dark;
}
body.light select{
  color-scheme: light;
}
select option{
  background: var(--bg);
  color: var(--text);
}

/* 8) Buttons */
.btn{
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border .2s ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(92,140,255,0.22);
}
.btn:active{
  transform: translateY(0px);
}

.btn.ghost{
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
body.light .btn.ghost{
  background: rgba(14,18,32,0.03);
}

.btn.copied,
.copied{
  background: var(--good) !important;
  box-shadow: 0 10px 30px var(--good2);
}

/* Theme toggle button (if you're using .theme-toggle) */
.theme-toggle{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
}
body.light .theme-toggle{
  background: rgba(14,18,32,0.03);
}

/* 9) Result blocks */
.result{
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
}
body.light .result{
  background: rgba(14,18,32,0.03);
}
.result-label{ color: var(--muted); }
.result-value{ color: var(--text); }

/* 10) SEO section */
.seo{
  color: var(--text);
}
.seo p, .seo li{
  color: var(--muted);
}
.seo a{
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.25);
}
body.light .seo a{
  text-decoration-color: rgba(14,18,32,0.25);
}

/* 11) Hint */
.hint{
  color: var(--muted);
}

/* 12) Smooth for everything */
*{
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: .25s;
  transition-timing-function: ease;
}

/* =========================
   LIGHT THEME FIX OVERRIDES
   (paste at very end)
   ========================= */

/* 1) Light background: siyah boşlukları engelle */
body.light, body.light html{
  background: linear-gradient(180deg, var(--bg), var(--bg2)) !important;
}

/* sayfa tam yüksekliği doldursun */
html, body{ min-height: 100%; }
body{ margin: 0; }

/* wrap genişliği/arka planı net olsun */
body.light .wrap{
  background: transparent;
}

/* 2) Light accent'i yumuşat (çok mavi olmasın) */
body.light{
  --accent: #2f6bff;     /* daha soft mavi */
  --accent2: rgba(47,107,255,0.14);
}

/* 3) Primary (Hesapla/Kopyala) butonlar light'ta daha “premium” */
body.light .btn{
  background: linear-gradient(180deg, #2f6bff, #2458d6);
  border: 1px solid rgba(14,18,32,0.14);
  box-shadow: 0 10px 26px rgba(47,107,255,0.18);
}
body.light .btn:hover{
  box-shadow: 0 14px 34px rgba(47,107,255,0.22);
}

/* 4) Ghost/secondary (Formülü Göster / Sıfırla) yazıları görünür olsun */
body.light .btn.ghost,
body.light .btn[type="button"]:not(.btn){ /* ekstra güvenlik */
  color: var(--text) !important;
}

body.light .btn.ghost{
  background: rgba(14,18,32,0.05) !important;
  border: 1px solid rgba(14,18,32,0.16) !important;
  box-shadow: none !important;
}
body.light .btn.ghost:hover{
  background: rgba(14,18,32,0.07) !important;
  transform: translateY(-1px);
}

/* Eğer "Sıfırla" ghost değilse de okunaklı yap */
body.light button.btn[type="button"]{
  color: var(--text);
}

/* 5) Header/nav light'ta daha net */
body.light header.top{
  background: rgba(255,255,255,0.92) !important;
  border: 1px solid rgba(14,18,32,0.10) !important;
}

/* 6) Card/result light kontrast */
body.light .card{
  background: rgba(255,255,255,0.95) !important;
}
body.light .result{
  background: rgba(14,18,32,0.03) !important;
  border: 1px solid rgba(14,18,32,0.10) !important;
}

/* ==============
   LIGHT SOFT ACCENT
   ============== */

body.light{
  --accent: #5b8cff;          /* yumuşak */
  --accent-strong: #3f74ff;
}

/* Ana buton */
body.light .btn{
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 18px rgba(63,116,255,0.18);
}

/* hover */
body.light .btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(63,116,255,0.22);
}

/* Kopyala vs daha sakin istersen */
body.light .result .btn{
  background: rgba(63,116,255,0.10);
  color: #2a4dbf;
  border: 1px solid rgba(63,116,255,0.25);
  box-shadow: none;
}

body.light .result .btn:hover{
  background: rgba(63,116,255,0.16);
}


/* =========================
   LIGHT MODE BUTTON SYSTEM
   ========================= */

body.light{
  --accent: #5b8cff;
  --accent-strong: #3f74ff;
}

/* ===== HESAPLA (PRIMARY) ===== */
body.light .btn[type="submit"]{
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 18px rgba(63,116,255,0.18);
}

body.light .btn[type="submit"]:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(63,116,255,0.22);
}


/* ===== FORMÜL / SIFIRLA / KOPYALA ===== */
body.light .btn:not([type="submit"]){
  background: rgba(255,255,255,0.6);
  color: #222;
  border: 1px solid rgba(0,0,0,0.15);
  backdrop-filter: blur(6px);
  box-shadow: none;
}

body.light .btn:not([type="submit"]):hover{
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}


/* =========================
   LIGHT MODE: secondary buttons (formula/reset) + results highlight
   ========================= */

body.light{
  --soft-panel: rgba(0,0,0,0.035);
  --soft-panel-2: rgba(0,0,0,0.055);
  --soft-border: rgba(0,0,0,0.14);
  --soft-text: rgba(0,0,0,0.78);
}

/* Formülü Göster + Sıfırla (secondary dark-glass) */
body.light .btn.ghost,
body.light button[data-action="formula"].btn,
body.light button[data-reset].btn,
body.light button[data-reset-1].btn,
body.light button[data-reset-2].btn,
body.light button[data-reset-discount].btn,
body.light button[data-reset-change].btn,
body.light button[data-reset-vat].btn,
body.light button[data-reset-reverse].btn,
body.light button[data-reset-ratio].btn,
body.light button[data-reset-simple].btn,
body.light button[data-reset-compound].btn{
  background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.06));
  color: var(--soft-text);
  border: 1px solid var(--soft-border);
  backdrop-filter: blur(6px);
}

body.light .btn.ghost:hover,
body.light button[data-action="formula"].btn:hover,
body.light button[data-reset].btn:hover,
body.light button[data-reset-1].btn:hover,
body.light button[data-reset-2].btn:hover,
body.light button[data-reset-discount].btn:hover,
body.light button[data-reset-change].btn:hover,
body.light button[data-reset-vat].btn:hover,
body.light button[data-reset-reverse].btn:hover,
body.light button[data-reset-ratio].btn:hover,
body.light button[data-reset-simple].btn:hover,
body.light button[data-reset-compound].btn:hover{
  background: linear-gradient(180deg, rgba(0,0,0,0.14), rgba(0,0,0,0.08));
  transform: translateY(-1px);
}

/* Sonuç blokları: çok hafif gri + border (göz oraya kayar) */
body.light .result{
  background: var(--soft-panel);
  border: 1px solid rgba(0,0,0,0.08);
}

body.light .result:hover{
  background: var(--soft-panel-2);
}

/* Result içindeki yazılar biraz daha net olsun */
body.light .result-label{ color: rgba(0,0,0,0.70); }
body.light .result-value{ color: rgba(0,0,0,0.92); }


/* =========================
   LIGHT MODE: button feedback (hover/active) like dark
   Applies to Copy + Formula + Reset
   ========================= */

body.light{
  --accent-soft: rgba(0, 120, 255, 0.14);   /* hover glow */
  --accent-soft-2: rgba(0, 120, 255, 0.20); /* stronger hover */
  --press: rgba(0, 0, 0, 0.10);             /* click shade */
}

/* hedef: kopyala + formül + sıfırla */
body.light .btn.ghost,
body.light button[data-action="formula"].btn,
body.light button[data-reset].btn,
body.light button[data-reset-1].btn,
body.light button[data-reset-2].btn,
body.light button[data-reset-discount].btn,
body.light button[data-reset-change].btn,
body.light button[data-reset-vat].btn,
body.light button[data-reset-reverse].btn,
body.light button[data-reset-ratio].btn,
body.light button[data-reset-simple].btn,
body.light button[data-reset-compound].btn,
body.light button[data-copy].btn{
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

/* Hover: hafif renk + glow */
body.light .btn.ghost:hover,
body.light button[data-action="formula"].btn:hover,
body.light button[data-reset].btn:hover,
body.light button[data-reset-1].btn:hover,
body.light button[data-reset-2].btn:hover,
body.light button[data-reset-discount].btn:hover,
body.light button[data-reset-change].btn:hover,
body.light button[data-reset-vat].btn:hover,
body.light button[data-reset-reverse].btn:hover,
body.light button[data-reset-ratio].btn:hover,
body.light button[data-reset-simple].btn:hover,
body.light button[data-reset-compound].btn:hover,
body.light button[data-copy].btn:hover{
  background: linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.07));
  border-color: rgba(0,120,255,0.35);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.10),
    0 0 0 3px var(--accent-soft);
  transform: translateY(-1px);
}

/* Active (tıklayınca): basılmış hissi */
body.light .btn.ghost:active,
body.light button[data-action="formula"].btn:active,
body.light button[data-reset].btn:active,
body.light button[data-reset-1].btn:active,
body.light button[data-reset-2].btn:active,
body.light button[data-reset-discount].btn:active,
body.light button[data-reset-change].btn:active,
body.light button[data-reset-vat].btn:active,
body.light button[data-reset-reverse].btn:active,
body.light button[data-reset-ratio].btn:active,
body.light button[data-reset-simple].btn:active,
body.light button[data-reset-compound].btn:active,
body.light button[data-copy].btn:active{
  transform: translateY(0px) scale(0.99);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.10),
    0 0 0 3px var(--accent-soft-2);
  background: linear-gradient(180deg, rgba(0,0,0,0.16), rgba(0,0,0,0.09));
}

/* Keyboard (tab ile): net focus */
body.light .btn.ghost:focus-visible,
body.light button[data-action="formula"].btn:focus-visible,
body.light button[data-reset].btn:focus-visible,
body.light button[data-reset-1].btn:focus-visible,
body.light button[data-reset-2].btn:focus-visible,
body.light button[data-reset-discount].btn:focus-visible,
body.light button[data-reset-change].btn:focus-visible,
body.light button[data-reset-vat].btn:focus-visible,
body.light button[data-reset-reverse].btn:focus-visible,
body.light button[data-reset-ratio].btn:focus-visible,
body.light button[data-reset-simple].btn:focus-visible,
body.light button[data-reset-compound].btn:focus-visible,
body.light button[data-copy].btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}


/* Kopyala feedback (dark + light) */
.btn.copied{
  border-color: rgba(0, 200, 120, .55) !important;
  background: linear-gradient(180deg, rgba(0, 200, 120, .32), rgba(0, 200, 120, .18)) !important;
  box-shadow: 0 0 0 3px rgba(0, 200, 120, .18) !important;
  transform: translateY(-1px);
}

/* Light modda yeşil daha “soft” dursun */
body.light .btn.copied{
  border-color: rgba(12, 131, 55, 0.822) !important;
  background: linear-gradient(180deg, rgba(20, 136, 63, 0.55), rgba(22, 163, 74, .38)) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .25) !important;
  color: #06281a;
}

/*-----------------------------------------------------------------------------------------------------------------------------*/

/* Result pulse when updated */
@keyframes resultPulse {
  0%   { box-shadow: 0 0 0 0 rgba(92,140,255,0.0); transform: translateY(0); }
  30%  { box-shadow: 0 0 0 4px rgba(92,140,255,0.16); transform: translateY(-1px); }
  100% { box-shadow: 0 0 0 0 rgba(92,140,255,0.0); transform: translateY(0); }
}

.result.updated{
  animation: resultPulse 420ms ease;
}

/* Light modda pulse daha soft */
body.light .result.updated{
  animation: resultPulse 420ms ease;
}

/* Copy toast */
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-size: 14px;
}

body.light .toast{
  background: rgba(255,255,255,0.85);
  color: var(--text);
}

.toast.show{
  opacity: 1;
  transform: translateY(0);
}

/* Ripple */
.btn{
  position: relative;
  overflow: hidden;
}

.btn .ripple{
  position: absolute;
  border-radius: 999px;
  transform: scale(0);
  opacity: .35;
  pointer-events: none;
  animation: ripple 520ms ease-out;
  background: rgba(255,255,255,0.75);
}

body.light .btn .ripple{
  background: rgba(14,18,32,0.22);
}

@keyframes ripple{
  to { transform: scale(4.2); opacity: 0; }
}


/*----------------------------------------------------------------------------------------*/

.btn .icon-check{
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -2px;
  margin-left: 6px;
}

/*-------------------------------------------------------------------------------------------------------*/

body.light .row label,
body.light form label{
  color: rgba(15, 23, 42, 0.82) !important;
}


/*---------------------------------------------------------------------------------------------------------*/

/* =====================
   HISTORY UI STYLES
   ===================== */

.history-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin: 12px 0 18px;
}

.history-bar .btn{
  display:flex;
  align-items:center;
  gap:8px;
}

/* Modal backdrop */
.hmodal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
}
.hmodal-backdrop.open{ display:flex; }

.hmodal{
  width: min(720px, 96vw);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  overflow:hidden;
}

.hmodal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.hmodal-title{
  font-weight: 800;
  font-size: 15px;
}

.hmodal-x{
  width: 38px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor:pointer;
}

.hmodal-body{
  padding: 14px 16px 16px;
}

.hmodal-text{
  opacity:.85;
  margin: 0 0 14px;
}

.hmodal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* List */
.history-empty{
  opacity:.7;
  padding: 10px 0;
}

.history-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.history-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

body.light .history-item{
  background: rgba(0,0,0,.03);
}

.history-summary{
  font-weight: 700;
  margin-bottom: 4px;
}

.history-ago{
  font-size: 12px;
  opacity:.65;
}

.history-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.icon-btn{
  width: 42px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease;
}
body.light .icon-btn{ background: rgba(0,0,0,.04); }

.icon-btn:hover{ transform: translateY(-1px); }
.icon-btn:active{ transform: translateY(0) scale(.98); }

.icon-btn.danger:hover{ background: rgba(255, 60, 60, .12); }


.history-bar.bottom{
  margin-top: 14px;
  display:flex;
  justify-content:flex-start;
  gap:10px;
  flex-wrap: wrap;
}

/*------------------------------------------------------------------------------------------------------------*/

/* Sticky history buttons (bottom-right) */
.history-fab{
  position: fixed;
  right: 14px;
  bottom: 14px;
  display:flex;
  gap:10px;
  z-index: 9998;
}

@media (max-width: 520px){
  .history-fab{
    right: 10px;
    bottom: 10px;
    flex-direction: column; /* mobilde üst üste daha temiz */
    align-items: flex-end;
  }
}

/* Inline history box under the form */
.history-box{
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

body.light .history-box{
  background: rgba(0,0,0,.03);
}

/*-----------------------------------------------------------------------------------*/

/* Form içi, sağa hizalı history bar */
.history-bar-inline{
  margin-top: 12px;
  display: flex;
  justify-content: flex-end; /* sağa */
  gap: 10px;
  flex-wrap: wrap;
}

/* Mobilde daha temiz */
@media (max-width: 520px){
  .history-bar-inline{
    justify-content: stretch;
  }
  .history-bar-inline .btn{
    flex: 1;
  }
}

/*--------------------------------------------------------------------------------*/

/* Inline history box */
.history-box{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.history-list{
  display: grid;
  gap: 10px;
}

.history-item{
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.history-main{
  min-width: 0;
}

.history-summary{
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-ago{
  margin-top: 4px;
  font-size: 12px;
  opacity: .7;
}

.history-actions{
  display:flex;
  gap: 8px;
  align-items: center;
}

.icon-btn{
  width: 38px;
  height: 38px;
  display:grid;
  place-items:center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

/* DARK */
body:not(.light) .history-box{
  background: rgba(255,255,255,.03);
}

body:not(.light) .history-item{
  background: rgba(255,255,255,.02);
}

body:not(.light) .icon-btn:hover{
  background: rgba(255,255,255,.06);
}

/* LIGHT */
body.light .history-box{
  background: rgba(0,0,0,.03);
}

body.light .history-item{
  background: rgba(0,0,0,.02);
}

body.light .icon-btn:hover{
  background: rgba(0,0,0,.06);
}


/*-------------------------------------------------------------------------------------------*/

/* --- HISTORY BAR (Sıfırla üstü) --- */
.history-bar-inline{
  margin-top: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* butonlara “premium ghost” hissi */
.history-bar-inline .btn.ghost{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
body.light .history-bar-inline .btn.ghost{
  background: rgba(0,0,0,.04);
}

.history-bar-inline .btn.ghost:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
}
body.light .history-bar-inline .btn.ghost:hover{
  background: rgba(0,0,0,.06);
}

.history-bar-inline .btn.ghost:active{
  transform: translateY(0px) scale(.99);
}

.history-bar-inline .btn.ghost.danger{
  border-color: rgba(220,80,80,.45);
}
.history-bar-inline .btn.ghost.danger:hover{
  background: rgba(220,80,80,.10);
}

/* icon alignment */
.history-bar-inline .icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  opacity: .9;
}

/* --- HISTORY BOX (Geçmiş açılınca) --- */
.history-box{
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
}
body.light .history-box{
  background: rgba(0,0,0,.03);
}

.history-list{ display: grid; gap: 10px; }

.history-item{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
body.light .history-item{
  background: rgba(0,0,0,.02);
}

.history-summary{
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-ago{
  margin-top: 4px;
  font-size: 12px;
  opacity: .7;
}

.icon-btn{
  width: 38px;
  height: 38px;
  display:grid;
  place-items:center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
body.light .icon-btn{
  background: rgba(0,0,0,.03);
}

.icon-btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
body.light .icon-btn:hover{ background: rgba(0,0,0,.06); }
.icon-btn:active{ transform: translateY(0) scale(.99); }

/* --- CLEAR ALL CONFIRM MODAL (Tümünü Temizle) --- */
.confirm-overlay{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
  backdrop-filter: blur(10px);
}
body:not(.light) .confirm-overlay{ background: rgba(0,0,0,.55); }
body.light .confirm-overlay{ background: rgba(255,255,255,.55); }

.confirm-modal{
  width: min(440px, 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 14px 12px;
  backdrop-filter: blur(12px);
}
body:not(.light) .confirm-modal{
  background: rgba(18,18,22,.92);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
body.light .confirm-modal{
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 70px rgba(0,0,0,.12);
}

.confirm-modal h3{ margin: 0 0 8px; font-size: 16px; }
.confirm-modal p{ margin: 0 0 12px; opacity: .85; line-height: 1.35; }

.confirm-actions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
}


/* Confirm arka plan */
.confirm-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* DARK MODE */
body.dark .confirm-overlay{
  background: rgba(0, 0, 0, 1);   /* önce 0.4-0.5 civarıydı */
}

/* LIGHT MODE */
body.light .confirm-overlay{
  background: rgba(0, 0, 0, 0.35);
}

/* DARK MODE CONFIRM PANEL */
body.dark .confirm-box{
  background: #1b1f2a;      /* tam opak */
  backdrop-filter: none;    /* blur kapat */
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}


body.dark .confirm-box{
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/*------------------------------------------------------------------*/

/* ============================
   CONFIRM / MODAL (DARK) FIX
   - Arkayı karart (opak)
   - Paneli opak yap
   - Z-index düzelt
   ============================ */

/* 1) BACKDROP / OVERLAY (arkayı karartan katman) */
body.dark .confirm-overlay,
body.dark .confirm-backdrop,
body.dark .modal-overlay,
body.dark .modal-backdrop,
body.dark [data-confirm-overlay],
body.dark [data-modal-overlay]{
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.72) !important;  /* arkayı kapat */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 9998 !important;
}

/* Eğer overlay tıklanınca kapanıyorsa ama alan küçük kalıyorsa */
body.dark .confirm-overlay,
body.dark .confirm-backdrop,
body.dark .modal-overlay,
body.dark .modal-backdrop{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 2) PANEL / BOX (asıl confirm kutusu) */
body.dark .confirm-box,
body.dark .confirm-modal,
body.dark .modal,
body.dark .dialog,
body.dark [data-confirm-box],
body.dark [data-modal-box]{
  position: fixed !important;                 /* overlay üstünde dursun */
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9999 !important;

  width: min(560px, calc(100vw - 28px)) !important;
  background: #141a24 !important;             /* TAM OPAK */
  color: rgba(255,255,255,0.92) !important;

  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65) !important;

  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  overflow: hidden !important;
}

/* 3) Panel içindeki başlık alanı varsa (okunurluk + premium) */
body.dark .confirm-box .title,
body.dark .confirm-modal .title,
body.dark .modal .title,
body.dark .dialog .title,
body.dark [data-confirm-box] .title{
  padding: 14px 16px !important;
  font-weight: 700 !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(255,255,255,0.03) !important;
}

/* 4) Panel içindeki metin alanı */
body.dark .confirm-box .desc,
body.dark .confirm-modal .desc,
body.dark .modal .desc,
body.dark .dialog .desc,
body.dark [data-confirm-box] .desc{
  padding: 12px 16px 2px !important;
  color: rgba(255,255,255,0.78) !important;
}

/* 5) Buton alanı hizası (genelde sağda) */
body.dark .confirm-box .actions,
body.dark .confirm-modal .actions,
body.dark .modal .actions,
body.dark .dialog .actions,
body.dark [data-confirm-box] .actions{
  display: flex !important;
  gap: 10px !important;
  justify-content: flex-end !important;
  padding: 12px 16px 16px !important;
}

/* 6) Panel içindeki X kapatma butonu görünür olsun */
body.dark .confirm-box .close,
body.dark .confirm-modal .close,
body.dark .modal .close,
body.dark .dialog .close{
  color: rgba(255,255,255,0.85) !important;
}


/*-----------------------------------------------------------------------------------------------------*/

/* =========================
   DARK MODAL FIX (FINAL)
========================= */

/* Dark mod algısı: body:not(.light) */

body:not(.light) .hmodal {
  background: #141a24 !important;          /* tamamen opak panel */
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.75) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Eğer dış overlay varsa (modal arka perde) */
body:not(.light) .hmodal-overlay,
body:not(.light) .hmodal-backdrop {
  background: rgba(0,0,0,0.88) !important;  /* arkayı tamamen kapat */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Başlık kısmı */
body:not(.light) .hmodal-head {
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Yazı daha net olsun */
body:not(.light) .hmodal-text {
  color: rgba(255,255,255,0.9);
}

/*-------------------------------------------------------------------------------------*/

/* ===== MOBILE HEADER LAYOUT (logo center, theme right, nav below) ===== */
@media (max-width: 720px){

  header.top{
    display: grid;
    grid-template-columns: 44px 1fr 44px; /* sol: menü | orta: logo | sağ: theme */
    grid-template-rows: auto auto;        /* 1. satır header, 2. satır banner */
    align-items: center;
    gap: 10px 8px;
    padding: 10px 12px;
  }

  /* Logo ortada */
  header.top .logo{
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    text-align: center;
    white-space: nowrap;
    font-size: 16px;
  }

  /* Theme butonu sağda kalsın (sende class farklıysa aşağıdaki selector'ı değiştir) */
  header.top .theme-toggle,
  header.top [data-theme-toggle],
  header.top .mode-toggle{
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  /* Menü butonu solda (sende class farklıysa selector'ı değiştir) */
  header.top .menu-btn,
  header.top .burger,
  header.top [data-menu]{
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  /* Banner/nav artık altta, tam genişlik */
  header.top nav.nav{
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;

    display: flex;
    gap: 10px;
    padding: 8px 6px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }
  header.top nav.nav::-webkit-scrollbar{ display:none; }

  /* Nav linkleri daha kompakt */
  header.top nav.nav a{
    flex: 0 0 auto;
    padding: 8px 12px;
  }
}

/* =========================
   MOBİL: History yazı taşma fix (wrap + satır sınırı)
   ========================= */
@media (max-width: 720px) {

  /* kartın içindeki text alanı daralınca sarabilsin */
  .history-item,
  .history-row,
  [data-history-item]{
    overflow: hidden;          /* kart dışına taşanı kes */
  }

  /* history satırı grid/flex ise textin sarabilmesi için kritik */
  .history-main,
  .history-summary,
  .history-title,
  [data-history-title],
  [data-history-detail]{
    min-width: 0;              /* yoksa 1 satır kalıp taşabiliyor */
  }

  /* ana satır (senin ekranda görünen uzun cümle) */
  .history-summary,
  .history-title,
  [data-history-title]{
    white-space: normal !important;     /* tek satırı kapat */
    overflow: hidden !important;
    text-overflow: clip !important;

    overflow-wrap: anywhere !important; /* uzun kelimeleri kır */
    word-break: break-word !important;

    line-height: 1.35 !important;

    /* 4 satır göster, fazlasını ... yap */
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 4 !important;
  }

  /* alttaki zaman (3 sn önce) */
  .history-ago,
  .history-time,
  [data-history-time]{
    margin-top: 6px !important;
    white-space: nowrap !important;
    opacity: .75;
    font-size: 12px !important;
  }
}

/*-----------------------------------------------------------------------------------*/

/* ===== RESULT: value ellipsis + copy button fixed right (no wrap) ===== */

.result{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;     /* buton alt satıra düşmesin */
  min-width: 0;          /* ellipsis için şart */
}

/* Label: sabit */
.result .result-label{
  flex: 0 0 auto;
  min-width: 0;
}

/* Value: alanı doldursun + daralınca ... */
.result .result-value{
  flex: 1 1 auto;
  min-width: 0;          /* ellipsis için kritik */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
}

/* Copy button: hep sağda, küçülmesin */
.result button[data-copy]{
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 110px;      /* "Kopyalandı" sığsın; istersen 120 yap */
}

/* Mobilde daha dengeli görünüm */
@media (max-width: 720px){
  .result{
    gap: 8px;
  }
  .result button[data-copy]{
    min-width: 100px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/*--------------------------------------------------------------------------*/

/* Label + değer yan yana, buton sağda sabit */
.result{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Label sabit kalsın */
.result-label{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Label sonuna ":" ekle */
.result-label::after{
  content: ":";
  margin-left: 2px;
}

/* Değer esnesin, uzunsa ... olsun */
.result-value{
  flex: 1 1 auto;
  min-width: 0;              /* ellipsis için şart */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Buton her zaman sağa yapışsın */
.result .btn[data-copy]{
  flex: 0 0 auto;
  margin-left: auto;
}

/*----------------------------------------------------------------------------------------------------------------*/

.result {
  display: flex;
  align-items: center;
}

/* Label + value birlikte sol blok */
.result-label {
  display: inline;
}

.result-label::after {
  content: ": ";
}

/* Value artık sola yapışsın */
.result-value {
  display: inline;
  margin-left: 4px;
  font-weight: 600;
}

/* Buton sağa gitsin */
.result .btn[data-copy] {
  margin-left: auto;
}

/* RESULT: label + value solda, copy sağda (force override) */
.result{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:10px !important;
}

/* label sabit */
.result-label{
  flex:0 0 auto !important;
  white-space:nowrap !important;
}

/* ":" */
.result-label::after{
  content:": " !important;
}

/* value artık sağa kaçmasın */
.result-value{
  flex:0 1 auto !important;
  margin-left:0 !important;     /* eski margin-left:auto varsa ezer */
  width:auto !important;        /* width:100% varsa ezer */
  text-align:left !important;   /* text-align:right varsa ezer */
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  min-width:0 !important;
}

/* copy her zaman sağa */
.result button[data-copy],
.result .btn[data-copy]{
  margin-left:auto !important;
  flex:0 0 auto !important;
}