/* ── mservers.cz / files listing ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Open+Sans:wght@400;500&display=swap');

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

:root {
  --bg:        #0a1628;
  --bg2:       #0f1f3d;
  --primary:   #1564bf;
  --accent:    #4d9fff;
  --glass:     rgba(255,255,255,0.05);
  --glass-b:   rgba(255,255,255,0.10);
  --text:      #e8edf5;
  --muted:     #8fa3c0;
  --border:    rgba(255,255,255,0.08);
  --row-hover: rgba(77,159,255,0.08);
  --radius:    12px;
}

html { min-height: 100%; }

body {
  font-family: 'Open Sans', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 0;
}

/* ── header injektovaný Apache (HeaderName header.html) ───── */
.listing-top-bar {
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(8px);
}
.listing-top-bar .brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.listing-top-bar .brand span { color: var(--accent); }
.listing-top-bar .back-link {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .2s;
}
.listing-top-bar .back-link:hover { color: var(--accent); }

/* ── main wrapper ─────────────────────────────────────────── */
.listing-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 40px auto;
  padding: 0 24px 60px;
  overflow-x: auto;
}

.listing-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.listing-title svg { vertical-align: -4px; margin-right: 8px; }

.listing-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* ── tabulka Apache autoindex ─────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 480px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

thead tr { background: rgba(77,159,255,0.10); }

th {
  padding: 14px 18px;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th a { color: inherit; text-decoration: none; }
th a:hover { color: #fff; }

td {
  padding: 13px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.5;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: var(--row-hover); }

/* ── odkazy (soubory) ─────────────────────────────────────── */
td a, a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
td a:hover, a:hover { color: #fff; text-decoration: none; }

/* ikony souborů (Apache vkládá <img alt="[FILE]"> apod.) */
img[alt="[DIR]"]  { filter: invert(60%) sepia(1) hue-rotate(180deg) saturate(4); }
img[alt="[   ]"]  { filter: invert(70%) sepia(1) hue-rotate(200deg); }

/* ── parent-directory odkaz ───────────────────────────────── */
tr:first-child td a[href=".."],
tr:first-child td a[href="../"] {
  color: var(--muted);
  font-size: 13px;
}

/* ── "alt row" efekt – každý sudý řádek mírně tmavší ──────── */
tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tbody tr:nth-child(even):hover td { background: var(--row-hover); }

/* ── velikost souboru ─────────────────────────────────────── */
td:nth-child(3) { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
td:nth-child(2) { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ── footer ──────────────────────────────────────────────── */
.listing-footer {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  opacity: .7;
}
.listing-footer a { color: var(--muted); }
.listing-footer a:hover { color: var(--accent); }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .listing-wrapper { margin: 28px auto; }
  .listing-title { font-size: 24px; }
  /* skrýt sloupec s datem na středních zařízeních */
  th:nth-child(2), td:nth-child(2) { display: none; }
}

@media (max-width: 600px) {
  .listing-top-bar { padding: 12px 16px; }
  .listing-top-bar .brand { font-size: 17px; }
  .listing-top-bar .back-link { font-size: 12px; }
  .listing-wrapper { margin: 16px auto; padding: 0 12px 40px; }
  .listing-title { font-size: 20px; }
  .listing-subtitle { font-size: 13px; margin-bottom: 20px; }
  th, td { padding: 10px 12px; font-size: 13px; }
  /* skrýt i velikost na velmi malých zařízeních */
  th:nth-child(3), td:nth-child(3) { display: none; }
}
