/*
Theme Name: eLibrary
Theme URI: https://elibrary.darulhikmah.or.id
Author: Timo
Description: Dark theme for Perpustakaan Ponpes Darul Hikmah Langkap
Version: 1.0
License: GPL v2 or later
Text Domain: elibrary
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: #070714;
    color: #e8e8e8;
    line-height: 1.6;
    min-height: 100vh;
    display: flex; flex-direction: column;
}
a { color: #2e9e3a; text-decoration: none; transition: color .2s; }
a:hover { color: #f5b042; }
img { max-width: 100%; height: auto; }

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    border-bottom: 2px solid #f5b042;
    position: sticky; top: 0; z-index: 1000;
}
.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.site-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin: 0; }
.site-title a { color: #fff; }
.site-title a:hover { color: #f5b042; }
.main-nav { display: flex; align-items: center; }
.main-nav ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 5px; flex-wrap: wrap;
}
.main-nav ul li { position: relative; }
.main-nav ul li a {
    display: block; padding: 8px 12px;
    color: #fff; font-size: 0.9rem; border-radius: 4px;
    transition: background .2s;
}
.main-nav ul li a:hover,
.main-nav ul li.current-menu-item a,
.main-nav ul li.current_page_item a {
    background: rgba(0,0,0,0.2);
    color: #f5b042;
}
.menu-toggle {
    display: none; background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff; font-size: 1.5rem;
    padding: 5px 12px; border-radius: 6px; cursor: pointer;
}

/* ===== HERO SECTION (front-page) ===== */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #0a0a1a 0%, #0d3010 50%, #0a0a1a 100%);
    min-height: 350px;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 60px 20px;
    border-bottom: 2px solid #f5b042;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(46, 158, 58, 0.08) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero-content h1 {
    font-size: 2rem; color: #fff; margin: 0 0 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.hero-sub { color: #aaa; font-size: 1.05rem; margin: 0 0 25px; }
.hero-search {
    display: flex; max-width: 500px; margin: 0 auto;
    gap: 0; border-radius: 8px; overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.hero-search input {
    flex: 1; padding: 14px 18px; border: none;
    background: #0d0d20; color: #e8e8e8;
    font-size: 1rem; outline: none;
}
.hero-search input::placeholder { color: #666; }
.hero-search button {
    padding: 14px 24px; border: none;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff; font-size: 1rem; cursor: pointer;
    border-left: 1px solid #f5b042;
    transition: background .2s;
}
.hero-search button:hover { background: linear-gradient(135deg, #f5b042, #e6a83a); color: #1b5e20; }

/* ===== PAGE TITLE BAR ===== */
.page-title-bar {
    background: #0d0d20; border-bottom: 2px solid #f5b042;
    padding: 15px 20px;
}
.page-title-bar h1 {
    max-width: 1200px; margin: 0 auto;
    color: #f5b042; font-size: 1.4rem;
}
.page-title-bar .term-desc {
    max-width: 1200px; margin: 5px auto 0;
    color: #aaa; font-size: 0.9rem;
}

/* ===== CONTENT AREA ===== */
.site-content { flex: 1; }
.content-area {
    max-width: 1200px; margin: 0 auto; padding: 20px;
    width: 100%;
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap;
    margin: 30px 0 20px;
}
.section-header h2 { color: #f5b042; margin: 0; font-size: 1.3rem; }
.section-link { color: #2e9e3a; font-size: 0.9rem; }

/* ===== BOOK GRID ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.book-count { color: #888; font-size: 0.9rem; margin-bottom: 15px; }

/* ===== BOOK CARD ===== */
.book-card {
    background: #0d0d20;
    border: 1px solid #2e7d32;
    border-radius: 12px;
    overflow: hidden;
    transition: all .3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex; flex-direction: column;
}
.book-card:hover {
    border-color: #f5b042;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245,176,66,0.15);
}
.book-cover-link { display: block; width: 100%; }
.book-cover {
    width: 100%; height: 200px;
    background-size: cover; background-position: center;
    background-color: #0d0d20;
}
.book-cover-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: #2e7d32;
    background: linear-gradient(135deg, #0d0d20 0%, #1a1a35 100%);
}
.book-info {
    padding: 15px; flex: 1; display: flex;
    flex-direction: column;
}
.book-title {
    font-size: 1rem; margin: 0 0 6px; line-height: 1.4;
}
.book-title a { color: #2e9e3a; }
.book-title a:hover { color: #f5b042; }
.book-author { color: #888; font-size: 0.85rem; margin: 0 0 8px; }
.book-cats { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.book-cat {
    background: rgba(46, 158, 58, 0.15);
    color: #2e9e3a; font-size: 0.75rem;
    padding: 2px 8px; border-radius: 10px;
}
.book-volumes { color: #f5b042; font-size: 0.8rem; margin: auto 0 0; }
.book-drive-link {
    display: inline-block; margin-top: 8px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff; padding: 6px 14px; border-radius: 6px;
    font-size: 0.85rem; text-align: center;
    border: 1px solid #f5b042;
    transition: all .2s;
}
.book-drive-link:hover {
    background: linear-gradient(135deg, #f5b042, #e6a83a);
    color: #1b5e20;
}

/* ===== KATEGORI GRID ===== */
.kategori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.kategori-card {
    background: #0d0d20;
    border: 1px solid #2e7d32;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    transition: all .3s;
    display: block;
}
.kategori-card:hover {
    border-color: #f5b042;
    transform: translateY(-2px);
}
.kategori-name {
    display: block; color: #2e9e3a; font-weight: 600; font-size: 1rem;
}
.kategori-count {
    display: block; color: #888; font-size: 0.8rem; margin-top: 4px;
}

/* ===== SINGLE BOOK ===== */
.single-book {
    max-width: 1200px; margin: 0 auto; padding: 20px;
}
.single-book-header { margin-bottom: 20px; }
.back-link { color: #f5b042; font-size: 0.9rem; }
.back-link:hover { color: #2e9e3a; }
.single-book-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}
.single-book-sidebar { }
.single-book-cover {
    width: 100%; height: 320px;
    background-size: cover; background-position: center;
    border-radius: 12px; border: 1px solid #2e7d32;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.single-book-cover-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; color: #2e7d32;
    background: linear-gradient(135deg, #0d0d20 0%, #1a1a35 100%);
}
.single-book-meta-box {
    background: #0d0d20; border: 1px solid #2e7d32;
    border-radius: 10px; padding: 16px; margin-top: 15px;
}
.meta-item {
    padding: 8px 0; border-bottom: 1px solid rgba(46, 126, 50, 0.2);
}
.meta-item:last-child { border-bottom: none; }
.meta-label { display: block; font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.meta-value { display: block; font-size: 0.95rem; color: #e8e8e8; margin-top: 2px; }
.meta-value a { color: #f5b042; }
.single-book-main { }
.single-book-title {
    font-size: 1.6rem; color: #2e9e3a; margin: 0 0 15px;
}
.single-book-desc {
    color: #c0c0c0; line-height: 1.8;
    margin-bottom: 20px; padding-bottom: 20px;
    border-bottom: 1px solid #2e7d32;
}
.single-book-content-full {
    color: #e8e8e8; line-height: 1.9;
    margin-bottom: 20px;
}

/* ===== JILID SECTION ===== */
.jilid-section { margin-top: 20px; }
.jilid-section h2 {
    color: #f5b042; font-size: 1.1rem; margin: 0 0 12px;
}
.jilid-list { display: flex; flex-direction: column; gap: 10px; }
.jilid-item {
    display: flex; align-items: center; gap: 15px;
    background: #0d0d20; border: 1px solid #2e7d32;
    border-radius: 10px; padding: 12px 16px;
    transition: all .2s;
}
.jilid-item:hover { border-color: #f5b042; }
.jilid-thumb {
    width: 50px; height: 60px;
    background-size: cover; background-position: center;
    border-radius: 6px; border: 1px solid #2e7d32;
    flex-shrink: 0;
}
.jilid-info { flex: 1; }
.jilid-info strong { color: #e8e8e8; font-size: 0.95rem; }
.jilid-btn {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff; padding: 8px 16px; border-radius: 6px;
    font-size: 0.85rem; white-space: nowrap;
    border: 1px solid #f5b042;
    transition: all .2s;
    flex-shrink: 0;
}
.jilid-btn:hover {
    background: linear-gradient(135deg, #f5b042, #e6a83a);
    color: #1b5e20;
}

/* ===== ARCHIVE SEARCH ===== */
.archive-search {
    display: flex; max-width: 500px; margin-bottom: 20px;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.archive-search input {
    flex: 1; padding: 12px 16px; border: none;
    background: #0d0d20; color: #e8e8e8;
    font-size: 0.95rem; outline: none;
}
.archive-search input::placeholder { color: #666; }
.archive-search button {
    padding: 12px 20px; border: none;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff; font-size: 0.95rem; cursor: pointer;
    border-left: 1px solid #f5b042;
}
.archive-search button:hover { background: #2e7d32; }

/* ===== PAGE CONTENT ===== */
.page-content {
    background: #0d0d20; border: 1px solid #2e7d32;
    border-radius: 12px; padding: 30px;
    margin-top: 20px; color: #f0f0f0; line-height: 1.9;
}
.page-content h2, .page-content h3 { color: #2e9e3a; }

/* ===== PAGINATION ===== */
.pagination {
    margin: 40px 0; text-align: center;
}
.pagination a, .pagination span {
    display: inline-block;
    background: #0d0d20; border: 1px solid #2e7d32;
    color: #e8e8e8; padding: 8px 14px;
    border-radius: 6px; margin: 0 3px;
    transition: all .2s; font-size: 0.9rem;
}
.pagination .current {
    background: #2e7d32; border-color: #f5b042;
}
.pagination a:hover { border-color: #f5b042; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: #888; font-size: 1.1rem;
}
.empty-state .btn-primary,
.btn-primary {
    display: inline-block; margin-top: 15px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff; padding: 12px 24px; border-radius: 8px;
    border: 1px solid #f5b042;
    transition: all .2s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #f5b042, #e6a83a);
    color: #1b5e20;
}

/* ===== ERROR 404 ===== */
.error-404 {
    text-align: center; padding: 100px 20px;
}
.error-404 h1 { font-size: 5rem; color: #f5b042; margin: 0; }
.error-404 p { font-size: 1.2rem; color: #ccc; }

/* ===== FOOTER ===== */
.site-footer {
    background: linear-gradient(135deg, #1b5e20 0%, #0d3010 100%);
    border-top: 2px solid #f5b042;
    padding: 25px 20px; text-align: center;
    color: #ccc; font-size: 0.85rem;
    margin-top: auto;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-inner a { color: #f5b042; }
.footer-links { margin: 5px 0 0; }
.footer-links a { color: #2e9e3a; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 1.4rem; }
    .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .single-book-content { grid-template-columns: 1fr; }
    .single-book-cover { height: 250px; max-width: 250px; margin: 0 auto; }
    .menu-toggle { display: block; }
    .main-nav ul {
        display: none; flex-direction: column;
        width: 100%; margin-top: 10px;
    }
    .main-nav ul.open { display: flex; }
    .main-nav ul li a { padding: 10px 15px; }
    .kategori-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .book-grid { grid-template-columns: 1fr; }
    .kategori-grid { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 1.2rem; }
    .jilid-item { flex-wrap: wrap; }
    .jilid-btn { width: 100%; text-align: center; }
}
