/* ---------------------------------- */
/* 1. General & Typography            */
/* ---------------------------------- */
body {
    font-family: 'Lato', sans-serif;
    background-color: #F9FAFB;
    color: #212529;
    margin: 0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: #1F2937;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 90%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.container_books {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    box-sizing: border-box;
}

.card-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on mobile. */
}

@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
        /* 4 columns on tablet. */
    }
}

@media (min-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(5, 1fr);
        /* 5 columns on desktop. */
    }
}

.book-card {
    text-align: center;
}

.book-card .card-content {
    background-color: var(--bg-white);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px var(--shadow-color);
    transition: transform 0.3s ease;
}

.book-card .card-content:hover {
    transform: translateY(-0.5rem);
    /* Lifts the card on hover */
}

.book-card img {
    width: 100%;
    height: auto;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    margin-bottom: 1rem;
}

.book-card h3 {
    font-weight: 700;
    font-size: 1.125rem;
}

.book-card p {
    color: var(--text-muted);
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease-in-out forwards;
    opacity: 0;
    /* The element starts transparent before the animation begins. */
}

/* --- Accessibility: Reduced Motion --- */
/* Disables animations for users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {

    .animate-slide-in-up,
    .animate-fade-in,
    .animate-fade-out {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* ---------------------------------- */
/* 2. Navigation Bar                  */
/* ---------------------------------- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: background-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

#main-nav .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#main-nav .logo-img {
    height: 3rem; /* 40px */
}

/* Nav States */
#main-nav.nav-top {
    background-color: transparent;
}
#main-nav.nav-scrolled,
#main-nav.inner-page-nav {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Desktop Menu */
.desktop-menu {
    display: none;
    gap: 2rem;
}
@media (min-width: 768px) {
    .desktop-menu {
        display: flex;
    }
}

.desktop-menu .nav-link {
    position: relative;
    font-size: 1.125rem;
    font-weight: 600;
    transition: color 0.3s ease;
}
.nav-top .nav-link {
    color: white;
}
.nav-scrolled .nav-link,
.inner-page-nav .nav-link {
    color: #0D47A1;
}
.nav-link:hover {
    color: #FF6F00;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #FF6F00;
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}
.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-button {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
}
@media (min-width: 768px) {
    .mobile-menu-button {
        display: none;
    }
}
.nav-top .mobile-menu-button svg {
    stroke: white;
}
.nav-scrolled .mobile-menu-button svg,
.inner-page-nav .mobile-menu-button svg {
    stroke: #1F2937;
}

#mobile-menu {
    display: none;
    background-color: white;
    margin-top: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    overflow: hidden;
}
#mobile-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #111827;
}
#mobile-menu a:hover {
    background-color: #F3F4F6;
}

/* ---------------------------------- */
/* 3. Hero Sections                 */
/* ---------------------------------- */
/* Homepage Carousel */
#hero-carousel {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}
.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}
.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}
.carousel-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}
#hero-carousel .carousel-content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 1rem;
}
.carousel-content h1 { color: white; font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.carousel-content p { font-size: 1.125rem; margin-bottom: 2rem; max-width: 42rem; }
@media (min-width: 768px) {
    .carousel-content h1 { font-size: 3.75rem; }
    .carousel-content p { font-size: 1.25rem; }
}

/* Carousel Navigation Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}
.carousel-arrow:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
.carousel-arrow.prev {
    left: 1.5rem;
}
.carousel-arrow.next {
    right: 1.5rem;
}
.carousel-arrow svg {
    width: 1.75rem;
    height: 1.75rem;
    color: white;
}


/* Inner Page Hero */
.page-hero {
    padding: 6rem 0;
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
}
.page-hero h1 { font-size: 2.5rem; font-weight: 700; color: white; }
.page-hero p { font-size: 1.125rem; margin-top: 1rem; max-width: 42rem; margin-left: auto; margin-right: auto; }
@media (min-width: 768px) {
    .page-hero { padding: 8rem 0; }
    .page-hero h1 { font-size: 3.75rem; }
    .page-hero p { font-size: 1.25rem; }
}

/* ---------------------------------- */
/* 4. Page Sections & Cards           */
/* ---------------------------------- */
.section {
    padding: 4rem 0;
}
.section.bg-white {
    background-color: white;
}
@media (min-width: 768px) {
    .section { padding: 6rem 0; }
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-size: 2.25rem;
    font-weight: 700;
}
.section-title p {
    font-size: 1.125rem;
    color: #4B5563;
    margin-top: 1rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .section-title h2 { font-size: 3rem; }
}

/* Feature Cards (Homepage) */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
}
.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.feature-card .icon-wrapper svg,
.feature-card h3 {
    transition: color 0.3s ease-in-out; /* Add transition to icon and title */
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.feature-card:hover .icon-wrapper svg {
    color: #FF6F00 !important; /* Force color change on hover */
}

.feature-card:hover h3 {
    color: #FF6F00; /* Change title color on hover */
}
.feature-card .icon-wrapper {
    display: inline-flex;
    padding: 1.25rem;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}
.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}
.feature-card p {
    color: #4B5563;
}

/* Book Cards (Homepage & Books Page) */
.book-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
@media (min-width: 640px) { .book-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .book-grid { grid-template-columns: repeat(5, 1fr); } }

.book-card {
    cursor: pointer;
    text-align: center;
}
.book-card .cover-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.book-card .book-cover-image {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}
.book-card:hover .book-cover-image {
    transform: scale(1.05);
}
.book-card .quick-view-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.book-card:hover .quick-view-overlay {
    opacity: 1;
}
.book-card .quick-view-overlay span {
    color: white;
    font-weight: 700;
    border: 2px solid white;
    border-radius: 9999px;
    padding: 0.5rem 1.5rem;
}
.book-card h4 {
    font-weight: 700;
    font-size: 1.125rem;
    margin-top: 1rem;
    transition: color 0.3s;
}
.book-card:hover h4 {
    color: #FF6F00;
}
.book-card p {
    font-size: 0.875rem;
    color: #6B7280;
}

/* About Section (Homepage) */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 768px) {
    .about-grid { grid-template-columns: repeat(2, 1fr); }
}
.about-grid img {
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    width: 100%;
}
.about-grid h2 { font-size: 2.25rem; margin-bottom: 1.5rem; }
.about-grid p { font-size: 1.125rem; color: #4B5563; margin-bottom: 1rem; }
.about-grid .btn-primary { margin-top: 1rem; }

/* ---------------------------------- */
/* 5. Page-Specific Components        */
/* ---------------------------------- */
/* Books Page: Filters */
.filter-section {
    padding: 2.5rem 0;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 42rem;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .filter-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}
.custom-select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #F9FAFB;
    font-size: 1rem;
    border: 2px solid #E5E7EB;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.custom-select:focus {
    border-color: #0D47A1;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.2);
    outline: none;
}

/* Manuals Page */
.manuals-container .subject-section {
    margin-bottom: 4rem;
}
.manuals-container .subject-title {
    font-size: 1.875rem;
    border-bottom: 2px solid #009688;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}
.manuals-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 640px) { .manuals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .manuals-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .manuals-grid { grid-template-columns: repeat(4, 1fr); } }

.manual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: all 0.3s ease;
}
.manual-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
.manual-card .manual-icon { color: #009688; margin-bottom: 1rem; }
.manual-card .manual-title-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    height: 3.5rem;
}
.manual-card h4 { line-height: 1.4; }
.manual-card .download-button { margin-top: auto; }

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
@media (min-width: 1024px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }

.contact-form-wrapper {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.contact-form-wrapper h2 { font-size: 1.875rem; margin-bottom: 1.5rem; }
.contact-form-wrapper form { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-form-wrapper label { display: block; font-size: 1rem; font-weight: 500; margin-bottom: 0.25rem; }
.contact-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.375rem;
    padding: 0.75rem;
    border: 2px solid #E5E7EB;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.contact-input:focus {
    border-color: #FF6F00;
    box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.2);
    outline: none;
}

.contact-details-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.contact-details-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.contact-details-item .icon-wrapper {
    flex-shrink: 0;
    padding: 1rem;
    border-radius: 50%;
}
.contact-details-item h3 { font-size: 1.5rem; }
.contact-details-item p { color: #4B5563; font-size: 1.125rem; }

.map-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    background-color: white;
}
.map-container iframe {
    width: 100%;
    height: 24rem;
    border-radius: 0.5rem;
    border: 0;
}
@media (min-width: 768px) { .map-container iframe { height: 32rem; } }

/* ---------------------------------- */
/* 6. Footer                        */
/* ---------------------------------- */
.footer {
    background-color: #1F2937;
    color: white;
    padding: 4rem 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.footer h3 { font-size: 1.5rem; color: white; }
.footer h4 { font-size: 1.125rem; color: white; margin-bottom: 1rem; }
.footer p, .footer a { color: #9CA3AF; }
.footer a:hover { color: white; }
.footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer .social-links { flex-direction: row; gap: 1rem; }
.footer .social-links a { transition: transform 0.3s; }
.footer .social-links a:hover { transform: scale(1.1); }

.footer-map-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #374151;
}
.footer-map-container h4 {
    text-align: center;
}
.footer-map-container iframe {
    width: 100%;
    height: 250px;
    border-radius: 0.5rem;
    border: 0;
}

.footer .copyright {
    border-top: 1px solid #374151;
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
}

/* ---------------------------------- */
/* 7. Utility Classes                 */
/* ---------------------------------- */
.btn-primary {
    display: inline-block;
    background-color: #FF6F00;
    color: white;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: #E66000;
    transform: scale(1.05);
}

/* Scroll Reveal Animation */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-slide-in-up.is-visible {
    opacity: 1;
}

