/* Repository STT Salem - Salem Responsif Style */
:root {
    --stt-navy: #0f1e3d;
    --stt-gold: #c9a84c;
    --stt-cream: #faf7f0;
    --stt-text: #2a2a2a;
    --stt-border: #e2ddd0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--stt-cream) !important;
    color: var(--stt-text) !important;
    line-height: 1.6;
}

h1, h2 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    color: var(--stt-navy) !important;
}

.repo-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}
.repo-container.narrow { max-width: 560px; }

.repo-header {
    background: var(--stt-navy) !important;
    padding: 32px 0;
    border-bottom: 4px solid var(--stt-gold);
}
.header-inner { display: flex; align-items: center; gap: 18px; }
.header-logo { height: 56px; width: auto; flex-shrink: 0; border-radius: 4px; }
.header-logo-sm { height: 40px; width: auto; flex-shrink: 0; }
.login-logo { height: 64px; width: auto; display: block; margin: 0 auto 16px; }
.repo-header h1 { color: #fff !important; margin: 0 0 6px; font-size: 1.7rem; }
.repo-header .subtitle { color: var(--stt-gold) !important; margin: 0 0 10px; }
.repo-header .stats-line { color: rgba(255,255,255,0.75) !important; font-size: 0.85rem; margin: 0; }
.repo-header a.home-link { color: #fff !important; text-decoration: none; }

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header-title { display: flex; align-items: center; gap: 12px; }
.admin-header-title h1 { margin: 0; }
.admin-header nav a, .admin-header nav span { color: var(--stt-gold) !important; margin-left: 16px; text-decoration: none; font-size: 0.9rem; }
.admin-header nav a:hover { text-decoration: underline; }

main { padding: 32px 0 60px; }

.search-form { margin-bottom: 24px; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border: 1px solid var(--stt-border);
    border-radius: 6px;
    font-size: 1rem;
}
.search-select, .filter-select {
    padding: 12px 10px;
    border: 1px solid var(--stt-border);
    border-radius: 6px;
    background: #fff;
}
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-reset { color: var(--stt-navy) !important; font-size: 0.9rem; text-decoration: underline; }

.btn-filter-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    background: #fff !important;
    color: var(--stt-navy) !important;
    border: 1px solid var(--stt-border);
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-filter-toggle .count-dot {
    background: var(--stt-gold) !important;
    color: var(--stt-navy) !important;
    border-radius: 50%;
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}

.chip {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--stt-border);
    color: var(--stt-navy) !important;
    text-decoration: none;
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 999px;
    margin-right: 6px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: var(--stt-cream); border-color: var(--stt-gold); }

.badge { display: inline-block; font-size: 0.72rem; padding: 3px 9px; border-radius: 4px; margin-right: 8px; font-weight: 600; color: #fff !important; }
.badge-navy { background: var(--stt-navy) !important; }
.badge-gold { background: #a3822f !important; }
.badge-maroon { background: #7a2e3a !important; }
.badge-teal { background: #2e6b6b !important; }
.badge-brown { background: #6b4c2e !important; }
.badge-slate { background: #5a6270 !important; }

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-primary { background: var(--stt-navy) !important; color: #fff !important; }
.btn-primary:hover { background: #1a2e5c !important; }
.btn-secondary { background: #fff !important; color: var(--stt-navy) !important; border: 1px solid var(--stt-navy) !important; }
.btn-block { width: 100%; }

.result-count { color: #666; font-size: 0.9rem; margin-bottom: 16px; }

.results-list { display: grid; gap: 16px; }
.result-card {
    background: #fff;
    border: 1px solid var(--stt-border);
    border-left: 4px solid var(--stt-gold) !important;
    border-radius: 6px;
    padding: 18px 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.result-card:hover {
    box-shadow: 0 6px 18px rgba(15, 30, 61, 0.08);
    transform: translateY(-2px);
}
.result-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.result-card h2 a { color: var(--stt-navy) !important; text-decoration: none; }
.result-card h2 a:hover { text-decoration: underline; }
.result-card .meta { color: #777; font-size: 0.85rem; margin: 0 0 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.result-card .excerpt { margin: 0; color: #444; font-size: 0.92rem; }

.stt-reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease; }
.stt-reveal.stt-vis { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .stt-reveal { opacity: 1; transform: none; transition: none; }
    .result-card { transition: none; }
    .result-card:hover { transform: none; }
}

.empty-state { text-align: center; color: #888; padding: 50px 20px; background: #fff; border: 1px dashed var(--stt-border); border-radius: 8px; }
.empty-state .empty-title { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--stt-navy); font-size: 1.05rem; margin-bottom: 6px; }
.empty-state .empty-hint { font-size: 0.88rem; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a {
    padding: 8px 14px;
    border: 1px solid var(--stt-border);
    border-radius: 4px;
    color: var(--stt-navy) !important;
    text-decoration: none;
}
.pagination a.active { background: var(--stt-navy) !important; color: #fff !important; border-color: var(--stt-navy); }

.detail-card {
    background: #fff;
    border: 1px solid var(--stt-border);
    border-radius: 8px;
    padding: 28px;
}
.detail-card .meta { color: #555; margin: 14px 0 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.abstract { margin-bottom: 24px; }
.abstract h2 { font-size: 1.1rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--stt-navy) !important; text-decoration: none; font-size: 0.9rem; }

.citation-box {
    margin-top: 24px;
    background: var(--stt-cream);
    border: 1px solid var(--stt-border);
    border-radius: 8px;
    padding: 18px 20px;
}
.citation-box h2 { font-size: 1rem; margin: 0 0 10px; }
.citation-text {
    font-family: 'Inter', sans-serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #333;
    background: #fff;
    border: 1px solid var(--stt-border);
    border-radius: 6px;
    padding: 12px 14px;
    margin: 0 0 12px;
    line-height: 1.5;
}
.btn-copy-citation { font-size: 0.85rem; padding: 9px 16px; }

.related-works { margin-top: 32px; }
.related-works h2 { font-size: 1.1rem; margin-bottom: 12px; }
.related-list { display: grid; gap: 10px; }
.related-item {
    background: #fff;
    border: 1px solid var(--stt-border);
    border-radius: 6px;
    padding: 12px 16px;
    transition: box-shadow 0.2s ease;
}
.related-item:hover { box-shadow: 0 4px 12px rgba(15, 30, 61, 0.07); }
.related-item a { color: var(--stt-navy) !important; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.related-item a:hover { text-decoration: underline; }
.related-item .meta { color: #888; font-size: 0.8rem; margin: 4px 0 0; }

.pdf-viewer-wrap {
    margin-top: 20px;
    border: 1px solid var(--stt-border);
    border-radius: 8px;
    overflow: hidden;
    background: #525659;
}
.pdf-viewer {
    display: block;
    width: 100%;
    height: 75vh;
    min-height: 420px;
    border: none;
}

.login-card {
    background: #fff;
    border: 1px solid var(--stt-border);
    border-radius: 8px;
    padding: 32px;
    margin-top: 60px;
    text-align: center;
}
.login-card form { text-align: left; margin-top: 20px; }
.login-card label, .admin-form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.9rem; }
.login-card input, .admin-form input, .admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid var(--stt-border);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: normal;
}
.admin-form { background: #fff; border: 1px solid var(--stt-border); border-radius: 8px; padding: 26px; }
.admin-form small { display: block; color: #888; font-weight: normal; margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 0.9rem; }
.alert-error { background: #fdecea; color: #a12a2a; border: 1px solid #f3c1c1; }
.alert-success { background: #e9f7ef; color: #1e7a44; border: 1px solid #b7e4c7; }
.alert ul { margin: 0; padding-left: 18px; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.inline-search { display: flex; gap: 8px; }
.inline-search input { padding: 10px 12px; border: 1px solid var(--stt-border); border-radius: 6px; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--stt-border); border-radius: 6px; overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--stt-border); font-size: 0.9rem; }
.admin-table th { background: var(--stt-navy) !important; color: #fff !important; }
.admin-table .actions a, .admin-table .actions .link-danger { margin-right: 10px; color: var(--stt-navy) !important; text-decoration: none; font-size: 0.85rem; }
.link-danger { background: none; border: none; color: #a12a2a !important; cursor: pointer; padding: 0; font-size: 0.85rem; text-decoration: underline; }
.inline-form { display: inline; }

.repo-footer { text-align: center; padding: 24px 0; color: #999; font-size: 0.85rem; }

@media (max-width: 640px) {
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .search-row { flex-direction: column; }

    .btn-filter-toggle { display: inline-flex; margin-bottom: 10px; }
    .filter-row {
        display: none;
        flex-direction: column;
        align-items: stretch;
        background: #fff;
        border: 1px solid var(--stt-border);
        border-radius: 8px;
        padding: 14px;
        margin-bottom: 10px;
    }
    .filter-row.open { display: flex; }
    .filter-row .filter-select { width: 100%; }
}
