/* UO Script Analyzer - Minimal & temiz */
:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121a;
  --text:#e6edf3;
  --muted:#97a6b5;
  --border:rgba(255,255,255,.08);
  --accent:#74B13B;
  --warn:#f0b429;
  --bad:#ff5a5f;
  --ok:#2bd576;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(116,177,59,.14), transparent 55%),
              radial-gradient(900px 600px at 100% 40%, rgba(87,120,220,.12), transparent 50%),
              var(--bg);
  color:var(--text);
  font-family:var(--sans);
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  position:sticky; top:0;
  backdrop-filter: blur(10px);
  background: rgba(11,15,20,.7);
  z-index:5;
}
.brand{display:flex; gap:12px; align-items:center;}
.logo{
  width:44px;height:44px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(116,177,59,.25), rgba(116,177,59,.06));
  border:1px solid rgba(116,177,59,.35);
  font-weight:800;
}
.title{font-size:16px;font-weight:800;letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted);margin-top:2px}

.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.btn{
  background: rgba(255,255,255,.06);
  color:var(--text);
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  transition: .15s transform, .15s background, .15s border;
  user-select:none;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14);}
.btn:active{transform: translateY(0px);}
.btn.ghost{background: transparent;}
.btn input{display:none}

.layout{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:14px;
  padding:14px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 980px){
  .layout{grid-template-columns: 1fr; }
}

.panel{
  background: rgba(15,22,32,.62);
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.28);
}
.panel-head{
  padding:14px 14px 10px 14px;
  border-bottom:1px solid var(--border);
  background: rgba(12,18,26,.65);
}
.panel-title{font-weight:900}
.panel-hint{font-size:12px;color:var(--muted); margin-top:4px}

.dropzone{
  padding:12px;
  position:relative;
}
.dropzone.dragover{
  outline:2px dashed rgba(116,177,59,.65);
  outline-offset: -8px;
}
.drop-hint{
  position:absolute;
  inset: 12px;
  display:none;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background: rgba(11,15,20,.72);
  border: 1px dashed rgba(255,255,255,.14);
  color: var(--muted);
  font-weight:700;
  pointer-events:none;
}
.dropzone.dragover .drop-hint{display:flex;}

.editor{
  width:100%;
  height: 62vh;
  min-height: 420px;
  display:grid;
  grid-template-columns: 70px 1fr;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background: rgba(10,14,20,.65);
}
.gutter{
  margin:0;
  padding:12px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 18px;
  color: rgba(151,166,181,.8);
  background: rgba(255,255,255,.03);
  border-right:1px solid var(--border);
  overflow:hidden;
  user-select:none;
  text-align:right;
}
#scriptInput{
  width:100%;
  height:100%;
  margin:0;
  padding:12px 12px;
  border:0;
  outline:0;
  resize:none;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 18px;
  color: var(--text);
  background: transparent;
  caret-color: var(--accent);
  tab-size: 2;
}

.smallrow{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px;
  border-top:1px solid var(--border);
  background: rgba(12,18,26,.45);
  gap:10px;
  flex-wrap:wrap;
}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  font-size:12px;
  font-weight:800;
}
.chip.ghost{background: transparent; color: var(--muted)}

.cards{padding:12px; display:flex; flex-direction:column; gap:12px;}
.card{
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(10,14,20,.55);
  padding:12px;
}
.card-title{font-weight:900; margin-bottom:8px}
.muted{color:var(--muted); font-size:12px; margin-bottom:10px}

.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px 12px;
  font-size:13px;
}
.kv .k{color:var(--muted); font-weight:800;}
.kv .v{font-weight:900}

.issues{display:flex; flex-direction:column; gap:8px}
.issue{
  border:1px solid var(--border);
  border-left:4px solid var(--warn);
  border-radius:12px;
  padding:10px 10px;
  background: rgba(255,255,255,.03);
  cursor:pointer;
}
.issue.bad{border-left-color: var(--bad);}
.issue.ok{border-left-color: var(--ok);}
.issue .head{display:flex; justify-content:space-between; gap:10px; align-items:baseline}
.issue .msg{font-weight:900}
.issue .meta{color:var(--muted); font-size:12px; font-weight:800}

.details{
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(255,255,255,.03);
  padding:8px 10px;
  margin-bottom:8px;
}
.details summary{
  cursor:pointer;
  font-weight:900;
  list-style:none;
}
.details summary::-webkit-details-marker{display:none}
.details .inside{margin-top:8px; color:var(--muted); font-size:12px}
.badge{
  display:inline-block;
  padding:2px 8px;
  border:1px solid var(--border);
  border-radius:999px;
  margin-left:8px;
  font-size:12px;
  color: var(--muted);
}
.list{
  margin:8px 0 0 0;
  padding:0 0 0 16px;
}
.list li{margin:4px 0; font-family: var(--mono); color: var(--text); font-size:12.5px;}

.codeview{
  border:1px solid var(--border);
  border-radius:12px;
  overflow:auto;
  max-height: 340px;
  background: rgba(0,0,0,.25);
}
.code-line{
  display:grid;
  grid-template-columns: 70px 1fr;
  gap:0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 18px;
}
.code-line .ln{
  padding:2px 10px 2px 10px;
  text-align:right;
  color: rgba(151,166,181,.85);
  background: rgba(255,255,255,.03);
  border-right:1px solid var(--border);
  user-select:none;
}
.code-line .tx{
  padding:2px 10px 2px 10px;
  white-space:pre;
}
.code-line.bad .ln, .code-line.bad .tx{
  background: rgba(255,90,95,.12);
}
.code-line.warn .ln, .code-line.warn .tx{
  background: rgba(240,180,41,.10);
}

.fixrow{display:flex; gap:10px; flex-wrap:wrap; margin:10px 0;}
.fixprompt{
  width:100%;
  min-height: 160px;
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 18px;
  padding:10px;
}

.footer{
  padding:14px 18px;
  color: var(--muted);
  border-top:1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}
code{font-family: var(--mono);}


/* Header logo image */
.logo img{width:28px;height:28px;object-fit:contain;display:block;}

/* Clickable accordion items */
.list li.jump{cursor:pointer;}
.list li.jump:hover{filter:brightness(1.15);}

/* Updated header logo (user requested) */
.logo{
  width:48px;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.logo img{
  width:100%;
  height:100%;
  object-fit:contain;
}

/* Export UI */
.exportbar{
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(12,18,26,.35);
}
.exportgrid{
  display:grid;
  grid-template-columns: 1fr 140px 1fr 110px;
  gap:10px;
  align-items:end;
}
@media (max-width: 980px){
  .exportgrid{grid-template-columns: 1fr 140px; }
}
.field{display:flex; flex-direction:column; gap:6px;}
.field span{font-size:12px; color: var(--muted); font-weight:800;}
.field input, .field select{
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
  font-weight:800;
}
.check{
  display:flex; gap:8px; align-items:center;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(255,255,255,.02);
  height: 42px;
}
.check span{font-size:12px; color: var(--muted); font-weight:800;}
.check input{accent-color: var(--accent);}

.muted.tiny{font-size:12px; margin-top:8px;}


/* Mobile & tablet tweaks */
@media (max-width: 820px){
  .topbar{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .brand{justify-content:flex-start;}
  .actions{
    justify-content:flex-start;
  }
  .layout{padding:10px;}
  .editor{
    height: 54vh;
    min-height: 360px;
    grid-template-columns: 62px 1fr;
  }
  .gutter{font-size:12px; padding:10px 8px; }
  #scriptInput{font-size:12px; padding:10px 10px;}
  .kv{grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .topbar{padding:12px;}
  .actions{gap:8px;}
  .btn{width:100%; justify-content:center; text-align:center;}
  .actions .btn{width:auto;} /* label/button in header */
  .layout{grid-template-columns: 1fr; gap:10px; padding:10px;}
  .panel-head{padding:12px;}
  .editor{
    height: 50vh;
    min-height: 320px;
    grid-template-columns: 56px 1fr;
  }
  .gutter{padding:10px 6px;}
  .smallrow{flex-direction:column; align-items:stretch;}
  .chips{width:100%;}
  .small-actions{display:flex; gap:8px; width:100%;}
  .small-actions .btn{flex:1;}
  .exportgrid{
    grid-template-columns: 1fr;
    align-items:stretch;
  }
  .check{height:auto;}
  .codeview{max-height: 260px;}
  .footer{padding:12px;}
}

@media (max-width: 560px){ .topbar .actions .btn{width:auto;} }


/* Editor action bar */
.editor-actions{
  display:flex;
  gap:10px;
  margin:10px 0;
  flex-wrap:wrap;
}
.editor-actions .btn{
  flex:1;
  text-align:center;
}

@media (max-width: 560px){
  .editor-actions{
    flex-direction:column;
  }
}

/* Inline field (version selector) */
.field.inline{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width: 180px;
  flex: 0 0 auto;
}
.editor-actions .field.inline{
  padding: 0;
  border: 0;
  background: transparent;
}


/* Dosya Aç butonu – input gizli, buton düzgün */
.file-btn{
  position: relative;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.file-btn input[type="file"]{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
