:root {
    --primary-color: #0066cc;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --download-color: #28a745;
}

.dark-mode {
    --primary-color: #4dabf7;
    --secondary-color: #343a40;
    --text-color: #f8f9fa;
    --bg-color: #212529;
    --card-bg: #343a40;
    --border-color: #495057;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --download-color: #20c997;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #082ca9;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.logo span {
    color: #ffd700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 0;
    display: block;
}

nav ul li a:hover, nav ul li a.active {
    color: #ffd700;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-color);
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: 4px;
    z-index: 1000;
    top: 100%;
    left: 0;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--primary-color);
    color: white;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 15px;
}

.search-box input {
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    width: 200px;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #004a99);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 30px;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-search button {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Book Grid */
.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.book-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.book-cover {
    height: 250px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 14px;
    background-size: cover;
    background-position: center;
}

.book-info {
    padding: 15px;
}

.book-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.book-category {
    color: var(--primary-color);
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Rating Stars */
.book-rating {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.stars {
    display: flex;
    margin-right: 5px;
}

.star {
    color: #ddd;
    font-size: 14px;
}

.star.filled {
    color: #ffc107;
}

.rating-value {
    font-size: 12px;
    color: #666;
}

.book-actions {
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-read {
    background-color: var(--primary-color);
    color: white;
}

.btn-download {
    background-color: var(--download-color);
    color: white;
    border: 1px solid var(--download-color);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Categories */
.categories {
    margin-bottom: 40px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tag {
    background-color: var(--secondary-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-tag:hover, .category-tag.active {
    background-color: var(--primary-color);
    color: white;
}

/* Category Badge */
.category-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

/* View More Button */
.view-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 40px;
}

.btn-view-more {
    background: linear-gradient(135deg, var(--primary-color), #004a99);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-view-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    background: linear-gradient(135deg, #004a99, var(--primary-color));
}

.btn-view-more:active {
    transform: translateY(0);
}

.btn-view-more .arrow {
    transition: transform 0.3s ease;
    font-size: 18px;
}

.btn-view-more:hover .arrow {
    transform: translateY(2px);
}

.btn-view-more small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
    font-weight: normal;
}

/* Animation for new books */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card.new-book {
    animation: fadeInUp 0.5s ease forwards;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #004a99;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px);
}

/* Footer */
footer {
    background-color: #082ca9;
    padding: 40px 0 20px;
    margin-top: 40px;
    color: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 8px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: white;
}

/* Warna khusus untuk link Blogger dan Hugo */
.footer-column ul li a.blogger-link,
.footer-column ul li a.hugo-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
}

.footer-column ul li a.blogger-link:hover,
.footer-column ul li a.hugo-link:hover {
    color: white;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Modal untuk membaca buku */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: var(--bg-color);
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.book-viewer {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--secondary-color);
    border-radius: 4px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.legal-content {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    line-height: 1.6;
}

.legal-content h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.legal-content h3 {
    margin: 20px 0 10px;
}

.legal-content p {
    margin-bottom: 15px;
}

/* Styling untuk halaman FAQ, Panduan, dan Bantuan */
.faq-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--secondary-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.faq-item h4 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

.faq-item p {
    margin: 0;
    line-height: 1.5;
}

.troubleshooting {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.troubleshooting h4 {
    color: #856404;
    margin-bottom: 8px;
}

.reading-method {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.reading-method h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.reading-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.tip {
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
}

.tip h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.help-intro {
    font-size: 1.1em;
    margin-bottom: 30px;
    text-align: center;
    color: #666;
}

.help-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.help-section {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.help-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-links a {
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.quick-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.contact-methods p {
    margin-bottom: 10px;
    padding: 8px;
    background-color: var(--bg-color);
    border-radius: 6px;
}

.common-issues {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.issue {
    padding: 12px;
    background-color: var(--bg-color);
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

.issue h4 {
    margin-bottom: 8px;
    color: #dc3545;
}

.tips {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 6px;
}

.tips p {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.tips p:before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.emergency-contact {
    background: linear-gradient(135deg, var(--primary-color), #004a99);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    margin-top: 30px;
}

.emergency-contact h3 {
    margin-bottom: 10px;
}

.emergency-contact a {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
}

.emergency-contact a:hover {
    text-decoration: underline;
}

/* Styling untuk halaman Donation */
.donation-intro {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.donation-intro p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

.donation-methods {
    margin-bottom: 40px;
}

.donation-method {
    background-color: var(--card-bg);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.donation-method h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.email-address {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    border: 2px dashed #fff;
}

.donation-guidelines {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.donation-guidelines h4 {
    color: #0066cc;
    margin-bottom: 15px;
}

.donation-guidelines ul {
    list-style: none;
    padding: 0;
}

.donation-guidelines li {
    padding: 8px 0;
    border-bottom: 1px solid #d1e7ff;
}

.donation-guidelines li:last-child {
    border-bottom: none;
}

.donation-impact {
    margin-bottom: 40px;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.impact-item {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.impact-item:hover {
    transform: translateY(-5px);
}

.impact-item h4 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.impact-item p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

.donation-thanks {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.donation-thanks h3 {
    margin-bottom: 15px;
}

.donation-thanks p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.1em;
}

/* Ikon hati di copyright */
.heart {
    color: #e25555;
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    5% {
        transform: scale(1.1);
    }
    10% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
    }

    nav ul li {
        margin: 5px 10px 5px 0;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background-color: transparent;
    }

    .dropdown-content a {
        padding: 8px 0;
        border-bottom: none;
    }

    .header-right {
        margin-top: 15px;
        width: 100%;
        justify-content: space-between;
    }

    .search-box input {
        width: 150px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .book-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        padding: 8px;
    }

    .reading-tips {
        grid-template-columns: 1fr;
    }
    
    .help-sections {
        grid-template-columns: 1fr;
    }
    
    .quick-links a {
        text-align: center;
    }

    .impact-grid {
        grid-template-columns: 1fr;
    }
    
    .email-address {
        font-size: 1em;
        padding: 12px;
    }
    
    .donation-intro,
    .donation-thanks {
        padding: 20px;
    }

    /* Footer Responsive */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-column h3 {
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
        display: inline-block;
        padding-bottom: 8px;
    }

    /* View More Button Responsive */
    .btn-view-more {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Back to Top Button Responsive */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}