:root { --primary-teal: #00897B; --secondary-dark: #004D40; --background-light: #E0F2F1; }
* { box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background-color: var(--background-light); margin: 0; display: flex; flex-direction: column; min-height: 100vh; }
.container { width: 92%; margin: 0 auto; max-width: 1400px; }

header { background-color: var(--secondary-dark); padding: 5px 40px; min-height: 90px; position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; border-bottom: 3px solid var(--primary-teal); }
.navbar { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo-container { display: flex; flex-direction: row-reverse; align-items: center; gap: 15px; text-decoration: none; color: white !important; }
.logo-img { height: 65px; width: auto; }
.logo-text { font-size: 1.8em; font-weight: 800; letter-spacing: 1px; }

.nav-links { display: flex; align-items: center; gap: 10px; }
.nav-item { color: white !important; font-weight: 600; font-size: 0.75em; text-transform: uppercase; padding: 8px 15px; border: 1.2px solid rgba(255, 255, 255, 0.4); border-radius: 4px; text-decoration: none; transition: 0.3s; }
.nav-item:hover { background-color: white !important; color: var(--secondary-dark) !important; }

.user-profile { position: relative; cursor: pointer; display: flex; align-items: center; color: white; gap: 10px; padding-left: 15px; border-left: 1px solid rgba(255,255,255,0.2); }
.user-avatar-small { width: 38px; height: 38px; border-radius: 50%; border: 2px solid white; object-fit: cover; }
.profile-dropdown { display: none; position: absolute; top: 110%; right: 0; background: white; min-width: 190px; box-shadow: 0 8px 16px rgba(0,0,0,0.2); border-radius: 5px; z-index: 2001; }
.profile-dropdown a { display: block; padding: 12px 15px; color: #333; text-decoration: none; font-size: 0.85em; border-bottom: 1px solid #eee; text-align: left; }

.library-container { display: grid; gap: 20px; margin: 30px 0; grid-template-columns: repeat(5, 1fr); }
.book-card { text-align: center; position: relative; border-radius: 8px; overflow: hidden; }
.image-wrapper { position: relative; width: 100%; height: 260px; border-radius: 8px; overflow: hidden; border: 3px solid #B2DFDB; }
.book-cover { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }

.read-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 77, 64, 0.8); opacity: 0; display: flex; justify-content: center; align-items: center; transition: 0.3s; z-index: 5; }
.book-card:hover .read-overlay { opacity: 1; }
.overlay-btn { background: var(--primary-teal); color: white; padding: 10px 22px; border-radius: 30px; border: none; cursor: pointer; font-weight: 600; transition: 0.2s; }

.audio-player-box { position: absolute; bottom: 0; left: 0; width: 100%; height: 0; background: #fff; overflow: hidden; transition: 0.3s; z-index: 10; }
.audio-active .audio-player-box { height: 45px; }
.player-mask { position: absolute; top: 0; right: 0; background: transparent; z-index: 2010; }

.video-popup-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 2000; align-items: center; justify-content: center; }
.video-window { width: 340px; height: 580px; background: #000; border-radius: 15px; position: relative; overflow: hidden; border: 2.5px solid var(--primary-teal); }

#loginAlertModal { display: none !important; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; }
.popup-box { background: white; width: 350px; padding: 25px; border-radius: 12px; text-align: center; }

/* PDF Modal Fix */
#pdfModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 9999; flex-direction: column; }
#modalHeader { width: 100%; background: #004D40; color: white; padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; }
.iframe-container { flex: 1; position: relative; width: 100%; height: 100%; }

footer { background-color: var(--secondary-dark); color: white; padding: 12px 0; margin-top: auto; border-top: 3px solid var(--primary-teal); width: 100%; }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-line-one { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.75em; flex-wrap: wrap; }
.footer-line-one a { color: white !important; text-decoration: none; }
.footer-divider { opacity: 0.3; margin: 0 2px; }
.footer-line-two { font-size: 0.65em; opacity: 0.7; }

@media (max-width: 768px) {
    header { height: auto !important; min-height: 120px !important; padding: 15px 10px !important; }
    .navbar { flex-direction: column !important; gap: 10px !important; }
    .logo-img { height: 50px !important; }
    .logo-text { font-size: 1.3em !important; }
    .nav-links { width: 100% !important; justify-content: center !important; flex-wrap: wrap !important; gap: 5px !important; }
    .library-container { grid-template-columns: repeat(2, 1fr) !important; gap: 15px !important; padding: 10px !important; }
    .image-wrapper { height: 210px !important; }
}