:root {
    --bg: #f4f6f2;
    --surface: #ffffff;
    --surface-soft: #f5fbfa;
    --text: #112a24;
    --muted: #4e6a62;
    --primary: #0f766e;
    --primary-soft: #d9f3ef;
    --accent: #ef6f4b;
    --ring: rgba(15, 118, 110, 0.25);
    --border: #d7e1de;
    --shadow: 0 16px 40px rgba(16, 34, 30, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 8% -10%, #ffdfcc 0%, transparent 36%),
        radial-gradient(circle at 92% 8%, #d8f1ee 0%, transparent 38%),
        var(--bg);
}

.page-shell {
    width: min(1200px, calc(100% - 2rem));
    margin: 1.25rem auto 2rem;
}

.hero {
    background: linear-gradient(140deg, #0f766e 0%, #155e75 60%, #1f4e5f 100%);
    color: #f5fffd;
    border-radius: 24px;
    padding: clamp(1.2rem, 3vw, 2.2rem);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: heroReveal 0.7s ease-out both;
}

.hero::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    right: -80px;
    top: -100px;
    border-radius: 50%;
    background: rgba(239, 111, 75, 0.18);
}

.hero-kicker {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    opacity: 0.92;
}

.hero h1 {
    margin: 0.35rem 0 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 1.08;
    white-space: nowrap;
}

.hero-subtitle {
    margin: 0.8rem 0 0;
    max-width: 70ch;
    color: #dbf8f1;
}

.stats {
    margin-top: 1.2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.stat {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 0.72rem 0.85rem;
    backdrop-filter: blur(4px);
}

.stat-button {
    appearance: none;
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.stat-button:hover,
.stat-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.stat-button.is-active {
    background: rgba(239, 111, 75, 0.22);
    border-color: rgba(255, 228, 215, 0.88);
}

.stat span {
    display: block;
    font-size: clamp(1.25rem, 2.8vw, 1.8rem);
    font-weight: 700;
}

.stat p {
    margin: 0.1rem 0 0;
    font-size: 0.82rem;
    color: #e6fffb;
}

.controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.9rem;
    margin: 1rem 0 1.2rem;
    padding: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(24, 39, 35, 0.08);
    animation: fadeUp 0.55s ease-out both;
    animation-delay: 0.1s;
}

.viewbar {
    margin: 0 0 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
}

.scope-label {
    margin: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f3f9f8;
    color: #28584f;
    font-size: 0.8rem;
    font-weight: 700;
}

.view-toggle {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.2rem;
    box-shadow: 0 10px 24px rgba(24, 39, 35, 0.08);
}

.view-btn {
    border: 0;
    border-radius: 9px;
    padding: 0.52rem 0.8rem;
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.view-btn.is-active {
    background: var(--primary);
    color: #f4fffd;
}

.page-size-field {
    width: 160px;
}

.columns-field {
    width: 150px;
}

.viewbar-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(24, 39, 35, 0.06);
}

.field {
    display: block;
}

.field span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0 0.34rem;
}

.field input,
.field select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0.7rem 0.8rem;
    font: inherit;
    color: var(--text);
    background: var(--surface-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field input::placeholder {
    color: #7a928b;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
    background: #fff;
}

.journal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
}

.journal-grid.grid-three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: auto;
    box-shadow: 0 14px 30px rgba(20, 37, 34, 0.07);
}

.journal-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.journal-table th,
.journal-table td {
    text-align: left;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid #ebf1ef;
    vertical-align: top;
    font-size: 0.88rem;
}

.journal-table thead {
    background: #f3f9f8;
}

.journal-table th {
    color: #254740;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.journal-table tbody tr:hover {
    background: #fbfefd;
}

.journal-table th:nth-child(4),
.journal-table td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
}

.journal-table a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.journal-table a:hover,
.journal-table a:focus-visible {
    text-decoration: underline;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.page-buttons {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.page-number {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.page-number:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.page-number.is-active {
    background: var(--primary);
    color: #f4fffd;
    border-color: var(--primary);
}

.page-ellipsis {
    color: var(--muted);
    padding: 0 0.2rem;
}

.pagination button {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    border-radius: 10px;
    padding: 0.45rem 0.72rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--primary-soft);
}

.pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.journal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.9rem;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.95rem;
    min-height: 210px;
    box-shadow: 0 14px 30px rgba(20, 37, 34, 0.06);
    animation: fadeUp 0.5s ease both;
    overflow: hidden;
}

.card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-cover {
    width: 100%;
    height: 100%;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #dde8e5;
    background: linear-gradient(180deg, #f6faf9, #eef4f2);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.cover-fallback {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a756e;
}

.card-cover.no-cover {
    background: linear-gradient(145deg, #f2f7f6, #edf3f1);
}

.journal-card h2 {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    line-height: 1.28;
}

.meta {
    margin: 0.65rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.publisher {
    margin: 0.35rem 0 0;
    color: #3f5e56;
    font-size: 0.84rem;
    font-weight: 500;
}

.badges {
    margin: 0.9rem 0 0;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.58rem;
}

/* Sinta tiers */
.badge.accreditation.accr-sinta-6 { background: #FF5722; color: #ffffff; }
.badge.accreditation.accr-sinta-5 { background: #FF9800; color: #1f2937; }
.badge.accreditation.accr-sinta-4 { background: #FFC107; color: #1f2937; }
.badge.accreditation.accr-sinta-3 { background: #FFEB3B; color: #1f2937; }
.badge.accreditation.accr-sinta-2 { background: #CDDC39; color: #1f2937; }
.badge.accreditation.accr-sinta-1 { background: #8BC34A; color: #1f2937; }

/* Scopus quartiles */
.badge.accreditation.accr-q4 { background: #dd5a4e; color: #ffffff; }
.badge.accreditation.accr-q3 { background: #fba353; color: #1f2937; }
.badge.accreditation.accr-q2 { background: #e8d559; color: #1f2937; }
.badge.accreditation.accr-q1 { background: #a4cf63; color: #1f2937; }

/* Fallback */
.badge.accreditation.accr-default { color: #0f766e; background: var(--primary-soft); }

.badge.expiry {
    color: #894528;
    background: #ffe7d4;
}

.rating {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.14rem;
}

.rating-star {
    border: 0;
    background: transparent;
    color: #d39a2f;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.08rem 0.12rem;
    cursor: pointer;
}

.rating-star:hover,
.rating-star:focus-visible {
    color: #b87c17;
}

.rating-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.table-rating-cell .rating {
    margin-top: 0;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 0.8rem;
}

.apc {
    margin: 0;
    font-weight: 700;
    color: #18332d;
    max-width: 58%;
}

.apc span {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 0.16rem;
}

.journal-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #d85f3d);
    border-radius: 10px;
    padding: 0.5rem 0.68rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.journal-link:hover,
.journal-link:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.empty-state {
    margin: 1rem 0 0;
    padding: 1rem;
    border-radius: 14px;
    background: #fff8f5;
    border: 1px solid #ffddcf;
    color: #803f27;
}

.site-footer {
    margin-top: 1.6rem;
}

.donation-panel {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at top right, rgba(239, 111, 75, 0.14), transparent 30%),
        radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.12), transparent 34%),
        linear-gradient(180deg, #ffffff, #f5fbfa);
    box-shadow: 0 18px 34px rgba(19, 38, 34, 0.08);
}

.footer-kicker {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #42685f;
    font-weight: 700;
}

.donation-copy h2 {
    margin: 0.28rem 0 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(1.45rem, 3vw, 2rem);
    color: #143a33;
}

.donation-text {
    margin: 0.7rem 0 0;
    max-width: 55ch;
    color: #48675f;
    line-height: 1.65;
}

.donation-meta {
    margin-top: 1rem;
    display: grid;
    gap: 0.45rem;
}

.donation-note {
    margin: 0;
    color: #5b756e;
    font-size: 0.9rem;
}

.donation-methods {
    margin: 0.2rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.donation-methods li {
    display: grid;
    gap: 0.12rem;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #d6e7e3;
    border-radius: 10px;
}

.donation-methods span {
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #56716a;
    font-weight: 700;
}

.donation-methods strong {
    font-size: 0.95rem;
    color: #1a433b;
}

.donation-link {
    margin-top: 0.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: fit-content;
    padding: 0.58rem 0.86rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #d85f3d);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.donation-link:hover,
.donation-link:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.donation-figure {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donation-card {
    width: min(100%, 320px);
    padding: 1rem;
    border-radius: 22px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    background: linear-gradient(160deg, #fefefe, #ecf6f4);
    box-shadow: 0 14px 30px rgba(19, 38, 34, 0.1);
    display: grid;
    gap: 0.8rem;
    justify-items: center;
}

.donation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.donation-qr-image {
    width: min(100%, 210px);
    aspect-ratio: 1;
    border-radius: 18px;
    border: 1px solid #b8d7d0;
    object-fit: cover;
    background: #ffffff;
}

.donation-figure figcaption {
    color: #4f6d66;
    font-size: 0.86rem;
    text-align: center;
}

.footer-bottom {
    margin-top: 0.95rem;
    padding: 0.95rem 0.2rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: #58726b;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .controls {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .viewbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .page-size-field {
        width: 100%;
    }

    .columns-field {
        display: none;
    }

    .viewbar-group {
        width: 100%;
    }

    .journal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .journal-grid.grid-three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .journal-card {
        grid-template-columns: 130px 1fr;
        min-height: 200px;
    }

    .donation-panel {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: min(1200px, calc(100% - 1rem));
        margin-top: 0.75rem;
    }

    .hero {
        border-radius: 18px;
    }

    .journal-grid,
    .journal-grid.grid-three-columns {
        grid-template-columns: 1fr;
    }

    .journal-card {
        min-height: 220px;
        grid-template-columns: 1fr;
        padding: 0.8rem;
    }

    .card-cover {
        height: auto;
        aspect-ratio: 16 / 10;
        padding: 0.65rem;
    }
}