/* ============================================= */
/* 1. PENGATURAN GLOBAL DAN FONT                 */
/* ============================================= */

/* Import Font dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Playfair+Display:wght@700&display=swap');

/* Variabel Warna untuk Light & Dark Mode */
:root {
    --primary-color: #0A0A0A;      /* Hitam untuk teks dan footer */
    --secondary-color: #FFFFFF;    /* Putih untuk latar belakang utama */
    --accent-color: #0056b3;       /* Biru yang kuat untuk tombol dan hover, cocok dengan logo */
    --text-color: #333;            /* Abu-abu tua untuk teks paragraf */
    --bg-color: #F4F4F4;           /* Abu-abu sangat terang untuk latar belakang body */
}

/* Variabel Warna untuk Dark Mode */
body.dark-mode {
    --primary-color: #FFFFFF;
    --secondary-color: #1a1a1a;
    --accent-color: #007bff;
    --text-color: #e0e0e0;
    --bg-color: #121212;
}

/* CSS Reset Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Pengaturan Body Utama */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* ============================================= */
/* 2. HEADER DAN NAVIGASI                        */
/* ============================================= */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--secondary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
}

/* Logo dan Nama Perusahaan */
.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 80px;
    margin-right: 10px;
}

/* Menu Navigasi Horizontal */
.nav-links {
    list-style: none; /* Menghilangkan bullet points */
    display: flex;    /* Membuat menu menjadi horizontal */
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Efek garis bawah animasi saat hover */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    bottom: 0;
    left: 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s ease-out;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* Tombol Ganti Mode */
.mode-toggle {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.mode-toggle:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}


/* ============================================= */
/* 3. BAGIAN UTAMA (MAIN CONTENT)                */
/* ============================================= */

main {
    padding-top: 80px; /* Memberi ruang di bawah navbar yang fixed */
}

section {
    padding: 4rem 2rem;
}

h2 {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative; /* Penting untuk menumpuk elemen */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 2rem;
    margin-top: -80px;
    overflow: hidden; /* Mencegah elemen keluar dari hero section */
}

/* Kontainer Slideshow */
.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Posisikan di belakang konten */
}

/* Setiap Slide */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* Sembunyikan semua slide secara default */
    transition: opacity 1.5s ease-in-out; /* Efek fade yang halus */
    /* Tambahkan lapisan gelap agar teks lebih mudah dibaca */
    box-shadow: inset 0 0 0 2000px rgba(0,0,0,0.5); 
}

/* Tampilkan hanya slide yang aktif */
.slide.active {
    opacity: 1;
}

/* ---- GAMBAR SLIDESHOW ANDA ---- */
/* Ganti URL gambar di bawah ini dengan gambar Anda sendiri */
.slide:nth-child(1) {
    background-image: url('https://images.unsplash.com/photo-1495446815901-a7297e633e8d?q=80&w=2070');
}
.slide:nth-child(2) {
    background-image: url('https://images.unsplash.com/photo-1544716278-ca5e3f4abd8c?q=80&w=1974');
}
.slide:nth-child(3) {
    background-image: url('https://images.unsplash.com/photo-1512820790803-83ca734da794?q=80&w=2098');
}
/* ------------------------------- */


/* Pastikan konten teks berada di atas slideshow */
.hero-content {
    position: relative; /* atau position: absolute; */
    z-index: 2; /* Posisikan di depan slideshow */
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Bagian Buku Unggulan & Katalog */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background-color: var(--secondary-color);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
}

.book-card.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.book-card img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.book-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
}

.book-card p {
    font-size: 0.9rem;
    color: #777;
}

/* Bagian Tentang Kami */
.about-us {
    background-color: var(--secondary-color);
    text-align: center;
}
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Bagian Kontak */
.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 2rem auto;
}

.contact-form input, .contact-form textarea {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* ============================================= */
/* 4. FOOTER                                     */
/* ============================================= */

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.admin-link {
    color: var(--secondary-color);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.admin-link:hover {
    opacity: 1;
}

/* ============================================= */
/* 5. HALAMAN LOGIN ADMIN                        */
/* ============================================= */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #f4f4f4, #e0e0e0);
}

body.dark-mode .login-page {
    background: linear-gradient(135deg, #121212, #282828);
}

.login-container {
    perspective: 1000px;
}

.login-box {
    width: 380px;
    padding: 40px;
    background-color: var(--secondary-color);
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.login-title {
    font-family: 'Playfair Display', serif;
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: #888;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
}

.input-group input {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    color: var(--text-color);
    border: none;
    border-bottom: 2px solid #ccc;
    outline: none;
    background: transparent;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 16px;
    color: #888;
    pointer-events: none;
    transition: 0.3s;
}

.input-group input:focus ~ label,
.input-group input:valid ~ label {
    top: -20px;
    left: 0;
    color: var(--accent-color);
    font-size: 12px;
}

.input-group input:focus {
    border-bottom-color: var(--accent-color);
}

.login-btn {
    width: 100%;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.login-message {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    height: 20px;
}

.login-message.success { color: green; }
.login-message.error { color: red; }

/* ============================================= */
/* 6. HALAMAN PENDAFTARAN PENULIS                */
/* ============================================= */

.registration-section {
    padding: 6rem 2rem;
    background-color: var(--bg-color);
}

.registration-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--secondary-color);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.registration-container h2 {
    text-align: center;
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
}

.registration-container p {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #666;
}

body.dark-mode .registration-container p {
    color: #bbb;
}

.registration-form .form-group {
    margin-bottom: 1.5rem;
}

.registration-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

body.dark-mode .registration-form label {
    color: #ddd;
}

.registration-form input[type="text"],
.registration-form input[type="email"],
.registration-form input[type="tel"],
.registration-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Styling khusus untuk input file */
.registration-form input[type="file"] {
    display: none; /* Sembunyikan input file default */
}

.file-upload-label {
    display: inline-block;
    padding: 12px 20px;
    background-color: #333;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-upload-label:hover {
    background-color: var(--accent-color);
}

.file-name {
    margin-left: 15px;
    font-style: italic;
    color: #777;
}

/* Tombol Submit di Tengah */
.registration-form .btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}