/* Footer styles */

.footer-modern {
    background: #fff;
    border-top: 1.5px solid var(--divider-color, rgba(2, 6, 23, 0.12));
    box-shadow: var(--box-shadow-light, 0 2px 16px rgba(0,0,0,0.07));
    padding-top: 2.2rem;
    padding-bottom: 1.2rem;
    font-size: 1rem;
    color: var(--background-dark, #1a1a1a);
}

/* ==============================================
   DARK MODE STYLES FOR FOOTER
   ============================================== */

body.dark-mode .footer-modern {
    background: var(--nav-bg, #242424) !important;
    border-top: 1.5px solid var(--border-color, #404040) !important;
    color: var(--text-color, #e0e0e0) !important;
}

body.dark-mode .footer-link {
    color: #93c5fd !important;
}

body.dark-mode .footer-link:hover,
body.dark-mode .footer-link.active {
    color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.15) !important;
}

body.dark-mode .footer-social-link {
    color: #93c5fd !important;
}

body.dark-mode .footer-social-link:hover,
body.dark-mode .footer-social-link:focus {
    color: #60a5fa !important;
}

body.dark-mode .footer-bottom {
    color: #9ca3af !important;
    border-top: 1px solid var(--border-color, #404040) !important;
}

body.dark-mode .footer-top-link {
    color: #93c5fd !important;
}

body.dark-mode .footer-top-link:hover,
body.dark-mode .footer-top-link:focus {
    color: #60a5fa !important;
}

body.dark-mode .footer-divider {
    background: var(--border-color, #404040) !important;
}

/* ==============================================
   END DARK MODE FOOTER STYLES
   ============================================== */

/* Hide footer on book reading pages for better UX - prevents over-scrolling past chapter content */
body.book-reading .footer-modern,
body.book-preview .footer-modern {
    display: none !important;
}

/* Ensure main content area takes full height when footer is hidden */
body.book-reading .page,
body.book-preview .page {
    min-height: 100vh;
}

body.book-reading main,
body.book-preview main {
    min-height: calc(100vh - 75px); /* Account for top navigation */
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    padding: 0 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.footer-logo {
    height: 44px;
    width: auto;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: center;
    align-items: center;
    flex: 1 1 300px;
}

.footer-link {
    color: var(--primary-color, #00B4FF);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
}

.footer-link:hover,
.footer-link.active,
.footer-link.active:link,
.footer-link.active:visited,
.footer-link.active:hover,
.footer-link.active:focus,
.active.footer-link {
    color: var(--primary-color, #00B4FF);
    background: rgba(0, 180, 255, 0.09);
}

.footer-social {
    display: flex;
    gap: 1.1rem;
    align-items: center;
}

.footer-social-link {
    color: var(--primary-color, #00B4FF);
    font-size: 2rem;
    transition: color 0.18s, transform 0.18s;
    display: flex;
    align-items: center;
    outline: none;
}

.footer-social-link:focus {
    color: var(--primary-color, #00B4FF);
    background: rgba(0, 180, 255, 0.09);
    border-radius: 0.4rem;
}

.footer-social-link:hover {
    color: var(--primary-color, #00B4FF);
    transform: scale(1.12);
}

.footer-bottom {
    text-align: center;
    color: #888;
    font-size: 0.98rem;
    margin-top: 1.5rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--divider-color, rgba(2, 6, 23, 0.12));
    letter-spacing: 0.01em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.footer-top-link {
    color: var(--primary-color, #00B4FF);
    font-size: 0.98rem;
    text-decoration: none;
    margin-left: 0.7rem;
    transition: color 0.18s;
    font-weight: 600;

    /* Allow rendering as <button> without default chrome */
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    appearance: none;
}

.footer-top-link:hover,
.footer-top-link:focus {
    color: var(--primary-color, #00B4FF);
    text-decoration: underline;
}

.footer-divider {
    display: none;
}

@media (min-width: 900px) {
    .footer-divider {
        display: block;
        width: 1px;
        height: 44px;
        background: var(--divider-color, rgba(2, 6, 23, 0.12));
        margin: 0 1.5rem;
        border-radius: 1px;
        align-self: center;
    }
}
