/* General Styling */
:root {
    --primary-color: #8B0000; /* Merah maroon/gelap dari logo */
    --secondary-color: #A52A2A; /* Sedikit lebih terang dari primary untuk aksen */
    --accent-color: #000000; /* Hitam dari logo, untuk teks atau elemen kuat */
    --text-color: #333333; /* Hampir hitam untuk teks utama */
    --light-text-color: #555555;
    --bg-light: #f8f8f8; /* Background sangat terang, hampir putih */
    --border-color: #cccccc; /* Abu-abu terang untuk border */
    --box-shadow-light: 0 4px 8px rgba(0, 0, 0, 0.1);
    --white-color: #ffffff; /* Putih murni */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif; /* Changed to Roboto for body text */
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color); /* Background putih bersih */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif; /* Merriweather for headings */
    color: var(--accent-color);
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color); /* Tautan berwarna merah gelap */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: none;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--primary-color); /* Tombol utama merah gelap */
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--white-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
}

.btn-tertiary { /* Untuk promo banner CTA */
    background-color: var(--accent-color); /* Tombol promo hitam */
    color: var(--white-color);
    font-weight: bold;
}

.btn-tertiary:hover {
    background-color: var(--text-color); /* Sedikit lebih terang dari hitam */
    text-decoration: none;
}

/* Header */
.main-header {
    background-color: var(--white-color);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 28px;
    font-weight: bold;
}

.logo a {
    color: var(--accent-color); /* Logo teks berwarna hitam */
    text-decoration: none;
    display: flex; /* Agar logo dan teks bisa sejajar jika Anda ingin gambar logo juga */
    align-items: center;
}

.logo a img { /* Jika Anda ingin menempatkan gambar logo di sini */
    height: 150px; /* Sesuaikan tinggi logo */
    margin-right: 10px;
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    position: relative;
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    display: block;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--primary-color); /* Hover menu berwarna merah */
    text-decoration: none;
}

/* Dropdown Menu */
.main-nav .dropdown {
    display: none;
    position: absolute;
    background-color: var(--white-color);
    box-shadow: var(--box-shadow-light);
    border: 1px solid var(--border-color);
    min-width: 180px;
    z-index: 99;
    top: 100%;
    left: 0;
}

.main-nav li:hover > .dropdown {
    display: block;
}

.main-nav .dropdown li {
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.main-nav .dropdown li:last-child {
    border-bottom: none;
}

.main-nav .dropdown li a {
    padding: 10px 15px;
    color: var(--text-color);
}

.main-nav .dropdown li a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}


.header-actions {
    display: flex;
    align-items: center;
}

.header-actions input[type="search"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-right: 15px;
    width: 200px;
    color: var(--text-color);
}

.header-actions input[type="search"]::placeholder {
    color: var(--light-text-color);
}

.header-actions .cart-icon,
.header-actions .user-icon {
    font-size: 20px;
    color: var(--accent-color); /* Ikon berwarna hitam */
    margin-left: 15px;
    position: relative;
}

.header-actions .cart-icon:hover,
.header-actions .user-icon:hover {
    color: var(--primary-color); /* Hover ikon berwarna merah */
}

.header-actions #cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color); /* Warna merah dari logo */
    color: var(--white-color);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('images/hero_bg_science.jpg') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 100px 0;
    margin-bottom: 40px;
}

.hero-section h2 {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--white-color);
}

.hero-section p {
    font-size: 18px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

/* Featured Books Section */
.featured-books, .promo-banner, .about-us-landing, .articles-section { /* Added .articles-section */
    padding: 40px 0;
    margin-bottom: 40px;
}

.featured-books h3, .about-us-landing h3, .articles-section h3 { /* Added .articles-section h3 */
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--accent-color); /* Judul bagian berwarna hitam */
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.book-card {
    background-color: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow-light);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 15px;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.book-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.book-info {
    padding: 0 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
}

.book-title {
    font-size: 20px;
    margin-bottom: 5px;
    color: var(--accent-color); /* Judul buku berwarna hitam */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-author {
    font-size: 15px;
    color: var(--light-text-color);
    margin-bottom: 10px;
}

.book-price {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color); /* Harga buku berwarna merah */
    margin-bottom: 10px;
}

.book-rating {
    color: #ffc107; /* Warna bintang kuning (bisa dipertahankan atau diubah) */
    margin-bottom: 15px;
}

.book-rating .fas {
    margin-right: 2px;
}

.book-card .btn-secondary {
    width: calc(100% - 30px);
    margin-top: auto;
}


/* Promo Banner */
.promo-banner {
    background-color: var(--accent-color); /* Promo banner background hitam */
    color: var(--white-color);
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.promo-banner .container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.promo-banner img {
    max-width: 400px;
    height: auto;
    margin-right: 40px;
    border-radius: 8px;
    box-shadow: var(--box-shadow-light);
}

.promo-banner .promo-content {
    max-width: 600px;
    text-align: left;
}

.promo-banner h2 {
    font-size: 38px;
    margin-bottom: 15px;
    color: var(--white-color);
}

.promo-banner p {
    font-size: 18px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

/* About Us Landing Section */
.about-us-landing {
    background-color: var(--bg-light); /* Light background for contrast */
    padding: 60px 0;
}

.about-us-landing .container {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.about-us-landing .about-content {
    flex: 2; /* Takes more space */
    min-width: 300px;
}

.about-us-landing .about-content h3 {
    text-align: left; /* Align heading to the left */
    margin-bottom: 20px;
}

.about-us-landing .about-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.about-us-landing .about-image {
    flex: 1; /* Takes less space */
    min-width: 250px;
    text-align: center; /* Center image on smaller screens */
}

.about-us-landing .about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--box-shadow-light);
}

/* Articles Section */
.articles-section {
    background-color: var(--white-color); /* Or var(--bg-light) for distinction */
    padding: 60px 0;
}

.articles-section h3 {
    margin-bottom: 40px;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.article-card {
    background-color: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow-light);
    transition: transform 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.article-card img {
    width: 100%;
    height: 200px; /* Consistent height for article images */
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.article-info {
    padding: 15px;
}

.article-title {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.article-date {
    font-size: 14px;
    color: var(--light-text-color);
    margin-bottom: 10px;
}

.article-excerpt {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
}

.read-more:hover {
    text-decoration: underline;
}

.read-more .fas {
    margin-left: 5px;
    transition: margin-left 0.3s ease;
}

.read-more:hover .fas {
    margin-left: 10px;
}

.text-center {
    text-align: center;
}


/* Footer */
.main-footer {
    background-color: var(--accent-color); /* Footer background hitam */
    color: var(--white-color);
    padding: 40px 0 20px;
    font-size: 15px;
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--white-color); /* Paling kontras dan mudah dibaca */
}

.footer-col p, .footer-col ul li {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-col ul li a:hover {
    color: var(--white-color);
    text-decoration: underline;
}

.social-icons a {
    color: var(--white-color);
    font-size: 22px;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--primary-color); /* Hover ikon sosial merah */
}

.newsletter input[type="email"] {
    width: calc(100% - 110px);
    padding: 10px;
    border: none;
    border-radius: 5px 0 0 5px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
}

.newsletter button {
    padding: 10px 20px;
    background-color: var(--primary-color); /* Tombol newsletter merah */
    color: var(--white-color);
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter button:hover {
    background-color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}


/* Responsive Design */
@media (max-width: 992px) {
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        align-items: center;
    }
    .main-nav ul li {
        margin: 10px 0;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    .header-actions input[type="search"] {
        width: 70%;
        margin-right: 0;
    }
    .main-header .container {
        flex-direction: column;
    }
    .logo {
        margin-bottom: 100px;
    }

    .promo-banner .container, .about-us-landing .container, .articles-section .container { /* Added .articles-section .container */
        flex-direction: column;
    }
    .promo-banner img, .about-us-landing .about-image {
        margin-right: 0;
        margin-bottom: 30px;
    }
    .promo-banner .promo-content, .about-us-landing .about-content {
        text-align: center;
    }
    .about-us-landing .about-content h3 {
        text-align: center;
    }
    .articles-section .article-grid { /* Center grid items on smaller screens */
        justify-content: center;
    }


    .footer-columns {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-col {
        min-width: unset;
        width: 100%;
    }
    .social-icons {
        justify-content: center;
        display: flex;
    }
    .newsletter form {
        display: flex;
        justify-content: center;
    }
    .newsletter input[type="email"] {
        width: 70%;
    }
}

@media (max-width: 768px) {
    .hero-section h2 {
        font-size: 38px;
    }
    .hero-section p {
        font-size: 16px;
    }
    .book-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .article-grid {
        grid-template-columns: 1fr; /* Stack articles on very small screens */
    }
    .article-card img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .main-header .container {
        padding: 0 10px;
    }
    .logo {
        font-size: 24px;
    }
    .header-actions input[type="search"] {
        width: 100%;
    }
    .book-card img {
        height: 250px;
    }
    .promo-banner h2 {
        font-size: 28px;
    }
}