:root {
    --merah: #e63946;
    --kuning: #ffd166;
    --hijau: #2a9d8f;
    --biru: #1d3557;
    --biru-muda: #a8dadc;
    
    /* Light theme (default) */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.1);
    --rating-star-empty: #ccc;
    --review-text: #555;
}

[data-theme="dark"] {
    --merah: #ff6b6b;
    --kuning: #ffd166;
    --hijau: #4ecdc4;
    --biru: #457b9d;
    --biru-muda: #6c8b9c;
    
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #f8f9fa;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --rating-star-empty: #555;
    --review-text: #cccccc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-body);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.theme-toggle input {
    display: none;
}

.theme-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.theme-toggle label:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    font-size: 1.2rem;
}

.sun-icon {
    color: var(--kuning);
}

.moon-icon {
    color: var(--biru-muda);
}

.theme-toggle input:checked + label .sun-icon {
    display: none;
}

.theme-toggle input:not(:checked) + label .moon-icon {
    display: none;
}

/* Header & Navigasi */
.navbar {
    background-color: var(--bg-card) !important;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background-color 0.3s ease;
}

.navbar-brand {
    color: var(--biru) !important;
    font-weight: 700;
    font-size: 1.8rem;
}

.navbar-brand span {
    color: var(--hijau);
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--merah) !important;
}

.nav-link.active {
    color: var(--hijau) !important;
    font-weight: 600;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
}

.breadcrumb-item a {
    color: var(--biru);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--merah);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--hijau);
}

/* Detail Buku */
.book-detail-section {
    padding: 3rem 0;
}

.book-image-container {
    border-radius: 12px;
    height: 30rem;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-hover);
    border: 3px solid var(--kuning);
}

.book-image-container img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: transform 0.5s ease;
}

.book-image-container:hover img {
    transform: scale(1.02);
}

.book-title {
    color: var(--biru);
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.book-author {
    color: var(--merah);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.rating {
    color: var(--kuning);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.rating .bi-star-fill {
    color: var(--kuning);
}

.rating .bi-star {
    color: var(--rating-star-empty);
}

.rating-text {
    color: var(--biru);
    margin-left: 0.5rem;
    font-weight: 500;
}

.price {
    color: var(--hijau);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.sinopsis {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    margin-bottom: 2rem;
    border-left: 5px solid var(--biru-muda);
}

.sinopsis h3 {
    color: var(--biru);
    font-weight: 600;
    margin-bottom: 1rem;
}

.sinopsis p {
    color: var(--text-primary);
    line-height: 1.8;
}

.book-meta {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    margin-bottom: 2rem;
}

.book-meta table {
    width: 100%;
}

.book-meta td {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.book-meta td:first-child {
    font-weight: 600;
    color: var(--biru);
    width: 40%;
}

.book-meta td:last-child {
    color: var(--text-secondary);
}

.stock-status {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.stock-tersedia {
    background-color: var(--hijau);
    color: white;
}

.action-buttons .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    margin-right: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.btn-beli {
    background-color: var(--hijau);
    border-color: var(--hijau);
    color: white;
}

.btn-beli:hover {
    background-color: #21867a;
    border-color: #21867a;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(42, 157, 143, 0.3);
}

.btn-keranjang {
    background-color: var(--biru);
    border-color: var(--biru);
    color: white;
}

.btn-keranjang:hover {
    background-color: #152642;
    border-color: #152642;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(29, 53, 87, 0.3);
}

.btn-edit {
    background-color: var(--biru);
    border-color: var(--biru);
    color: white;
}

.btn-edit:hover {
    background-color: #21867a;
    border-color: #21867a;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(42, 157, 143, 0.3);
}

.btn-hapus {
    background-color: var(--merah);
    border-color: var(--merah);
    color: white;
}

.btn-hapus:hover {
    background-color: #152642;
    border-color: #152642;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(29, 53, 87, 0.3);
}

/* Ulasan */
.review-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    height: 100%;
    border-top: 5px solid var(--kuning);
}

.reviewer {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.reviewer img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.reviewer-name {
    font-weight: 600;
    color: var(--biru);
    margin-bottom: 0.2rem;
}

.review-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.review-text {
    color: var(--review-text);
    font-style: italic;
}

/* Rekomendasi Buku */
.rekomendasi-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%;
    background-color: var(--bg-card);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.rekomendasi-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow-hover);
}

.rekomendasi-image {
    height: 180px;
    overflow: hidden;
}

.rekomendasi-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.rekomendasi-card:hover .rekomendasi-image img {
    transform: scale(1.05);
}

.rekomendasi-body {
    padding: 1rem;
}

.rekomendasi-title {
    color: var(--biru);
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.rekomendasi-author {
    color: var(--merah);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.rekomendasi-price {
    color: var(--hijau);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.btn-lihat {
    background-color: var(--biru-muda);
    color: var(--biru);
    border: none;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-lihat:hover {
    background-color: var(--biru);
    color: white;
}

/* Footer */
.footer {
    background-color: var(--biru);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-title {
    color: var(--kuning);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--biru-muda);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--kuning);
}

.footer-links p {
    color: var(--biru-muda);
    margin-bottom: 0.5rem;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--biru-muda);
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Responsif */
@media (max-width: 768px) {
    .book-title {
        font-size: 1.8rem;
    }
    
    .theme-toggle {
        margin-left: 0.5rem;
    }
}
