@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --green: #27ae60; --dark-green: #219150; --bg-color: #f7f7f7;
    --text-main: #444; --text-light: #666; --card-bg: #fff;
    --border: 1px solid rgba(0,0,0,0.1); --shadow: 0 .5rem 1rem rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-color: #1a1a1a; --text-main: #f1f1f1; --text-light: #bbb;
    --card-bg: #2a2a2a; --border: 1px solid rgba(255,255,255,0.1); --shadow: 0 .5rem 1rem rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; text-decoration: none; transition: background-color 0.3s, color 0.3s; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body { background: var(--bg-color); color: var(--text-main); display: flex; flex-direction: column; min-height: 100vh; }
section { padding: 5rem 9%; } main { flex: 1; }
.heading { text-align: center; margin-bottom: 3rem; }
.heading span { font-size: 3rem; color: var(--text-main); border-bottom: 3px solid var(--green); padding-bottom: 0.5rem; }
.btn { display: inline-block; padding: 1rem 3rem; border-radius: 0.5rem; color: #fff; background: var(--green); font-size: 1.7rem; cursor: pointer; border: none; }
.btn:hover { background: var(--dark-green); }

/* Header */
.header { background: var(--card-bg); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 1000; }
.header-1 { display: flex; justify-content: space-between; align-items: center; padding: 2rem 9%; }
.logo { font-size: 2.5rem; font-weight: 600; color: var(--text-main); }
.logo i { color: var(--green); }
.search-form { display: flex; align-items: center; background: var(--bg-color); border-radius: 5rem; padding: 0.5rem 2rem; width: 40rem; position: relative; }
.search-form input { background: transparent; border: none; font-size: 1.6rem; width: 100%; outline: none; color: var(--text-main); }
.search-form label { font-size: 2rem; color: var(--text-light); cursor: pointer; }
.icons i, .icons a { font-size: 2.5rem; color: var(--text-main); margin-left: 2rem; cursor: pointer; }
.icons i:hover, .icons a:hover { color: var(--green); }
.navbar { display: flex; justify-content: center; background: var(--green); }
.navbar a { color: #fff; font-size: 1.6rem; padding: 1.5rem 3rem; }
.navbar a:hover, .navbar a.active { background: var(--dark-green); }

/* --- NEW: Live Search Dropdown --- */
.search-results-container { position: absolute; top: 120%; left: 0; width: 100%; background: var(--card-bg); border-radius: 1rem; box-shadow: var(--shadow); max-height: 350px; overflow-y: auto; z-index: 1001; border: var(--border); }
.search-results-container.hidden { display: none; }
.search-item { padding: 1.5rem; border-bottom: var(--border); display: flex; align-items: center; gap: 1.5rem; cursor: pointer; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-color); }
.search-item img { width: 40px; height: 60px; object-fit: cover; border-radius: 0.5rem; }
.search-item h4 { font-size: 1.4rem; color: var(--text-main); margin-bottom: 0.2rem; }
.search-item p { font-size: 1.2rem; color: var(--text-light); }

/* Hero & General Components */
.shelf-container { position: relative; margin: 4rem auto; max-width: 800px; padding-top: 5rem;}
.spotlight { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 300px; height: 300px; background: radial-gradient(ellipse at top, rgba(255, 255, 200, 0.5) 0%, transparent 70%); pointer-events: none; z-index: 10; }
body.dark-mode .spotlight { background: radial-gradient(ellipse at top, rgba(255, 255, 200, 0.15) 0%, transparent 70%); }
.shelf { border-bottom: 15px solid #444; border-radius: 3px; position: relative; box-shadow: 0 10px 15px rgba(0,0,0,0.2); }
.shelf::before { content: ''; position: absolute; top: 15px; left: 0; width: 100%; height: 10px; background: #222; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr)); gap: 2rem; }
.book-card { background: var(--card-bg); border-radius: 1rem; padding: 2rem; text-align: center; border: var(--border); position: relative; }
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.book-card img { height: 20rem; object-fit: cover; margin-bottom: 1.5rem; border-radius: 0.5rem; }
.book-card h3 { font-size: 1.8rem; color: var(--text-main); margin-bottom: 1rem; }
.fav-btn { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2rem; color: #ccc; cursor: pointer; background: var(--card-bg); padding: 0.5rem; border-radius: 50%; z-index: 5; }
.fav-btn.active { color: #e74c3c; }
.filter-menu { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn { background: var(--card-bg); border: var(--border); padding: 1rem 2rem; font-size: 1.5rem; color: var(--text-main); cursor: pointer; border-radius: 5rem; }
.filter-btn.active, .filter-btn:hover { background: var(--green); color: #fff; }
.featured-widget { display: flex; align-items: center; gap: 3rem; background: var(--card-bg); border: var(--border); border-radius: 1rem; padding: 4rem; margin: 4rem 9%; box-shadow: var(--shadow); }
.featured-widget img { max-width: 300px; border-radius: 1rem; }
.featured-content h2 { font-size: 3rem; color: var(--green); margin-bottom: 1rem; }
.featured-content p { font-size: 1.5rem; color: var(--text-light); line-height: 1.8; margin-bottom: 2rem; }

/* Book Modal UI */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 2000; opacity: 1; transition: opacity 0.3s ease; backdrop-filter: blur(5px); }
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-content { background: var(--card-bg); border-radius: 1.5rem; width: 90%; max-width: 800px; position: relative; padding: 4rem; transform: translateY(0); transition: transform 0.3s ease; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.modal-overlay.hidden .modal-content { transform: translateY(30px); }
.close-btn { position: absolute; top: 1.5rem; right: 2.5rem; font-size: 3.5rem; color: var(--text-light); cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: #e74c3c; transform: scale(1.1); }
.modal-body { display: flex; gap: 4rem; align-items: flex-start; flex-wrap: wrap; }
.modal-body img { width: 250px; border-radius: 1rem; box-shadow: var(--shadow); }
.modal-info { flex: 1; min-width: 300px; }
.modal-info h2 { font-size: 3rem; color: var(--text-main); margin-bottom: 0.5rem; }
.modal-info .author-line { font-size: 1.4rem; color: var(--green); font-weight: 500; margin-bottom: 2rem; }
.modal-info .description { font-size: 1.5rem; color: var(--text-light); line-height: 1.8; margin-bottom: 3rem; }
.modal-actions { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.btn.outline { background: transparent; border: 2px solid var(--green); color: var(--green); }
.btn.outline:hover { background: var(--green); color: #fff; }

/* Footer */
.footer { background: var(--card-bg); border-top: var(--border); padding: 5rem 9% 2rem; margin-top: auto; }
.footer .box-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr)); gap: 3rem; }
.footer h3 { font-size: 2.2rem; color: var(--text-main); margin-bottom: 2rem; }
.footer a { display: block; font-size: 1.5rem; color: var(--text-light); margin-bottom: 1rem; }
.footer a:hover { color: var(--green); padding-left: 1rem; }
.social-icons a { display: inline-block; font-size: 2rem; color: #fff; background: var(--green); width: 4rem; height: 4rem; line-height: 4rem; text-align: center; border-radius: 50%; margin-right: 1rem; }
.social-icons a:hover { background: var(--dark-green); transform: scale(1.1); }
.credit { text-align: center; font-size: 1.5rem; color: var(--text-light); border-top: var(--border); padding-top: 2rem; margin-top: 3rem; }

/* Loader */
.loader-container { position: fixed; inset: 0; background: var(--bg-color); display: flex; justify-content: center; align-items: center; z-index: 10000; transition: opacity 0.5s ease; }
.loader-container.hidden { opacity: 0; pointer-events: none; }
.book-loader { width: 80px; height: 60px; position: relative; perspective: 400px; }
.book-loader .cover { position: absolute; width: 50%; height: 100%; background: var(--green); border-radius: 2px; }
.book-loader .cover.left { left: 0; }
.book-loader .cover.right { right: 0; }
.book-loader .page { position: absolute; right: 50%; width: 50%; height: 96%; top: 2%; background: #fff; border: 1px solid #ddd; transform-origin: right; border-radius: 2px; animation: shuffle 1.5s infinite linear; }
.book-loader .page:nth-child(3) { animation-delay: 0.2s; }
.book-loader .page:nth-child(4) { animation-delay: 0.4s; }
.book-loader .page:nth-child(5) { animation-delay: 0.6s; }
@keyframes shuffle { 0% { transform: rotateY(0deg); z-index: 10; } 100% { transform: rotateY(-180deg); z-index: 1; } }

/* ==========================================
   --- EXPLORE PAGE SPECIFICS ---
========================================== */
.mission-row { display: flex; flex-wrap: wrap; gap: 4rem; align-items: center; }
.mission-content { flex: 1 1 40rem; }
.mission-content h3 { font-size: 3rem; color: var(--green); margin-bottom: 1.5rem; }
.mission-content p { font-size: 1.6rem; color: var(--text-light); line-height: 1.8; margin-bottom: 1.5rem; }
.mission-image { flex: 1 1 40rem; }
.mission-image img { width: 100%; border-radius: 1rem; box-shadow: var(--shadow); }

.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 2rem; text-align: center; background: var(--green); padding: 4rem 2rem; border-radius: 1rem; color: #fff; margin-top: 4rem; }
.stat-box i { font-size: 4rem; margin-bottom: 1rem; }
.stat-box h3 { font-size: 3.5rem; margin-bottom: 0.5rem; }
.stat-box p { font-size: 1.5rem; font-weight: 300; }

.timeline { border-left: 3px solid var(--green); padding-left: 3rem; margin-left: 2rem; position: relative; }
.timeline-item { margin-bottom: 4rem; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -4.1rem; top: 0; width: 2rem; height: 2rem; background: var(--green); border-radius: 50%; border: 4px solid var(--bg-color); }
.timeline-item h3 { font-size: 2.2rem; color: var(--text-main); margin-bottom: 1rem; }
.timeline-item span { display: inline-block; padding: 0.5rem 1rem; background: var(--card-bg); border: var(--border); border-radius: 5rem; font-size: 1.2rem; color: var(--green); margin-bottom: 1rem; font-weight: 600; }
.timeline-item p { font-size: 1.5rem; color: var(--text-light); line-height: 1.7; }

/* ==========================================
   --- SUPPORT PAGE SPECIFICS ---
========================================== */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr)); gap: 2rem; margin-bottom: 5rem; }
.contact-card { background: var(--card-bg); border: var(--border); border-radius: 1rem; padding: 3rem 2rem; text-align: center; box-shadow: var(--shadow); transition: transform 0.3s; }
.contact-card:hover { transform: translateY(-5px); border-color: var(--green); }
.contact-card i { font-size: 4rem; color: var(--green); margin-bottom: 1.5rem; }
.contact-card h3 { font-size: 2rem; color: var(--text-main); margin-bottom: 1rem; }
.contact-card p { font-size: 1.4rem; color: var(--text-light); }

.faq-container { max-width: 80rem; margin: 0 auto 5rem; }
.faq-container details { background: var(--card-bg); border: var(--border); border-radius: 0.5rem; margin-bottom: 1rem; overflow: hidden; }
.faq-container summary { font-size: 1.6rem; color: var(--text-main); font-weight: 500; padding: 2rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-container summary::-webkit-details-marker { display: none; }
.faq-container summary::after { content: '\f078'; font-family: 'Font Awesome 5 Free'; font-weight: 900; color: var(--green); transition: transform 0.3s; }
.faq-container details[open] summary::after { transform: rotate(180deg); }
.faq-container details p { padding: 0 2rem 2rem; font-size: 1.4rem; color: var(--text-light); line-height: 1.8; border-top: 1px solid rgba(0,0,0,0.05); margin-top: 1rem; padding-top: 1.5rem; }