/* d.primehost.ro – file list + tutorials */

:root {
    --bg: #f3f3f3;
    --surface: #ffffff;
    --code-bg: #fafafa;
    --border: #e2e2e2;
    --text: #1b1b1b;
    --muted: #6b6b6b;
    --title: #555555;
    --accent: #d10000;
    --link: #c40000;
    --link-hover: #000000;
    --hover: #a5f29f;
    --hover-border: #125318;
    --btn-hover: #9acd32;
    --btn-hover-text: #000000;
    /* code blocks: light slate blue, so they stand apart from the white boxes and red title bars */
    --cb-bg: #edf2f7;
    --cb-text: #1e293b;
    --cb-border: #cbd5e1;
    --cb-btn: #ffffff;
    --cb-btn-text: #1e293b;
    --cb-btn-border: #94a3b8;
    --ok: #2e7d32;
    --focus: #1a73e8;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

    --c-folder: #e3a008;
    --c-disk: #7e57c2;
    --c-archive: #a0703c;
    --c-script: #2e7d32;
    --c-app: #1565c0;
    --c-android: #3a9d5d;
    --c-media: #c2185b;
    --c-text: #607d8b;
    --c-image: #00897b;
    --c-file: #8a8a8a;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --surface: #1d1d1d;
        --code-bg: #242424;
        --border: #333333;
        --text: #e8e8e8;
        --muted: #a0a0a0;
        --title: #c4c4c4;
        --accent: #ff4545;
        --link: #ff6b6b;
        --link-hover: #ffffff;
        --hover: #1f3d1c;
        --hover-border: #4caf50;
        --cb-bg: #1e2632;
        --cb-text: #e2e8f0;
        --cb-border: #334155;
        --cb-btn: #2b3544;
        --cb-btn-text: #e2e8f0;
        --cb-btn-border: #475569;
        --focus: #8ab4f8;

        --c-folder: #f2c037;
        --c-disk: #b39ddb;
        --c-archive: #d4a373;
        --c-script: #81c784;
        --c-app: #64b5f6;
        --c-android: #7bd88f;
        --c-media: #f06292;
        --c-text: #90a4ae;
        --c-image: #4db6ac;
        --c-file: #9e9e9e;

        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

html {
    overflow-y: scroll;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 13px/1.5 Verdana, Geneva, sans-serif;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    vertical-align: middle;
}

/* ---------- top bar ---------- */

.topbar {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 3px solid var(--accent);
}
.brand {
    font-size: 16px;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
}
.brand:hover { color: var(--accent); }
.tagline { color: var(--muted); }

/* ---------- layout ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    max-width: 1680px;
    margin: 0 auto;
    padding: 16px;
}
/* No tutorials for this folder: the file list gets the whole width. */
.layout.single { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
@media (max-width: 960px) {
    .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; }
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0 0 8px;
}
.panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: normal;
    color: var(--title);
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
}
.crumbs a { text-decoration: none; overflow-wrap: anywhere; }
.crumbs [aria-current] { color: var(--text); font-weight: bold; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 8px;
}
.search {
    position: relative;
    display: flex;
    flex: 1 1 220px;
}
.search .icon {
    position: absolute;
    top: 50%;
    left: 9px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}
.search input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.search input:focus { border-color: var(--accent); }
.summary { color: var(--muted); white-space: nowrap; }

.box-body {
    position: relative;
    padding: 5px;
    background: var(--surface);
}

/* ---------- file list ---------- */

.table-wrap { padding: 0; }

.files {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.files th {
    padding: 0;
    font-weight: normal;
    text-align: left;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
}
.files th.date { width: 9.5rem; }
.files th.size { width: 6.5rem; }
.files th button {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    color: inherit;
    text-align: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}
.files th button:hover { color: var(--text); }
.files th.size button { justify-content: flex-end; }
.files th[aria-sort] button { color: var(--text); }
.files th[aria-sort="ascending"] button::after { content: "\25B2"; font-size: 0.7em; }
.files th[aria-sort="descending"] button::after { content: "\25BC"; font-size: 0.7em; }

.files td {
    height: 34px;
    padding: 0 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--border);
}
.files td.date { color: var(--muted); }
.files td.size { color: var(--muted); text-align: right; }
.files tbody tr:hover td {
    background: var(--hover);
    border-bottom-color: var(--hover-border);
}

.entry {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
}
.entry .nm {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.lock { display: inline-flex; color: var(--muted); }
.lock .icon { width: 14px; height: 14px; }

.t-folder  { color: var(--c-folder); }
.t-disk    { color: var(--c-disk); }
.t-archive { color: var(--c-archive); }
.t-script  { color: var(--c-script); }
.t-app     { color: var(--c-app); }
.t-android { color: var(--c-android); }
.t-media   { color: var(--c-media); }
.t-text    { color: var(--c-text); }
.t-image   { color: var(--c-image); }
.t-file    { color: var(--c-file); }

.files .empty-row td,
.msg {
    height: auto;
    padding: 16px 10px;
    color: var(--muted);
    white-space: normal;
}
.msg { text-align: center; }
.msg p { margin: 4px 0; }

@media (max-width: 560px) {
    .files .date { display: none; }
}

/* ---------- boxes (tutorials) + code blocks with Copy ---------- */

.box { margin: 0 0 14px; scroll-margin-top: 12px; }
.box:target .box-body { box-shadow: 0 0 0 2px var(--accent); }

.box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 4px;
    font-size: 16px;
    font-weight: normal;
    color: var(--title);
}
.box-title > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.anchor {
    display: inline-flex;
    color: var(--muted);
    opacity: 0;
}
.anchor .icon { width: 14px; height: 14px; }
.box-title:hover .anchor,
.anchor:focus-visible { opacity: 1; }

/* Commands: own color (--cb-*), rounded, no red bar, so they never get mixed up with the tutorial title bars. */
.code-block {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0;
    padding: 8px 8px 8px 12px;
    color: var(--cb-text);
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 6px;
}
.code-block:hover { border-color: var(--btn-hover); }
.code-block code {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.copy-btn {
    flex: 0 0 auto;
    padding: 1px 12px;
    font: inherit;
    font-size: 12px;
    color: var(--cb-btn-text);
    background: var(--cb-btn);
    border: 1px solid var(--cb-btn-border);
    border-radius: 4px;
    cursor: pointer;
}
.copy-btn:hover {
    color: var(--btn-hover-text);
    background: var(--btn-hover);
    border-color: var(--btn-hover);
}
.copy-btn.ok,
.copy-btn.ok:hover { color: #fff; background: var(--ok); border-color: var(--ok); }
.copy-btn.err,
.copy-btn.err:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

@media (max-width: 560px) {
    .code-block { flex-wrap: wrap; }
}

/* ---------- tutorials ---------- */

.tut { margin: 0 0 8px; }
.tut > summary {
    margin: 0;
    padding: 8px 10px;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    cursor: pointer;
    list-style: none;
}
.tut > summary::-webkit-details-marker { display: none; }
.tut > summary::before {
    content: "";
    flex: 0 0 auto;
    border-style: solid;
    border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent currentColor;
    transition: transform 0.15s;
}
.tut[open] > summary::before { transform: rotate(90deg); }
.tut > summary:hover { color: var(--text); }
.tut[open] > summary { border-bottom: 1px solid var(--border); }
.tut:target .box-body { box-shadow: none; } /* opening it is enough */
.tut-from { color: var(--muted); overflow-wrap: anywhere; }
.tut-body p:has(+ .code-block) { margin-bottom: 2px; } /* a text line sits right above its command */

.tut-body {
    padding: 4px 14px 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.tut-body h4, .tut-body h5, .tut-body h6 { margin: 16px 0 6px; color: var(--title); }
.tut-body h4 { font-size: 15px; }
.tut-body h5 { font-size: 14px; }
.tut-body h6 { font-size: 13px; }
.tut-body p { margin: 8px 0; }
.tut-body ul, .tut-body ol { margin: 8px 0; padding-left: 26px; }
.tut-body li { margin: 3px 0; }
.tut-body li > p { margin: 4px 0; }
.tut-body blockquote {
    margin: 10px 0;
    padding: 4px 12px;
    background: var(--code-bg);
    border-left: 4px solid var(--c-folder);
}
.tut-body blockquote p { margin: 4px 0; }
.tut-body hr { margin: 14px 0; border: 0; border-top: 1px solid var(--border); }
.tut-body .ic {
    padding: 0 4px;
    font-family: var(--mono);
    font-size: 0.95em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
}
.tut-img { display: inline-block; max-width: 100%; margin: 6px 0; }
.tut-img img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
}
.table-scroll { max-width: 100%; margin: 10px 0; overflow-x: auto; }
.tut-body table { border-collapse: collapse; }
.tut-body th, .tut-body td {
    padding: 4px 10px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--border);
}
.tut-body th { background: var(--code-bg); }
.tut-body .al-c { text-align: center; }
.tut-body .al-r { text-align: right; }
.tut-missing { color: var(--accent); font-style: italic; }
.tut-broken { text-decoration: line-through; }
.tut-empty { padding: 16px; color: var(--muted); text-align: center; }

/* ---------- back to top ---------- */

.to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.to-top:hover { filter: brightness(1.12); }
