/* Hondabase Files - Extended Styles */
:root {
    --discord: #5865f2;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html { scrollbar-gutter: stable; }

h1, h2, h3 { font-family: var(--font-display); }
strong, b { font-weight: 600; }

/* ── Icons (inline Lucide SVGs) ─────────────────── */
svg.icon { flex-shrink: 0; }
svg.lucide { width: 24px; height: 24px; }

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
    position: relative;
    z-index: 1;
}

main h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 2.2rem 0 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
main h2 b {
    background: var(--red); color: #fff;
    border-radius: 2rem; font-size: 0.75rem; padding: 0.05rem 0.55rem;
}

/* ── Header overrides ─────────────────────────────────────── */
.site-header { z-index: 100; }
.brand h1 em { color: var(--txt-dim); font-style: normal; font-size: 0.9rem; margin-left: 0.4rem; letter-spacing: 0; text-transform: none; font-weight: 400; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 300px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.35rem 0.6rem;
}
.search > .lucide { color: var(--txt-dim); width: 18px; height: 18px; }
.search input {
    flex: 1; border: 0; outline: 0; background: transparent;
    color: var(--txt); font-family: var(--font-mono); font-size: 0.8rem; min-width: 0;
}

.nav > a { display: flex; align-items: center; gap: 0.4rem; }
.nav > a b { font-weight: 400; }
.nav .lucide { width: 18px; height: 18px; }
.nav > span { display: flex; align-items: center; gap: 0.45rem; color: var(--txt-dim); }
.nav img { border-radius: 50%; }


/* ── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font: 500 0.9rem var(--font-sans);
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--txt);
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn .lucide { width: 18px; height: 18px; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red); color: #fff; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--txt-dim); }
.btn-discord { background: var(--discord); border-color: var(--discord); color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }
.btn-lg { font-size: 1.05rem; padding: 0.75rem 1.5rem; }

.icon-btn {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border: 0; border-radius: 0.4rem;
    background: transparent; color: var(--txt-dim);
    cursor: pointer;
}
.icon-btn:hover { background: var(--panel-hover); color: var(--red); }
.icon-btn .lucide { width: 20px; height: 20px; }
.fav-btn.is-fav, .fav-btn.is-fav:hover { color: var(--amber); }
.fav-btn.is-fav .lucide { fill: currentColor; }

/* ── Flash ──────────────────────────────────────── */
.flash {
    display: flex; align-items: center; gap: 0.5rem;
    max-width: 1060px; margin: 1rem auto 0; padding: 0.7rem 1rem;
    border-radius: 0.45rem; font-weight: 500;
    background: #e8f6ec; color: #1c7c39; border: 1px solid #bce5c8;
}
.flash-error { background: #fdebec; color: var(--red); border-color: #f6c6ca; }
[data-theme="dark"] .flash { background: #15301d; border-color: #1f4a2c; }
[data-theme="dark"] .flash-error { background: #391518; border-color: #5d2228; }
.flash .lucide { width: 20px; height: 20px; }

/* ── Breadcrumbs & headings ─────────────────────── */
nav[aria-label="Breadcrumb"] {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem;
    font-family: var(--font-mono); font-size: 0.85rem;
    margin-bottom: 1rem;
}
nav[aria-label="Breadcrumb"] .lucide { width: 18px; height: 18px; vertical-align: middle; }
nav[aria-label="Breadcrumb"] > span { color: var(--txt-dim); }

main hgroup { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
main hgroup h1 {
    font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin: 0;
    display: flex; align-items: center; gap: 0.5rem;
}
main hgroup h1 .lucide { width: 1.7rem; height: 1.7rem; color: var(--red); }
main hgroup p { width: 100%; margin: 0.15rem 0 0; color: var(--txt-dim); max-width: 70ch; }
#root-head h1::after {
    content: 'EST. PGMFI ERA';
    font: 600 0.6rem var(--font-mono);
    letter-spacing: 0.12em;
    color: var(--red);
    border: 1px solid currentColor;
    border-radius: 2rem;
    padding: 0.15rem 0.5rem;
    transform: translateY(-0.5em);
}

/* ── Folder grid ────────────────────────────────── */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.folder-grid > a {
    display: flex; gap: 0.7rem; align-items: flex-start;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 0.5rem;
    padding: 0.9rem 1rem;
    color: var(--txt);
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}
.folder-grid > a:hover { transform: translateY(-2px); color: var(--txt); box-shadow: 0 6px 16px rgba(20,10,5,0.12); }
.folder-grid .lucide { color: var(--red); }
.folder-grid a > span:last-child { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.folder-grid strong { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.folder-grid small { color: var(--txt-dim); font-size: 0.8rem; }

/* ── File list ──────────────────────────────────── */
.file-list {
    margin: 0; padding: 0;
    list-style: none;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.file-list > li {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--border);
}
.file-list > li:last-child { border-bottom: 0; }
.file-list > li:hover { background: var(--panel-hover); }
.file-list > li:target { background: color-mix(in srgb, var(--red) 9%, var(--bg-2)); }
.file-list > li > label { display: grid; place-items: center; }
.file-list input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }
.file-list > li > .lucide { color: var(--txt-dim); width: 22px; height: 22px; }
.file-list > li > div { flex: 1; min-width: 0; }
.file-list > li > div strong { font-weight: 500; word-break: break-word; }
.file-list > li > div strong a { color: var(--txt); }
.file-list > li > div strong a:hover { color: var(--red); }
.file-list strong small { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; color: var(--txt-dim); margin-left: 0.4rem; }
.file-list > li > div > small {
    display: flex; align-items: center; gap: 0.25rem;
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--txt-dim);
}
.file-list > li > div > small .lucide { width: 14px; height: 14px; }
.credit { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; color: var(--txt-dim); }
.credit .lucide { width: 13px; height: 13px; }
.file-list > li > div p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--txt-dim); max-width: 72ch; }
.file-list > li > data { font-family: var(--font-mono); font-size: 0.8rem; color: var(--txt-dim); white-space: nowrap; }
.file-list > li > menu { display: flex; gap: 0.1rem; margin: 0; padding: 0; }
.file-list del { opacity: 0.55; }
.file-list ins { text-decoration: none; }
.file-list code { font-size: 0.75rem; word-break: break-all; }
.status-pending { color: #b07d00; }
.status-rejected { color: var(--red); }

.note {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--txt-dim); font-size: 0.95rem;
    background: var(--bg-2); border: 1px dashed var(--border); border-radius: 0.5rem;
    padding: 1rem 1.2rem; margin-top: 1.2rem;
}
.note .lucide { width: 18px; height: 18px; }

/* ── Cards & forms ──────────────────────────────── */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
form.card { display: flex; flex-direction: column; gap: 1rem; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; font-size: 0.9rem; }
.field small { color: var(--txt-dim); font-weight: 400; }
.field input[type="text"], .field select, .field textarea, select, dialog textarea {
    font: inherit; color: var(--txt);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.45rem 0.6rem;
}
.field textarea, dialog textarea { resize: vertical; }

#create-folder { flex-direction: row; gap: 1rem; align-items: end; flex-wrap: wrap; max-width: none; }
#create-folder .field { flex: 1; min-width: 160px; }

/* ── Admin ─────────────────────────────────────── */
#pending li > menu { gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#pending li > menu form, #suggestions li > menu form { display: flex; gap: 0.5rem; align-items: center; }
.bulk-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.8rem; padding: 0; }
.bulk-actions > span { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; color: var(--txt-dim); font-size: 0.85rem; }
#push-status { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 1.5rem; }
#push-status > .lucide { color: var(--txt-dim); width: 28px; height: 28px; }
#push-status[data-failed] > .lucide { color: var(--red); }
#push-status form { margin-left: auto; }
#push-status pre { white-space: pre-wrap; font-size: 0.75rem; }
#audit strong { font-family: var(--font-mono); font-size: 0.85rem; }
#audit data { font-size: 0.72rem; }

/* ── Selection bar ─────────────────────────────── */
#select-bar {
    position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
    display: flex; align-items: center; gap: 0.7rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    padding: 0.6rem 1rem;
    z-index: 200;
    max-width: calc(100vw - 2rem);
    flex-wrap: wrap;
}
#select-bar[hidden] { display: none; }
#select-bar form { display: flex; gap: 0.5rem; align-items: center; margin: 0; }
#select-bar p { margin: 0; font-size: 0.9rem; color: var(--txt-dim); }

/* ── Dialog ────────────────────────────────────── */
dialog {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--bg-2);
    color: var(--txt);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    padding: 1.25rem;
    width: min(520px, 92vw);
}
dialog::backdrop { background: rgba(0,0,0,0.45); }
dialog h3 { margin: 0 0 0.25rem; display: flex; align-items: center; gap: 0.4rem; }
dialog h3 .lucide { color: var(--red); width: 20px; height: 20px; }
dialog form > p { margin: 0 0 0.75rem; color: var(--txt-dim); font-family: var(--font-mono); font-size: 0.8rem; }
dialog textarea { width: 100%; }
dialog menu { display: flex; align-items: center; gap: 0.5rem; margin: 0.9rem 0 0; padding: 0; }
dialog menu a { margin-right: auto; display: flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; }
dialog menu a .lucide { width: 17px; height: 17px; }

/* ── Hero pages (login/guild/error) ────────────── */
.hero { text-align: center; padding: 4rem 1rem; }
.hero > .lucide { width: 64px; height: 64px; color: var(--red); }
.hero h1 { font-size: 2rem; font-weight: 800; margin: 0.5rem 0 0.75rem; }
.hero p { color: var(--txt-dim); margin-bottom: 1.5rem; }
.hero p:last-child { margin: 1.25rem 0 0; font-size: 0.9rem; }

/* ── Footer overrides ────────────────────────────────────── */
.site-footer { background: var(--bg-2); }
.site-footer b { color: var(--txt); }


/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
    .nav > a b { display: none; }
    .nav { gap: 0.6rem; }
}

@media (max-width: 760px) {
    .site-header .wrap { flex-direction: column; align-items: stretch; padding-top: 0.8rem; padding-bottom: 0.8rem; min-height: 0; }
    .brand { align-items: center; text-align: center; }
    .search { width: 100%; order: 3; padding: 0.3rem 0.8rem; }
    .search input { font-size: 16px; } /* prevents iOS focus zoom */
    .nav { justify-content: center; width: 100%; margin: 0; }
    .nav > span b { display: none; }

    main { padding: 1rem 0.9rem 5rem; }
    .flash { margin: 0.8rem 0.9rem 0; }

    main hgroup h1 { font-size: 1.45rem; }
    #root-head h1::after { display: none; }
    nav[aria-label="Breadcrumb"] { font-size: 0.78rem; }

    .file-list strong small { display: block; margin-left: 0; }
}

/* File rows: regrid so size drops under the name and actions stay reachable */
@media (max-width: 640px) {
    .file-list > li {
        display: grid;
        grid-template-columns: auto auto 1fr auto;
        grid-template-areas:
            "check icon main actions"
            "check icon size actions";
        align-items: center;
        column-gap: 0.6rem;
        row-gap: 0.1rem;
    }
    .file-list > li > label { grid-area: check; }
    .file-list > li > .lucide { grid-area: icon; }
    .file-list > li > div { grid-area: main; }
    .file-list > li > data { grid-area: size; justify-self: start; font-size: 0.72rem; }
    .file-list > li > menu { grid-area: actions; flex-direction: column; }

    .folder-grid { grid-template-columns: 1fr; gap: 0.6rem; }

    /* Admin pending queue: stack the approve/reject controls full-width */
    #pending li {
        grid-template-areas:
            "check icon main actions"
            "check icon size actions"
            "forms forms forms forms";
    }
    #pending li > menu {
        grid-area: forms;
        flex-direction: column;
        align-items: stretch;
        padding-top: 0.5rem;
    }
    #pending li > menu form { width: 100%; }
    #pending li > menu select { flex: 1; min-width: 0; }

    #push-status { flex-wrap: wrap; }
    #push-status form { margin-left: 0; width: 100%; }
    #create-folder .field { min-width: 100%; }

    /* Selection bar becomes a full-width docked sheet */
    #select-bar {
        left: 0.6rem; right: 0.6rem; bottom: 0.6rem;
        transform: none;
        max-width: none;
        justify-content: center;
    }
    #select-bar select { max-width: 38vw; }
    #select-bar .btn { padding: 0.5rem 0.7rem; font-size: 0.82rem; }

    dialog { width: calc(100vw - 1.6rem); margin-top: 2rem; }
    .hero { padding: 2.5rem 0.5rem; }
}

/* Bigger touch targets on touch devices */
@media (pointer: coarse) {
    .icon-btn { width: 42px; height: 42px; }
    .file-list input[type="checkbox"] { width: 20px; height: 20px; }
    .file-list > li { padding-top: 0.7rem; padding-bottom: 0.7rem; }
    .nav > a { min-width: 40px; min-height: 40px; justify-content: center; }
}

/* ── Google Analytics Dashboard ────────────────── */
#analytics-dashboard {
    margin-bottom: 2rem;
}
.analytics-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.1);
    color: rgb(34, 197, 94);
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
}
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: rgb(34, 197, 94);
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.analytics-stat {
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 0.4rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.analytics-stat:hover {
    transform: translateY(-2px);
    border-color: var(--red);
}
.analytics-stat span {
    display: block;
    font-size: 0.75rem;
    color: var(--txt-dim);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.analytics-stat strong {
    font-size: 1.6rem;
    color: var(--txt);
}
.popular-pages-section h3 {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    color: var(--txt-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.popular-pages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.popular-pages-table th {
    padding: 0.5rem 0;
    color: var(--txt-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.popular-pages-table td {
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border);
}

/* ── AdSense Ad Unit ──────────────────────────────── */
.ad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 1rem;
    padding: 0.5rem;
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: 0.5rem;
    max-width: 728px;
    box-shadow: var(--shadow);
}
.ad-container::before {
    content: "ADVERTISEMENT";
    display: block;
    font-size: 0.6rem;
    color: var(--txt-dim);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ad-mock-slot {
    width: 320px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.04), rgba(187, 10, 33, 0.04));
    border: 1px dashed var(--red);
    border-radius: 0.35rem;
    color: var(--txt-dim);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.ad-mock-slot:hover {
    transform: scale(1.01);
    border-color: var(--red);
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.07), rgba(187, 10, 33, 0.07));
}
.ad-mock-slot span {
    color: var(--red);
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.ad-mock-slot small {
    font-size: 0.7rem;
    opacity: 0.8;
}

small {
    font-size: 0.7rem;
    opacity: 0.8;
}

