@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&family=Ubuntu+Mono:wght@400;500&display=swap');

:root {
  --o: #3B82F6;
  --a: #0F172A;
  --w: #94A3B8;
  --line: rgba(255,255,255,0.07);
  --row-h: 0.7rem 1.5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Ubuntu', sans-serif !important;
  background: var(--a) !important;
  color: #e8e8e8 !important;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.mir-top {
  background: linear-gradient(135deg, var(--a), #1E3A5F);
  border-bottom: 3px solid var(--o);
  padding: 0.85rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.mir-top-left { display: flex; align-items: center; gap: 0.75rem; }
.mir-top-icon { font-size: 1.4rem; }
.mir-top-title { color: #fff; font-size: 1rem; font-weight: 600; }
.mir-top-sub { color: var(--w); font-size: 0.72rem; margin-top: 1px; }
.mir-top-home {
  color: var(--w); font-size: 0.78rem; text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 5px;
  padding: 0.3rem 0.75rem; transition: all 0.15s;
  white-space: nowrap;
}
.mir-top-home:hover { color: #fff; border-color: var(--o); background: rgba(233,84,32,0.15); }

/* ── BREADCRUMB ── */
.mir-bc {
  background: rgba(0,0,0,0.3);
  padding: 0.45rem 2rem;
  font-size: 0.75rem; color: var(--w);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.mir-bc a { color: #d4956a; text-decoration: none; }
.mir-bc a:hover { color: var(--o); }
.mir-bc-sep { color: rgba(255,255,255,0.2); }

/* ── INFO BAR ── */
.mir-info {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.72rem; color: rgba(255,255,255,0.3);
}

/* ── TABLE ── */
h1 { display: none !important; }

table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-family: 'Ubuntu Mono', monospace !important;
}

/* Hide Apache's colspan separator rows */
tr:has(th[colspan]) { display: none !important; }

/* ── HEADER ROW ── */
th {
  background: rgba(233,84,32,0.1) !important;
  color: rgba(255,255,255,0.4) !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.7px !important;
  border-bottom: 1px solid rgba(233,84,32,0.25) !important;
  padding: var(--row-h) !important;
  vertical-align: middle !important;
}
th:nth-child(1) { width: 52%; text-align: left !important; }
th:nth-child(2) { width: 28%; text-align: left !important; }
th:nth-child(3) { width: 20%; text-align: right !important; padding-right: 2rem !important; }
th a { color: rgba(255,255,255,0.4) !important; text-decoration: none !important; }
th a:hover { color: var(--o) !important; }

/* ── DATA ROWS ── */

/* semua td: padding konsisten, rata vertikal */
td {
  padding: var(--row-h) !important;
  border-bottom: 1px solid var(--line) !important;
  vertical-align: middle !important;
  font-size: 0.83rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kolom 1: Name — let <a> fill full cell for hover */
td:nth-child(1) {
  padding: 0 !important;
  width: 52%;
}
td:nth-child(1) a {
  display: block !important;
  padding: var(--row-h) !important;
  color: #F0C8A8 !important;
  text-decoration: none !important;
  transition: color 0.12s !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Kolom 2: Last Modified */
td:nth-child(2) {
  width: 28%;
  color: rgba(255,255,255,0.4) !important;
  font-size: 0.78rem !important;
  text-align: left !important;
}

/* Kolom 3: Size */
td:nth-child(3) {
  width: 20%;
  text-align: right !important;
  padding-right: 2rem !important;
  color: rgba(255,255,255,0.4) !important;
  font-size: 0.78rem !important;
}

/* Row hover */
tr:hover td { background: rgba(255,255,255,0.03) !important; }
tr:hover td:nth-child(1) a { color: #fff !important; }
tr:hover td:nth-child(2),
tr:hover td:nth-child(3) { color: rgba(255,255,255,0.65) !important; }

/* Parent directory */
tr:has(a[href="../"]) td:nth-child(1) a { color: rgba(255,255,255,0.28) !important; font-size: 0.78rem !important; }

/* ── FILE TYPE COLORS ── */

/* Folder */
tr:has(a[href$="/"]):not(:has(a[href="../"])) td:nth-child(1) a {
  color: #7EC8E3 !important; font-weight: 500 !important;
}
tr:has(a[href$="/"]):not(:has(a[href="../"])) td:nth-child(1) a::before { content: '📁  '; }
tr:has(a[href$="/"]):not(:has(a[href="../"])):hover td { background: rgba(126,200,227,0.05) !important; }
tr:has(a[href$="/"]):not(:has(a[href="../"])):hover td:nth-child(1) a { color: #b3e5f5 !important; }

/* ISO */
tr:has(a[href$=".iso"]) td:nth-child(1) a { color: #98D98E !important; font-weight: 500 !important; }
tr:has(a[href$=".iso"]) td:nth-child(1) a::before { content: '💿  '; }
tr:has(a[href$=".iso"]) td:nth-child(3) { color: #98D98E !important; font-weight: 600 !important; }
tr:has(a[href$=".iso"]):hover td { background: rgba(152,217,142,0.05) !important; }
tr:has(a[href$=".iso"]):hover td:nth-child(1) a { color: #c5f0bf !important; }

/* Download count badge */
.dl-badge {
  display: inline-block;
  margin-left: 0.6rem;
  background: rgba(152,217,142,0.15);
  border: 1px solid rgba(152,217,142,0.3);
  color: #98D98E;
  font-size: 0.65rem;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  letter-spacing: 0.3px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Compressed */
tr:has(a[href$=".gz"]) td:nth-child(1) a,
tr:has(a[href$=".xz"]) td:nth-child(1) a,
tr:has(a[href$=".bz2"]) td:nth-child(1) a { color: #C4B0E8 !important; }

/* Release / signature */
tr:has(a[href="InRelease"]) td:nth-child(1) a,
tr:has(a[href="Release"]) td:nth-child(1) a,
tr:has(a[href$=".gpg"]) td:nth-child(1) a { color: #F5D76E !important; }

/* ── FOOTER ── */
address {
  padding: 1.2rem 2rem;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.1);
  font-style: normal;
  border-top: 1px solid var(--line);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .mir-top { padding: 0.7rem 1rem; }
  .mir-top-sub { display: none; }
  .mir-bc, .mir-info { padding: 0.4rem 1rem; }
  td, th { padding: 0.55rem 0.75rem !important; }
  td:nth-child(1) { padding: 0 !important; width: 60%; }
  td:nth-child(1) a { padding: 0.55rem 0.75rem !important; }
  td:nth-child(2) { display: none !important; }
  th:nth-child(2) { display: none !important; }
  td:nth-child(3) { width: 40%; padding-right: 0.75rem !important; }
  th:nth-child(3) { width: 40%; padding-right: 0.75rem !important; text-align: right !important; }
}
