/**
 * OPAC Multi Style (Master Style)
 * Path: plugins/multi_opac_path/assets/css/opac-style.css
 * Digunakan oleh landing_page.tpl dan library_page.tpl
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #212529;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f4f6f9;
    --bg-white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 50px;
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   BODY & BASE
   ============================================================ */
body {
    font-family: var(--font-base);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   HEADER MODERN (LANDING & LIBRARY)
   ============================================================ */
.landing-header,
.library-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e293b 100%);
    color: #ffffff;
    padding: 2.5rem 0 3.5rem 0;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.landing-header::after,
.library-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.landing-header .container,
.library-header .container {
    position: relative;
    z-index: 1;
}

/* Header Brand Flex */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.header-logo {
    max-height: 55px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 6px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header-title,
.landing-header h1,
.library-header h1 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0;
}

/* ============================================================
   SEARCH BAR MODERN (PILL STYLE)
   ============================================================ */
.search-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 6px;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 680px;
    width: 100%;
    transition: var(--transition);
}

.search-wrapper:focus-within {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.search-wrapper .form-control,
.search-wrapper input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    background: transparent;
    color: var(--text-dark);
    flex: 1;
}

.search-wrapper input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-wrapper .btn-theme {
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.5rem;
    white-space: nowrap;
}

/* ============================================================
   LIBRARY SWITCHER
   ============================================================ */
.library-switcher-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.library-switcher-card .form-select {
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border: none;
    background: rgba(255, 255, 255, 0.95);
}

/* ============================================================
   BACK LINK
   ============================================================ */
.back-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}

.back-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

/* ============================================================
   STATISTIK
   ============================================================ */
.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    background: #ffffff;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(13, 110, 253, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2.5rem 0 1.25rem 0;
}

.section-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1e293b;
    position: relative;
    padding-left: 14px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 4px;
}

/* ============================================================
   CARDS & BOOK COVER
   ============================================================ */
.card-modern {
    border: none;
    border-radius: var(--radius-lg);
    background: #ffffff;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.book-cover {
    aspect-ratio: 3 / 4;
    max-height: 200px;
    width: 100%;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
    line-height: 1.3;
}

/* ============================================================
   BUTTON & BADGE
   ============================================================ */
.btn-theme {
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-theme:hover {
    opacity: 0.92;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.library-badge {
    background: var(--primary-color);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ============================================================
   AVATAR LIBRARIAN
   ============================================================ */
.avatar-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
    font-size: 1.5rem;
    color: #64748b;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   FOOTER
   ============================================================ */
.landing-footer {
    background-color: var(--secondary-color);
    color: #94a3b8;
    padding: 2.5rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================================
   FORM SEARCH TERINTEGRASI
   ============================================================ */
.search-form-integrated {
    max-width: 850px;
    margin: 0 auto;
}

.search-form-integrated .input-group {
    border-radius: 50rem;
    overflow: hidden;
    background-color: #ffffff;
    padding: 4px;
}

.search-form-integrated .form-control {
    font-size: 0.95rem;
    box-shadow: none !important;
}

.search-form-integrated .form-control:focus {
    background-color: #ffffff;
}

.search-select-custom {
    max-width: 240px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    border-left: 1px solid #dee2e6 !important;
    cursor: pointer;
    box-shadow: none !important;
}

.search-select-custom:focus {
    background-color: #f8f9fa;
}

.btn-theme-search {
    background-color: var(--primary-color, #0d6efd);
    color: #ffffff;
    border-radius: 50rem !important;
    transition: all 0.2s ease-in-out;
}

.btn-theme-search:hover {
    background-color: var(--secondary-color, #0b5ed7);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ============================================================
   NAVBAR & DROPDOWN PLUGIN COMPONENT
   ============================================================ */
.navbar-custom-plugin {
    position: relative;
    z-index: 1050 !important;
}

.navbar-custom-plugin .dropdown-menu {
    z-index: 1060 !important;
    position: absolute !important;
}

.navbar-custom-plugin .dropdown-menu.show {
    display: block !important;
}

.navbar-custom-plugin .navbar-nav .dropdown-menu {
    top: 100% !important;
    left: 0 !important;
}

.navbar-custom-plugin .dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

/* ============================================================
   RESPONSIVE FIXES (MOBILE)
   ============================================================ */
@media (max-width: 767.98px) {
    .landing-header,
    .library-header {
        padding: 2rem 0 2.5rem 0;
        border-radius: 0 0 20px 20px;
    }

    .header-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-wrapper {
        border-radius: var(--radius-md);
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }

    .search-wrapper .form-control,
    .search-wrapper input {
        width: 100%;
        padding: 0.5rem 0.75rem;
    }

    .search-wrapper .btn-theme {
        width: 100%;
        border-radius: var(--radius-sm);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .search-form-integrated .input-group {
        border-radius: 1rem;
        flex-direction: column;
        padding: 8px;
        gap: 6px;
    }

    .search-select-custom {
        max-width: 100%;
        border-left: none !important;
        border-top: 1px solid #dee2e6 !important;
        border-bottom: 1px solid #dee2e6 !important;
        border-radius: 0.5rem !important;
    }

    .search-form-integrated .form-control {
        border-radius: 0.5rem !important;
    }

    .btn-theme-search {
        border-radius: 0.5rem !important;
        width: 100%;
    }
}

/* ============================================================
   NAVBAR LIBRARY COMPONENT STYLING
   ============================================================ */
.navbar-custom-library {
    position: relative;
    z-index: 1050 !important;
}

.navbar-custom-library .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-custom-library .nav-link:hover,
.navbar-custom-library .nav-item.active .nav-link {
    color: #ffffff !important;
}

.navbar-custom-library .nav-item.active .nav-link {
    font-weight: 600;
}

.navbar-custom-library .navbar-toggler {
    border: none;
    padding: 8px 12px;
}

.navbar-custom-library .navbar-toggler:focus {
    box-shadow: none;
}

/* Tombol Global Search di Navbar Library */
.btn-global-search {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
    color: #ffffff !important;
    transition: var(--transition);
}

.btn-global-search:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* ============================================================
   FILTER SIDEBAR COMPONENT
   ============================================================ */
.filter-sidebar {
    background: #ffffff;
    padding: 20px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 20px;
}

.filter-sidebar .filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary-color, #0d6efd);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.filter-sidebar .filter-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-color, #212529);
    margin: 0;
}

.filter-sidebar .filter-header .badge {
    font-size: 0.7rem;
    background: var(--primary-color, #0d6efd);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
}

.filter-sidebar .filter-group {
    margin-bottom: 14px;
}

.filter-sidebar .filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color, #212529);
    margin-bottom: 4px;
    display: block;
}

.filter-sidebar .filter-group .form-control,
.filter-sidebar .filter-group .form-select {
    font-size: 0.82rem;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-sidebar .filter-group .form-control:focus,
.filter-sidebar .filter-group .form-select:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
    outline: none;
}

.filter-sidebar .filter-group .form-control-sm,
.filter-sidebar .filter-group .form-select-sm {
    font-size: 0.78rem;
    padding: 4px 8px;
}

.filter-sidebar .btn-apply {
    background: var(--primary-color, #0d6efd);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.2s;
}

.filter-sidebar .btn-apply:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.filter-sidebar .btn-reset {
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
    text-align: center;
    display: block;
    text-decoration: none;
}

.filter-sidebar .btn-reset:hover {
    background: #e0e0e0;
    text-decoration: none;
    color: #444;
}

.filter-sidebar .library-badge {
    display: inline-block;
    background: rgba(13, 110, 253, 0.12);
    color: var(--primary-color, #0d6efd);
    font-size: 0.7rem;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 4px;
}

.filter-sidebar .divider {
    border: none;
    border-top: 1px dashed #e0e0e0;
    margin: 12px 0;
}

.filter-sidebar .filter-count {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .filter-sidebar {
        position: static;
        margin-bottom: 20px;
    }
}
/* ============================================================
   FIX: TOPIC GRID (Bikin Topik Horizontal & Rata Tengah)
   ============================================================ */
.topic-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    list-style: none !important;
    padding: 0 !important;
    margin: 1.5rem 0 2.5rem 0 !important;
}

.topic-grid li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.topic-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: var(--text-dark, #1e293b);
    padding: 1rem;
    border-radius: var(--radius-md, 12px);
    background: #ffffff;
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.05));
    transition: var(--transition, all 0.25s ease);
    width: 110px;
    height: 110px;
    text-align: center;
}

.topic-grid a:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover, 0 12px 30px rgba(0, 0, 0, 0.12));
    color: var(--primary-color, #0d6efd);
}

.topic-grid img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.topic-grid span {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   FIX: STYLING FILTER SIDEBAR & FACET LIST
   ============================================================ */
.filter-sidebar .filter-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-color, #212529);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.filter-sidebar .filter-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

.filter-sidebar .filter-list li {
    list-style: none !important;
    margin-bottom: 6px !important;
}

.filter-sidebar .filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-dark, #1e293b);
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.filter-sidebar .filter-list a:hover {
    background-color: var(--bg-light, #f4f6f9);
    color: var(--primary-color, #0d6efd);
}