/* ============================================================
   BYTE AKADEMİ — Mühendislik Hesap Araçları (araclar.php + araclar.js)
   Ana tema değişkenlerini (main.css) kullanır; önek: ar-
   ============================================================ */

.ar-page { padding-bottom: clamp(60px, 8vw, 110px); }

/* ---------- Üst bölüm ---------- */
.ar-hero { position: relative; overflow: hidden; }
.ar-hero .container { position: relative; z-index: 1; }
.ar-hero .hero-sub { max-width: 680px; margin-top: 14px; color: var(--ink-dim); }
.ar-hero .eyebrow { margin-bottom: 18px; }
.ar-hero-wave {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%;
  opacity: .5; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}
.ar-hero-wave path { fill: none; stroke: var(--phosphor); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.ar-hero-wave .w1 { opacity: .55; stroke-dasharray: 6 5; animation: ar-wave 14s linear infinite; }
.ar-hero-wave .w2 { opacity: .22; stroke: var(--copper-bright); animation: ar-wave 22s linear infinite reverse; stroke-dasharray: 3 7; }
@keyframes ar-wave { to { stroke-dashoffset: -400; } }

/* ---------- Vitrin kartları ---------- */
.ar-grid {
  list-style: none; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  margin-top: clamp(10px, 2vw, 24px);
}
.ar-card { display: block; height: 100%; }
.ar-card .core {
  display: flex; flex-direction: column; gap: 12px; height: 100%;
  padding: clamp(20px, 2.4vw, 28px); min-height: 230px;
}
.ar-card-ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  border: 1px solid var(--hairline-2); background: var(--phosphor-faint); color: var(--phosphor);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), background-color .5s var(--ease), color .5s var(--ease);
}
.ar-card-ic svg { width: 26px; height: 26px; }
.ar-card-t { font-size: 1.28rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.ar-card-d { color: var(--ink-dim); font-size: .95rem; line-height: 1.55; flex: 1; }
.ar-card-go {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint);
  transition: color .3s;
}
.ar-card-go svg { width: 12px; height: 12px; transition: transform .4s var(--ease); }
.ar-card:hover { border-color: rgba(0, 255, 163, .35); }
.ar-card:hover .ar-card-ic { background: var(--phosphor); color: #04120C; transform: rotate(-6deg) scale(1.06); box-shadow: 0 0 28px var(--phosphor-soft); }
.ar-card:hover .ar-card-go { color: var(--phosphor); }
.ar-card:hover .ar-card-go svg { transform: translate(2px, -2px); }
.ar-card:focus-visible { outline-offset: 4px; }

.ar-note {
  margin-top: 28px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; line-height: 1.7;
  color: var(--ink-faint); max-width: 720px;
}
.ar-note::before { content: "// "; color: var(--copper); }

/* ---------- Araç sayfası düzeni ---------- */
.ar-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.ar-nav { position: sticky; top: calc(var(--header-h) + 20px); }
.ar-nav-t { font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; color: var(--copper); margin-bottom: 12px; }
.ar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid transparent; color: var(--ink-dim); font-size: .95rem;
  transition: color .25s, background-color .25s, border-color .25s;
}
.ar-nav-ic { width: 20px; height: 20px; flex: none; color: var(--ink-faint); transition: color .25s; }
.ar-nav-ic svg { width: 20px; height: 20px; display: block; }
.ar-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .03); }
.ar-nav a:hover .ar-nav-ic { color: var(--phosphor); }
.ar-nav a[aria-current="page"] { color: var(--phosphor); background: var(--phosphor-faint); border-color: rgba(0, 255, 163, .28); }
.ar-nav a[aria-current="page"] .ar-nav-ic { color: var(--phosphor); }

/* ---------- Araç gövdesi ---------- */
.ar-tool { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.ar-panel .core { padding: clamp(18px, 2.4vw, 28px); }
.ar-h {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.ar-h::before { content: ""; width: 14px; height: 1px; background: var(--copper); }

.ar-form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.ar-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ar-f.wide { grid-column: 1 / -1; }
.ar-f > label, .ar-f > .ar-lab {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-dim);
  display: flex; justify-content: space-between; gap: 8px;
}
.ar-f > label small, .ar-lab small { color: var(--ink-faint); letter-spacing: .04em; }
.ar-inp { position: relative; }
.ar-inp input, .ar-f select {
  width: 100%; height: 48px; padding: 0 52px 0 14px; border-radius: 10px;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--hairline-2); color: var(--ink);
  font-family: var(--font-mono); font-size: 1.05rem; font-variant-numeric: tabular-nums;
  transition: border-color .25s, background-color .25s, box-shadow .25s;
  -webkit-appearance: none; appearance: none;
}
.ar-f select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%2300FFA3' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
}
.ar-f select option { background: #0D0F16; color: var(--ink); }
.ar-inp input:hover, .ar-f select:hover { border-color: rgba(255, 255, 255, .22); }
.ar-inp input:focus, .ar-f select:focus { outline: none; border-color: var(--phosphor); box-shadow: 0 0 0 3px var(--phosphor-faint); }
.ar-inp input:focus-visible, .ar-f select:focus-visible { outline: none; }
.ar-inp input[aria-invalid="true"] { border-color: #FF6B6B; box-shadow: 0 0 0 3px rgba(255, 107, 107, .14); }
.ar-inp input.is-calc { background: var(--phosphor-faint); border-color: rgba(0, 255, 163, .3); color: var(--phosphor); }
.ar-u {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font-family: var(--font-mono); font-size: .85rem; color: var(--ink-faint);
}
.ar-inp input.is-calc + .ar-u { color: var(--phosphor); }
.ar-hint { font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.ar-err { color: #FF8A8A; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }

.ar-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-seg button {
  padding: 9px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--hairline-2);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-dim);
  background: rgba(255, 255, 255, .02); transition: all .25s;
}
.ar-seg button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.ar-seg button[aria-pressed="true"] { color: #04120C; background: var(--phosphor); border-color: var(--phosphor); font-weight: 600; }

.ar-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.ar-actions .btn { font-size: 11px; padding: 5px 6px 5px 16px; }
.ar-actions .btn .btn-orb { width: 28px; height: 28px; }
.ar-toast { font-family: var(--font-mono); font-size: 12px; color: var(--phosphor); opacity: 0; transition: opacity .3s; }
.ar-toast.on { opacity: 1; }

/* ---------- Sonuçlar ---------- */
.ar-res { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.ar-r { border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 18px; background: rgba(255, 255, 255, .02); min-width: 0; }
.ar-r.main { grid-column: 1 / -1; background: linear-gradient(135deg, var(--phosphor-faint), rgba(255, 255, 255, .015)); border-color: rgba(0, 255, 163, .22); }
.ar-r-l { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.ar-r-v { font-family: var(--font-mono); font-size: clamp(1.55rem, 3.4vw, 2.2rem); font-weight: 600; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ar-r.main .ar-r-v { font-size: clamp(2.1rem, 5.2vw, 3.4rem); color: var(--phosphor); text-shadow: 0 0 26px var(--phosphor-soft); }
.ar-r-v small { font-size: .5em; font-weight: 500; color: var(--ink-dim); margin-left: 6px; letter-spacing: .02em; text-shadow: none; }
.ar-r-s { margin-top: 6px; font-size: 13px; color: var(--ink-dim); line-height: 1.5; }
.ar-r.ok .ar-r-v { color: #4ADE80; }
.ar-r.warn .ar-r-v { color: var(--copper-bright); }
.ar-r.bad .ar-r-v { color: #FF6B6B; }
.ar-r.ok { border-color: rgba(74, 222, 128, .3); }
.ar-r.warn { border-color: rgba(245, 158, 11, .35); }
.ar-r.bad { border-color: rgba(255, 107, 107, .4); }
.ar-r.main.ok .ar-r-v { text-shadow: 0 0 26px rgba(74, 222, 128, .4); }
.ar-r.main.warn .ar-r-v { text-shadow: 0 0 26px rgba(245, 158, 11, .4); }
.ar-r.main.bad .ar-r-v { text-shadow: 0 0 26px rgba(255, 107, 107, .4); }

.ar-banner { margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.55; border: 1px solid var(--hairline-2); background: rgba(255, 255, 255, .03); color: var(--ink-dim); }
.ar-banner b { color: var(--ink); }
.ar-banner.ok { border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .07); }
.ar-banner.warn { border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .08); }
.ar-banner.bad { border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .08); }

.ar-formula { margin-top: 18px; padding: 16px 18px; border-radius: 12px; border: 1px dashed var(--hairline-2); background: rgba(0, 0, 0, .25); }
.ar-formula .ar-h { margin-bottom: 10px; }
.ar-formula code, .ar-formula pre {
  display: block; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.85; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.ar-formula code i { color: var(--phosphor); font-style: normal; }
.ar-formula p { margin-top: 8px; font-size: 13px; color: var(--ink-dim); line-height: 1.6; }

/* ---------- Tablolar ---------- */
.ar-tbl-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--hairline); border-radius: 12px; }
.ar-tbl { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.ar-tbl th, .ar-tbl td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.ar-tbl th:first-child, .ar-tbl td:first-child { text-align: left; }
.ar-tbl th { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; background: rgba(255, 255, 255, .02); }
.ar-tbl tr:last-child td { border-bottom: 0; }
.ar-tbl td.ok { color: #4ADE80; }
.ar-tbl td.bad { color: #FF8A8A; }
.ar-tbl td.dim { color: var(--ink-faint); }
.ar-tbl tr.pick td { background: var(--phosphor-faint); color: var(--phosphor); font-weight: 600; }
.ar-tbl tr.cur td:first-child::after { content: " ◀"; color: var(--copper-bright); }

/* ---------- SVG görselleri ---------- */
.ar-vis { margin-bottom: 18px; border-radius: 12px; border: 1px solid var(--hairline); background:
  linear-gradient(var(--hairline) 1px, transparent 1px) 0 0 / 100% 24px,
  linear-gradient(90deg, var(--hairline) 1px, transparent 1px) 0 0 / 24px 100%,
  #07080C; padding: 8px; }
.ar-vis svg { display: block; width: 100%; height: auto; }
.ar-vis text { font-family: var(--font-mono); fill: var(--ink-dim); }
.ar-vis .wire { stroke: #5F6575; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ar-vis .dot { fill: var(--phosphor); filter: drop-shadow(0 0 5px var(--phosphor)); }
.ar-vis .lbl-big { font-size: 15px; fill: var(--ink); font-weight: 600; }
.ar-vis .lbl-acc { font-size: 15px; fill: var(--phosphor); font-weight: 600; }
.ar-vis .lbl-cu { font-size: 15px; fill: var(--copper-bright); font-weight: 600; }

/* Direnç renk kodu */
.ar-res-svg { cursor: default; }
.ar-band { cursor: pointer; outline: none; }
.ar-band rect.hit { fill: transparent; }
.ar-band.act .ring { stroke: var(--phosphor); opacity: 1; }
.ar-band .ring { fill: none; stroke: var(--phosphor); stroke-width: 2; stroke-dasharray: 4 3; opacity: 0; transition: opacity .2s; }
.ar-band:focus-visible .ring, .ar-band:hover .ring { opacity: 1; }
.ar-pal { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ar-sw {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--hairline-2); position: relative;
  transition: transform .2s var(--ease), border-color .2s;
}
.ar-sw:hover { transform: scale(1.1); }
.ar-sw[aria-pressed="true"] { border-color: var(--phosphor); box-shadow: 0 0 0 3px var(--phosphor-faint), 0 0 18px var(--phosphor-soft); }
.ar-sw span { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 9px; color: var(--ink-faint); white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
.ar-sw:hover span, .ar-sw:focus-visible span { opacity: 1; }
.ar-pal-wrap { margin-bottom: 20px; }

/* ---------- Duyarlı ---------- */
@media (min-width: 1260px) {
  .ar-tool.two { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 900px) {
  .ar-wrap { grid-template-columns: minmax(0, 1fr); }
  .ar-nav { position: static; margin: 0 calc(-1 * clamp(16px, 3vw, 32px)); }
  .ar-nav-t { display: none; }
  .ar-nav ul { flex-direction: row; overflow-x: auto; gap: 8px; padding: 2px clamp(16px, 3vw, 32px) 10px; scrollbar-width: thin; }
  .ar-nav a { white-space: nowrap; border-color: var(--hairline-2); padding: 9px 14px; }
}
@media (max-width: 520px) {
  .ar-form { grid-template-columns: minmax(0, 1fr); }
  .ar-res { grid-template-columns: minmax(0, 1fr); }
  .ar-tbl th, .ar-tbl td { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ar-hero-wave path { animation: none; }
  .ar-card-ic, .ar-card-go svg { transition: none; }
}

/* ---------- Ek ---------- */
.ar-page [hidden] { display: none !important; }
.ar-r.hl .ar-r-v { color: var(--phosphor); }
.ar-r.hl { border-color: rgba(0, 255, 163, .25); }
.ar-visbox:not(:empty) { margin-bottom: 4px; }
.ar-out + .ar-formula { margin-top: 18px; }
.ar-out .ar-banner a { color: var(--phosphor); border-bottom: 1px solid var(--phosphor-soft); }
.ar-vis[data-static] { padding: 8px 8px 4px; }
