/* Custom Properties / Variables */
:root {
    --primary-color: #2c4c3b; /* Deep library green */
    --primary-light: #3e6651;
    --primary-dark: #1b3025;
    --accent-color: #c08552; /* Vintage leather/gold accent */
    --text-main: #2d2825; /* Charcoal warm dark */
    --text-light: #706863;
    --bg-main: #fdfbf7; /* Parchment warm white */
    --bg-light: #f5f2eb; /* Antique paper */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 4px 6px rgba(44,76,59,0.05);
    --shadow-md: 0 10px 20px rgba(44,76,59,0.08);
    --shadow-lg: 0 15px 35px rgba(44,76,59,0.15);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-main);
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.navbar:hover .logo h1, .navbar:hover .nav-links li a {
    color: var(--text-main);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links li a {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.navbar:hover .nav-links li a::after {
    background: var(--primary-color);
}

.nav-links li a:hover::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    top: 100%;
    right: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dropdown-content a {
    color: var(--text-main) !important;
    padding: 12px 16px;
    display: block;
    font-weight: 500 !important;
}

.dropdown-content a::after {
    display: none;
}

.dropdown-content a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color) !important;
}

.dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(44, 76, 59, 0.9) 0%, rgba(27, 48, 37, 0.95) 100%), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
}

.hero-content {
    max-width: 800px;
    color: #fff;
    margin-top: 80px;
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(255,255,255,0.9);
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
    opacity: 0.9;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: var(--primary-dark);
}

/* Sections */
.section {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.divider {
    height: 4px;
    width: 60px;
    background: var(--primary-color);
    margin: 0 auto;
    border-radius: 2px;
}

.section-header p {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Vision Mission */
.vision-mission-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.card {
    background: #fff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.card.mission ul {
    list-style: none;
}

.card.mission ul li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.card.mission ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Catalog / Books */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.book-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.book-cover {
    height: 250px;
    position: relative;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-cover .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.book-info {
    padding: 1.5rem;
}

.book-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--primary-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-info .author {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock {
    font-size: 0.85rem;
    font-weight: 600;
}

.stock.available {
    color: #2a9d8f;
}

.stock.empty {
    color: #e76f51;
}

.btn-sm {
    padding: 0.4rem 1rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-sm:hover {
    background: var(--primary-dark);
}

.text-center {
    text-align: center;
}

/* Staff */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.staff-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.staff-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.staff-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.staff-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.staff-info {
    padding: 2rem;
}

.staff-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.staff-info .role {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--text-main);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.footer-content h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-content p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Animations */
.animate-up {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .nav-links {
        display: none;
    }

    .modal-body {
        flex-direction: column;
    }
    .modal-cover img {
        max-height: 300px;
    }
    .modal-info .badge {
        position: relative;
        top: 0; left: 0;
        display: inline-block;
        margin-bottom: 1rem;
    }
}

/* Modal Detail Buku */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6); 
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-main);
    margin: auto;
    padding: 0;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 800px;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--text-light);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-dark);
    text-decoration: none;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
}

.modal-cover {
    flex: 1 1 300px;
    background: var(--bg-light);
}

.modal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 500px;
}

.modal-info {
    flex: 2 1 400px;
    padding: 3rem 2rem 2rem;
    position: relative;
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.modal-info .author {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.modal-meta p {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.modal-desc {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(44,76,59,0.2);
}

.modal-desc h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.modal-info .badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Search Form */
.search-container {
    margin-bottom: 3rem;
    text-align: center;
}

.search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(44,76,59,0.1);
    border-radius: 50px;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: var(--transition);
    background: #fff;
    color: var(--text-main);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.search-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-clear {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    color: var(--text-main);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-clear:hover {
    background: #e2e2e2;
}

.search-result-text {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.page-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #fff;
    color: var(--text-main);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid rgba(44,76,59,0.1);
}

.page-link:hover:not(.disabled):not(.active) {
    transform: translateY(-2px);
    color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-light);
}
