body {
    margin: 0;
    background: #f8f9fa;
    font-family: "Segoe UI", sans-serif;
    overflow: hidden;
}

#canvas-container {
    width: 100%;
    height: 100%;
    cursor: grab;
    overflow: hidden;
}

.link {
    stroke: #cbd5e0;
    stroke-opacity: 0.4;
    /* Garis lebih tipis agar tidak semrawut */
    stroke-width: 1px;
}

.node-label {
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 2px;
    stroke-linecap: butt;
    stroke-linejoin: miter;
    font-weight: bold;
}

.tooltip {
    position: fixed;
    /* Ubah dari absolute ke fixed agar tidak terpengaruh container */
    background: #ffffff !important;
    color: #333 !important;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    visibility: hidden;
    display: none;
    pointer-events: none;
    z-index: 2147483647;
    /* Nilai maksimal z-index */
    min-width: 180px;
    border: 2px solid #1e90ff;
    font-family: sans-serif;
    transition: opacity 0.1s ease-out;
}

/* Style untuk Overlay Loading */
#loader {
    display: none;
    /* Sembunyi secara default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e90ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

#book-detail-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Navbar Style */
.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    z-index: 1001;
    /* Di atas segalanya */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e90ff;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 25px;
}

.navbar-menu a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
}

.navbar-menu a:hover {
    color: #1e90ff;
}

.btn-login {
    padding: 8px 20px;
    background: #1e90ff;
    color: white !important;
    border-radius: 6px;
    transition: opacity 0.2s !important;
}

.btn-login:hover {
    opacity: 0.8;
}

/* Input Pencarian */
#searchInput {
    flex-grow: 1;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#searchInput:focus {
    border-color: #1e90ff;
    box-shadow: 0 4px 15px rgba(30, 144, 255, 0.2);
}

/* Tombol Cari */
.btn-search {
    padding: 10px 25px;
    cursor: pointer;
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-search:hover {
    background-color: #0077e6;
}

.btn-search:active {
    transform: scale(0.95);
}

/* Highlight Text di Tooltip */
.highlight {
    /* background-color: #ffeb3b; */
    background-color: rgba(255, 235, 59, 0.5);
    /* Kuning transparan */
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
    border-bottom: 2px solid #ffd600;
}

/* Layout Utama */
.main-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Panel Detail (Kiri) */
#detail-panel {
    width: 350px;
    /* Ukuran panel kiri */
    background: white;
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1002;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Bagian Visual (Kanan) */
#visual-section {
    flex-grow: 1;
    /* Mengambil sisa ruang */
    position: relative;
    background: #f8f9fa;
}

/* Sembunyikan detail panel jika belum ada yang diklik (opsional) */
.detail-content {
    display: none;
    /* Akan muncul via JS */
}

.detail-placeholder {
    color: #a0aec0;
    text-align: center;
    margin-top: 50px;
    font-style: italic;
}

/* Sesuaikan Search Container agar tetap rapi */
.search-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    width: calc(100% - 40px);
    max-width: 500px;
    /* Diperkecil sedikit agar tidak menutupi tengah */
}

/* Legenda Warna */
.legend-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
