/* /var/www/currency-app/style.css */
:root{
  --blue1:#4b3cff;
  --blue2:#20106b;

  --bg:#ffffff;
  --surface:#ffffff;
  --surface2:#f6f8fc;

  --text:#0b1220;
  --text2:#58637a;
  --muted:#58637a;

  --stroke:#e8ecf4;
  --shadow: 0 18px 50px rgba(10,30,80,.20);

  --good: #22c55e;
  --bad:  #ef4444;
  --warn: #f59e0b;

  --accent:#4f46e5;
  --accentGlow: rgba(79,70,229,.18);
}

body.dark{
  --bg: #0b0d18;

  --surface: #12152a;
  --surface2: #181c38;

  --text: #eef0ff;
  --text2: rgba(238,240,255,.75);
  --muted: rgba(238,240,255,.60);

  --stroke: rgba(255,255,255,.12);
  --shadow: 0 18px 50px rgba(0,0,0,.65);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: var(--bg);
}

.hero{
  position:relative;
  padding:72px 16px 0;
  background: radial-gradient(1200px 700px at 30% 10%, rgba(255,255,255,.18), transparent 60%),
              linear-gradient(180deg, var(--blue1), var(--blue2));
  color:#fff;
  overflow:hidden;
}

.hero-inner{position:relative; max-width:980px; margin:0 auto; text-align:center}
.hero h1{margin:0; font-size:42px; font-weight:800; letter-spacing:-.02em}
.hero p{margin:10px 0 0; opacity:.92}

.wave{
  height: 240px;
  margin-top: -120px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.wave::before{
  content:"";
  position:absolute;
  left:50%;
  top:0;
  transform: translateX(-50%);
  width: 140vw;
  height: 240px;
  background: var(--bg);
  border-top-left-radius: 100% 200px;
  border-top-right-radius: 100% 200px;
}

.card{
  background:var(--surface);
  border:1px solid var(--stroke);
  border-radius:16px;
  box-shadow: var(--shadow);
}

.converter{
  margin:28px auto 0;
  padding:22px;
  text-align:left;
  color:var(--text);
  max-width:820px;
  position:relative;
  z-index:5;
}

.converter-grid{
  display:grid;
  grid-template-columns: 1fr 70px 1fr;
  gap:18px;
  align-items:end;
}

.col .label{
  font-weight:600;
  color:var(--muted);
  font-size:13px;
  margin-bottom:8px;
}

.fieldBox{
  border:1px solid var(--stroke);
  background: var(--surface);
  border-radius:12px;
  padding:14px 14px 12px;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.fieldBox:hover{
  border-color: rgba(47,43,214,.55);
  box-shadow: 0 0 0 3px var(--accentGlow);
}
.fieldBox:focus-within{
  border-color: rgba(47,43,214,.90);
  box-shadow: 0 0 0 4px rgba(47,43,214,.22);
}

.big{
  width:100%;
  border:none;
  border-bottom:2px solid var(--stroke);
  padding:8px 2px 12px;
  font-size:34px;
  font-weight:800;
  outline:none;
  background:transparent;
  color: var(--text);
}
.big.readonly{ color: var(--text); }

.selectWrap{position:relative; margin-top:12px}
.selectBtn{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:10px;
  border:1px solid var(--stroke);
  background:var(--surface2);
  cursor:pointer;
  font-weight:700;
  color: var(--text);
}

/* to tarafı mor olmasın dedin -> primary'yi normalleştiriyorum */
.selectBtn.primary{
  background: var(--surface2);
  border:1px solid var(--stroke);
  color: var(--text);
  box-shadow:none;
}

.chev{opacity:.8}

.swapWrap{
  display:flex;
  align-items:center;
  justify-content:center;
  padding-bottom:40px;
}
.swap{
  width:52px;
  height:52px;
  border-radius:999px;
  background: var(--surface);
  color: var(--text);
  border:1px solid var(--stroke);
  font-size:20px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.swap:hover{
  transform: translateY(-3px);
  background: linear-gradient(180deg, #5b5bd6, #3b2fc4);
  color:#fff;
  box-shadow:
    0 10px 25px rgba(79,70,229,.45),
    0 0 0 6px rgba(79,70,229,.15);
}
.swap:active{
  transform: translateY(-1px) scale(.96);
  box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.swap.spin{ animation: swapSpin .35s ease; }
@keyframes swapSpin{
  0%   { transform: rotate(0deg) scale(1); }
  40%  { transform: rotate(90deg) scale(0.96); }
  100% { transform: rotate(180deg) scale(1); }
}

.row2{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:10px;
}

.meta{
  display:flex;
  align-items:center;
  gap:10px;
  color: var(--muted);
  font-size:13px;
}
.dot{
  width:10px;height:10px;border-radius:50%;
  background:rgba(0,0,0,.2);
  box-shadow:0 0 0 4px rgba(0,0,0,.06);
}
.pipe{opacity:.5}
.metaLabel{opacity:.8}

.date{
  border:1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  padding:8px 10px;
  border-radius:10px;
}

.cta{
  padding:14px 22px;
  border-radius:999px;
  border:0;
  cursor:pointer;
  font-weight:800;
  color:#fff;
  background: linear-gradient(180deg, #5b5bd6, #2f2aa8);
  box-shadow: 0 16px 30px rgba(35, 32, 110, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.cta:hover{
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(35, 32, 110, .45);
  filter: brightness(1.03);
}
.cta:active{
  transform: translateY(-1px) scale(.98);
  box-shadow: 0 14px 26px rgba(35, 32, 110, .35);
}
.cta:disabled{ opacity:.55; cursor:not-allowed; }

.menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0; right:0;
  border:1px solid var(--stroke);
  background: var(--surface);
  border-radius:12px;
  box-shadow: 0 18px 50px rgba(10,30,80,.18);
  opacity:0;
  transform: translateY(-6px);
  pointer-events:none;
  transition:.18s ease;
  z-index:50;
  overflow:hidden;
}
.selectWrap.open .menu{ opacity:1; transform: translateY(0); pointer-events:auto; }

.menuSearch{
  width:100%;
  padding:10px 12px;
  border:0;
  border-bottom:1px solid var(--stroke);
  outline:none;
  font-size:13px;
  background: var(--surface);
  color: var(--text);
}
.menuList{
  max-height: 240px;
  overflow-y:auto;
  overscroll-behavior:contain;
}

.item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  cursor:pointer;
  font-size:13px;
  transition: background .15s ease;
  color: var(--text);
}
.item:hover{ background: rgba(99,102,241,.12); }
.code{font-weight:800}
.name{color:var(--muted)}

.resultBox{
  margin-top:16px;
  border-top:1px solid var(--stroke);
  padding-top:14px;
}
.raw{
  opacity:.95;
  margin-top:14px;
  padding:14px;
  border-radius:14px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size:12px;
  line-height:1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 12px 30px rgba(25,18,90,.12);
  overflow-x:auto;
}
.hidden{display:none !important}

/* section */
.main{
  background: var(--bg);
  padding: 88px 16px 44px;
}
.section{
  max-width: 920px;
  margin: 0 auto;
}
.section h2{ margin:0; font-size:44px; letter-spacing:-.03em; color: var(--text); }
.sub{ margin:10px 0 0; color:var(--muted); }

.table{
  margin-top:18px;
  padding:14px;
  border-radius:18px;
  background: var(--surface);
  border: 1px solid rgba(99,102,241,.12);
  box-shadow: 0 18px 50px rgba(25,18,90,.12);
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

/* --------- TABLO HİZALAMA (asıl fix) --------- */
/* header + row aynı grid, aynı padding, aynı alignment */
.tableHead,
.tableBody .row{
  display:grid;
  grid-template-columns:
    minmax(170px, 1.25fr)  /* pair */
    minmax(120px, 0.85fr)  /* rate */
    minmax(140px, 0.85fr)  /* date */
    minmax(90px,  0.55fr); /* source */
  align-items:center;
  column-gap: 0px;
  padding: 12px 14px;
}

/* header görünümü */
.tableHead{
  color:var(--text2);
  font-weight:700;
  font-size:13px;
  background: rgba(99,102,241,.10);
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(99,102,241,.10);
}

/* satır görünümü */
.tableBody .row{
  border-bottom:1px solid var(--stroke);
  font-size:13px;
  border-radius: 12px;
  transition: background .15s ease, transform .15s ease;
  color: var(--text);
}
.tableBody .row:nth-child(even){ background: rgba(99,102,241,.03); }
.tableBody .row:hover{
  background: rgba(99,102,241,.08);
  transform: translateY(-1px);
}

/* taşma kontrol */
.tableHead > div,
.tableBody .row > div{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* pair biraz daha tok */
.tableBody .row > div:first-child{
  font-weight:800;
  letter-spacing:-.01em;
}

/* rate + date: SOLA YAKLAŞSIN ve header'ın altına otursun */
.tableHead > div:nth-child(2),
.tableBody .row > div:nth-child(2){
  justify-self: start;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* date de aynı mantık */
.tableHead > div:nth-child(3),
.tableBody .row > div:nth-child(3){
  justify-self: start;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* source header da ortalansın, pill de tam ortada dursun */
.tableHead > div:nth-child(4){
  justify-self: center;
  text-align:center;
}
.tableBody .row > div:nth-child(4){
  justify-self:center;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
  background: rgba(99,102,241,.12);
  color: var(--text);
  width: fit-content;
}
/* --------- TABLO HİZALAMA (fix bitti) --------- */

.tableFoot{
  padding:12px 10px 6px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  gap:10px;
}
.tableFoot a{ color: var(--accent); text-decoration:none }
.tableFoot a:hover{ text-decoration:underline }

/* result ui */
.resultTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.resultTitle{ font-weight:800; font-size:14px; }
.resultMeta{ color: var(--muted); font-size:12px; }
.resultRow{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.pill{
  padding:10px 12px;
  border:1px solid var(--stroke);
  border-radius:12px;
  background: var(--surface2);
  color: var(--text);
  font-size:13px;
}
.cta.ctaBlue{
  padding:10px 14px;
  border-radius:12px;
  background: linear-gradient(180deg, #5b5bd6, #2f2aa8);
  box-shadow: 0 10px 24px rgba(35,32,110,.35);
}

/* smooth theme transition */
body, .card, .fieldBox, .table, .raw, .selectBtn, .date, .menu, .pill, .swap{
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* premium theme switch */
.themeSwitch{
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.themeSwitch-track{
  position: relative;
  width: 72px;
  height: 36px;
  display: inline-block;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.themeSwitch:hover .themeSwitch-track{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.30);
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
}
.themeSwitch:active{ transform: translateY(1px); }

.themeSwitch-icon{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: .92;
  color: rgba(255,255,255,.92);
  font-size: 14px;
}
.themeSwitch-sun{ left: 10px; }
.themeSwitch-moon{ right: 10px; }

.themeSwitch-thumb{
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  transition: left .22s ease, background .2s ease;
}
body.dark .themeSwitch-thumb{ left: 40px; background: rgba(255,255,255,.88); }
body.dark .themeSwitch-track{
  background: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.16);
}
.themeSwitch:focus-visible .themeSwitch-track{
  outline: none;
  box-shadow: 0 0 0 4px rgba(99,102,241,.35), 0 18px 44px rgba(0,0,0,.28);
}

/* responsive */
@media (max-width:860px){
  .converter-grid{ grid-template-columns:1fr; gap:14px; }
  .swapWrap{ padding-bottom:0; margin:12px 0 8px; }
  .swap{ width:62px; height:62px; }
  .row2{ flex-direction:column; align-items:stretch; gap:10px; }
  .cta{ width:100% }
  .section h2{ font-size:34px }
}

/* mobilde ellipsis çok agresif olmasın */
@media (max-width:520px){
  .tableHead,
  .tableBody .row{
    grid-template-columns:
      minmax(120px, 1.2fr)
      minmax(90px, 0.9fr)
      minmax(90px, 0.9fr)
      minmax(70px, 0.6fr);
    padding: 10px 12px;
  }
}
/* ===== MOBILE TABLE FIX (CARD LAYOUT) ===== */
@media (max-width: 520px){

  /* header'ı mobile'da gizle (zaten card gibi göstereceğiz) */
  .tableHead{
    display:none;
  }

  /* her satırı 2 kolon + 2 satır yap */
  .tableBody .row{
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "pair source"
      "rate date";
    row-gap: 10px;
    padding: 14px 12px;
  }

  /* pair */
  .tableBody .row > div:nth-child(1){
    grid-area: pair;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* rate */
  .tableBody .row > div:nth-child(2){
    grid-area: rate;
    text-align: left;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    opacity: .95;
  }

  /* date */
  .tableBody .row > div:nth-child(3){
    grid-area: date;
    text-align: right;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
    opacity: .85;
  }

  /* source pill */
  .tableBody .row > div:nth-child(4){
    grid-area: source;
    justify-self: end;
    padding-left: 0; /* desktop fix varsa sıfırla */
  }
}
