/* TimeScope - Minimal, RTL friendly */
:root{
  --bg:#0b0e14;
  --card:#111626;
  --muted:#9aa4b2;
  --text:#e6edf3;
  --primary:#6d5efc;
  --secondary:#26304a;
  --border:#26304a;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(109,94,252,.35), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(0,180,255,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}

a{color:inherit}
.hidden{display:none !important}
.muted{color:var(--muted)}
.sep{margin:0 .4rem}
.pill{
  display:inline-block;
  padding:.15rem .55rem;
  border:1px solid var(--border);
  border-radius:999px;
  font-size:.85rem;
  color:var(--muted);
}

.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  backdrop-filter: blur(10px);
  background: rgba(11,14,20,.55);
  border-bottom:1px solid rgba(38,48,74,.55);
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:14px;
  background: rgba(109,94,252,.2);
  border:1px solid rgba(109,94,252,.35);
}
.title{font-weight:800; letter-spacing:.3px}
.subtitle{font-size:.9rem; color:var(--muted)}

.container{max-width:980px; margin:24px auto; padding:0 14px 60px}

.view{display:none}
.view.active{display:block}

.card{
  background: rgba(17,22,38,.86);
  border:1px solid rgba(38,48,74,.75);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding:18px;
  margin-bottom:14px;
}

.card.small{padding:12px}

h2,h3{margin:0 0 10px}
p{margin:8px 0 0; line-height:1.65}

.divider{
  height:1px;
  background: rgba(38,48,74,.85);
  margin:16px 0;
}

.grid3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.grid2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}

@media (max-width:720px){
  .grid3{grid-template-columns:1fr; }
  .grid2{grid-template-columns:1fr; }
  .subtitle{display:none}
}

.btn{
  border:1px solid var(--border);
  border-radius: 16px;
  padding:12px 12px;
  background: rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  transition: transform .05s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{background: rgba(255,255,255,.06)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: rgba(109,94,252,.22);
  border-color: rgba(109,94,252,.55);
}
.btn.secondary{
  background: rgba(38,48,74,.55);
}
.btn.pick{text-align:right}
.btnTop{font-weight:800}
.btnVal{margin-top:6px; font-size:.92rem; color:var(--muted)}

.ghost{
  border:1px solid rgba(38,48,74,.9);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:9px 12px;
  border-radius: 14px;
  cursor:pointer;
}
.ghost:hover{background: rgba(255,255,255,.06)}

.chipsTitle{font-weight:800; margin-bottom:8px}
.chipRow{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  border:1px solid rgba(38,48,74,.9);
  background: rgba(255,255,255,.03);
  padding:7px 10px;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted);
  font-size:.9rem;
}
.chip:hover{color:var(--text); border-color: rgba(109,94,252,.45)}

.resultsHeader{
  display:flex; align-items:center; gap:10px;
  padding:6px 4px 12px;
}
.resultsTitle{font-weight:900; font-size:1.2rem}
.resultsSub{color:var(--muted); font-size:.92rem}
.spacer{flex:1}

.tabs{
  display:flex; gap:8px; flex-wrap:wrap;
  margin:10px 0 10px;
}
.tab{
  border:1px solid rgba(38,48,74,.9);
  background: rgba(255,255,255,.03);
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted);
}
.tab.active{
  color:var(--text);
  border-color: rgba(109,94,252,.55);
  background: rgba(109,94,252,.18);
}

.status{
  color:var(--muted);
  margin:8px 0 12px;
  min-height: 22px;
}

.list{display:flex; flex-direction:column; gap:10px}

.item{
  border:1px solid rgba(38,48,74,.8);
  background: rgba(255,255,255,.02);
  border-radius: var(--radius);
  padding:14px;
}
.itemTop{
  display:flex; align-items:flex-start; gap:10px;
}
.itemTitle{font-weight:900; margin:0}
.itemMeta{margin-top:4px; color:var(--muted); font-size:.92rem}
.itemSummary{margin-top:10px; color:#cfd7e1; line-height:1.65}
.itemTags{margin-top:10px; display:flex; flex-wrap:wrap; gap:8px}
.tag{
  font-size:.85rem;
  padding:4px 9px;
  border-radius:999px;
  border:1px solid rgba(38,48,74,.9);
  color:var(--muted);
  background: rgba(255,255,255,.02);
}
.itemActions{margin-top:12px; display:flex; gap:10px; flex-wrap:wrap}
.link{
  text-decoration:none;
  color:var(--muted);
  border:1px solid rgba(38,48,74,.9);
  padding:7px 10px;
  border-radius: 12px;
}
.link:hover{color:var(--text); border-color: rgba(109,94,252,.45)}
.smallBtn{
  border:1px solid rgba(109,94,252,.55);
  background: rgba(109,94,252,.16);
  padding:7px 10px;
  border-radius: 12px;
  cursor:pointer;
  color:var(--text);
}

.suggestions{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.sugBtn{
  text-align:right;
  border:1px dashed rgba(38,48,74,.9);
  background: rgba(255,255,255,.02);
  color:var(--muted);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
}
.sugBtn:hover{color:var(--text); border-color: rgba(109,94,252,.45)}

.overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  z-index:50;
}
.modal{
  position:fixed;
  z-index:60;
  inset: 7% 50% auto 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 22px));
  max-height: 86vh;
  overflow:auto;
  background: rgba(17,22,38,.95);
  border:1px solid rgba(38,48,74,.85);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.modalHeader{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px 10px;
  border-bottom:1px solid rgba(38,48,74,.65);
}
.modalTitle{font-weight:900}
.modalBody{padding:14px}

.segmented{display:flex; gap:8px; padding:10px 14px 0; flex-wrap:wrap}
.seg{
  border:1px solid rgba(38,48,74,.9);
  background: rgba(255,255,255,.02);
  padding:7px 10px;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted);
}
.seg.active{color:var(--text); border-color: rgba(109,94,252,.55); background: rgba(109,94,252,.18)}

.formRow{display:flex; flex-direction:column; gap:6px; margin:10px 0}
label{color:var(--muted); font-size:.92rem}
input.search, input[type="number"], input[type="search"]{
  border:1px solid rgba(38,48,74,.9);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding:10px 12px;
  color:var(--text);
  outline:none;
}
input:focus{border-color: rgba(109,94,252,.6)}

.modalActions{display:flex; gap:10px; margin-top:12px}
.hint{margin-top:10px}

.pickerList{display:flex; flex-direction:column; gap:8px; margin-top:12px}
.pickerItem{
  border:1px solid rgba(38,48,74,.9);
  background: rgba(255,255,255,.02);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
}
.pickerItem:hover{border-color: rgba(109,94,252,.45); background: rgba(255,255,255,.04)}
.pickerMain{font-weight:900}
.pickerSub{color:var(--muted); font-size:.9rem; margin-top:4px}

.bullets{margin:10px 0 0; color:#cfd7e1}
.bullets li{margin:6px 0}

.detailMeta{color:var(--muted); margin-bottom:10px}
.detailSummary{color:#cfd7e1; line-height:1.75}
.detailLinks{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px}
.detailImageWrap{margin:10px 0 6px}
.detailImageWrap img{
  width:100%;
  border-radius: 16px;
  border:1px solid rgba(38,48,74,.8);
}
