/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
    cursor: pointer;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #667eea;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Books Section */
.books-section {
    background: white;
    padding: 3rem 0;
    min-height: 70vh;
}

/* About Section */
.about-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 4rem 0;
    scroll-margin-top: 80px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: #667eea;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.about-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about-text h3:first-child {
    margin-top: 0;
}

.about-text p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.feature-list,
.audience-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li,
.audience-list li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.feature-list li::before {
    content: "✨";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.audience-list li::before {
    content: "📖";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.contact-info {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin: 1.5rem 0;
}

.contact-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.about-cta {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.about-cta .btn-primary {
    display: inline-block;
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-button {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.tab-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.book-cover {
    width: 100%;
    aspect-ratio: 896 / 1280;
    object-fit: cover;
    display: block;
}

.book-info {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.3;
}

.book-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-duration {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 0;
    box-sizing: border-box;
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
}

/* For shorter screens, align to flex-start to ensure content is visible */
@media (max-height: 700px) {
    .modal.show {
        align-items: flex-start !important;
        padding: 20px;
    }
}

/* For mobile devices with limited height, prioritize content visibility */
@media (max-width: 768px) and (max-height: 900px) {
    .modal.show {
        align-items: flex-start !important;
        padding: 10px;
    }
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: auto;
    flex-shrink: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.modal-cover {
    width: 200px;
    height: 286px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 auto 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.modal-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.modal-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-meta {
    margin-bottom: 2rem;
    color: #999;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Reading Interface */
.reading-interface {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile browsers */
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    z-index: 2000;
    color: white;
    flex-direction: column;
    overflow: hidden;
}

.reading-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2001;
}

.return-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.return-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.page-indicator {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 1rem 0 0 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-self: center;
}

/* Book Container - Simplified without animations */
.book-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    position: relative;
    gap: 2rem;
    overflow-y: auto;
    min-height: 0;
}

/* Single page display */
.page-display {
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    flex: 1;
    min-height: 0;
    overflow: visible;
    position: relative;
}

/* Navigation buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-button:hover {
    background: rgba(102, 126, 234, 1);
    transform: translateY(-50%) scale(1.1);
}

.nav-button:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-button.prev {
    left: 10px;
}

.nav-button.next {
    right: 10px;
}

.nav-button:disabled {
    background: rgba(150, 150, 150, 0.5);
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-button:disabled:hover {
    transform: translateY(-50%) scale(1);
}

/* Click zones for left/right navigation */
.click-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 5;
    cursor: pointer;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.click-zone.left-zone {
    left: 0;
    cursor: w-resize;
}

.click-zone.right-zone {
    right: 0;
    cursor: e-resize;
}

/* Visual feedback on hover/touch - subtle overlay */
.click-zone:hover {
    background: rgba(0, 0, 0, 0.02);
}

.click-zone:active {
    background: rgba(0, 0, 0, 0.05);
}

/* Disable click zones when navigation buttons are disabled */
.click-zone.disabled {
    pointer-events: none;
    cursor: default;
}

.page-image {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.page-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    text-align: justify;
    padding: 1rem 2rem;
    max-width: 700px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.reading-controls {
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 2001;
    min-height: 80px;
    flex-shrink: 0;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    margin: 0 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 80px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

/* Tablet and smaller desktop styles */
@media (max-width: 1024px) {
    .book-container {
        padding: 1.5rem;
    }

    .page-display {
        max-width: 700px;
        padding: 1.5rem;
    }

    .reading-controls {
        padding: 0.875rem 1.5rem;
    }
}

/* Mobile adaptations for click zones */
@media (max-width: 768px) {
    .click-zone {
        /* Ensure click zones work well on touch devices */
        min-height: 44px; /* iOS recommended minimum touch target */
    }
    
    .click-zone:hover {
        /* Remove hover effects on touch devices */
        background: transparent;
    }
    
    .click-zone:active {
        background: rgba(0, 0, 0, 0.08);
    }
}

/* Mobile and tablet styles */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    /* About Section Mobile */
    .section-title {
        font-size: 2rem;
    }

    .about-content {
        padding: 2rem 1.5rem;
    }

    .about-text h3 {
        font-size: 1.3rem;
    }

    .about-text p {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        max-height: calc(100vh - 20px);
        border-radius: 15px;
    }

    .modal-body {
        padding: 1.5rem;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .modal-cover {
        width: 150px;
        height: 214px;
    }

    /* Mobile Reading Interface */
    .reading-header {
        padding: 1rem;
    }

    .return-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .page-indicator {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
        margin: 0.75rem 0 0 0;
    }

    .book-container {
        padding: 1rem;
        gap: 1rem;
    }

    .page-display {
        padding: 1.25rem;
        max-width: 600px;
        flex: 1;
        min-height: 0;
    }

    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .nav-button.prev {
        left: 5px;
    }

    .nav-button.next {
        right: 5px;
    }

    .page-image {
        max-height: 40vh;
    }

    .page-text {
        font-size: 1rem;
        padding: 1rem;
        flex: 1;
        min-height: 0;
    }

    .reading-controls {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        min-height: 70px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .progress-container {
        margin: 0 0.5rem;
        flex: 1;
        min-width: 120px;
    }

    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: 60px;
    }

    .footer-content {
        text-align: center;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 2rem 0;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    /* About Section Small Mobile */
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .about-content {
        padding: 1.5rem 1rem;
    }

    .about-text h3 {
        font-size: 1.2rem;
        margin-top: 1.5rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .feature-list li,
    .audience-list li {
        font-size: 0.95rem;
        padding: 0.5rem 0 0.5rem 1.75rem;
    }

    /* Modal adjustments for very small screens */


    .modal-content {
        width: 98%;
        max-height: calc(100vh - 10px);
        border-radius: 10px;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 40px);
    }

    .modal-cover {
        width: 120px;
        height: 171px;
        margin-bottom: 1rem;
    }

    .modal-info h3 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .modal-info p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .modal-meta {
        margin-bottom: 1.5rem;
        font-size: 0.85rem;
    }

    .btn-primary {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
    }

    .reading-header {
        padding: 0.75rem 1rem;
    }

    .return-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .page-display {
        padding: 0.75rem;
        flex: 1;
        min-height: 0;
    }

    .page-image {
        max-height: 30vh;
        margin-bottom: 0.75rem;
    }

    .page-indicator {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
        margin: 0.5rem 0 0 0;
    }

    .page-text {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        flex: 1;
        min-height: 0;
        line-height: 1.6;
    }

    .nav-button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .nav-button.prev {
        left: 2px;
    }

    .nav-button.next {
        right: 2px;
    }

    .reading-controls {
        padding: 0.5rem 0.75rem;
        min-height: 60px;
        gap: 0.25rem;
    }

    .control-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        min-width: 50px;
    }

    .progress-container {
        margin: 0 0.25rem;
        min-width: 100px;
    }

    .progress-bar {
        height: 6px;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.tab-button:focus,
.book-card:focus,
.btn-primary:focus,
.nav-btn:focus,
.control-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Very small screens and landscape mobile */
@media (max-width: 360px) {
    /* Modal adjustments for extremely small screens */


    .modal-content {
        width: 99%;
        max-height: calc(100vh - 4px);
        border-radius: 8px;
    }

    .modal-body {
        padding: 0.75rem;
        max-height: calc(100vh - 30px);
    }

    .modal-cover {
        width: 100px;
        height: 143px;
        margin-bottom: 0.75rem;
    }

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

    .modal-info p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }

    .modal-meta {
        margin-bottom: 1rem;
        font-size: 0.8rem;
    }

    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .close {
        right: 15px;
        top: 15px;
        font-size: 1.5rem;
    }

    .reading-header {
        padding: 0.5rem 0.75rem;
    }

    .return-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .page-display {
        padding: 0.5rem;
        flex: 1;
        min-height: 0;
    }

    .page-image {
        max-height: 25vh;
        margin-bottom: 0.5rem;
    }

    .page-indicator {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        margin: 0.25rem 0 0 0;
    }

    .page-text {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
        flex: 1;
        min-height: 0;
    }

    .nav-button {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .nav-button.prev {
        left: 1px;
    }

    .nav-button.next {
        right: 1px;
    }

    .reading-controls {
        padding: 0.4rem 0.5rem;
        min-height: 50px;
        gap: 0.2rem;
    }

    .control-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        min-width: 45px;
    }

    .progress-container {
        margin: 0 0.2rem;
        min-width: 80px;
    }

    .progress-bar {
        height: 5px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .reading-header {
        padding: 0.5rem 1rem;
    }

    .book-container {
        padding: 0.5rem 1rem;
    }

    .page-display {
        padding: 0.75rem;
        flex: 1;
        min-height: 0;
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-image {
        max-height: 30vh;
        max-width: 40%;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .page-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .page-indicator {
        margin: 0.5rem 0 0 0;
        align-self: center;
    }

    .page-text {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .reading-controls {
        padding: 0.5rem 1rem;
        min-height: 60px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .book-card {
        border: 2px solid #333;
    }

    .tab-button {
        border-color: #333;
    }

    .page-indicator {
        background: rgba(255, 255, 255, 1);
        border: 2px solid #333;
    }
}

/* All Books Page Styles */
.page-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    color: white;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-description {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.all-books-section {
    background: white;
    padding: 3rem 0 4rem;
    min-height: 70vh;
}

.books-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.book-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.book-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem;
    gap: 2rem;
    align-items: flex-start;
}

.book-cover-wrapper {
    flex-shrink: 0;
    width: 180px;
}

.book-cover-wrapper .book-cover {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.book-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.book-details .book-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #667eea;
    margin: 0;
}

.book-details .book-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
}

.book-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #777;
    margin-top: 0.75rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.book-meta .book-duration,
.book-meta .book-pages {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    line-height: 1;
}

/* Individual Book Page Styles */
.book-page {
    background: white;
    padding: 3rem 0;
}

.book-header {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.book-cover-large {
    flex-shrink: 0;
    width: 320px;
}

.cover-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.book-info-section {
    flex: 1;
}

.book-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1rem;
}

.book-page-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.5rem;
}

.book-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: #777;
}

.btn-start-reading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-start-reading:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.story-pages-section {
    margin-top: 4rem;
}

.section-heading {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.story-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.story-page-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.story-page-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.page-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.75rem;
}

.story-page-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.story-page-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.book-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 1.2rem 2.5rem;
    font-size: 1.15rem;
}

/* Mobile Responsive Styles for New Pages */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .book-link {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .book-cover-wrapper {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .book-details .book-title {
        font-size: 1.5rem;
    }

    .book-details .book-description {
        font-size: 0.95rem;
    }

    .book-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .book-header {
        flex-direction: column;
        gap: 2rem;
    }

    .book-cover-large {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .book-page-title {
        font-size: 2rem;
    }

    .book-page-description {
        font-size: 1rem;
    }

    .book-page-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .story-pages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .book-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding: 2rem 0 1.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .all-books-section {
        padding: 2rem 0 3rem;
    }

    .books-list {
        gap: 1.5rem;
    }

    .book-page-title {
        font-size: 1.75rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }
}