/* OpenDyslexic Font Face */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/open-dyslexic/OpenDyslexic-Regular.eot');
    src: url('/fonts/open-dyslexic/OpenDyslexic-Regular.eot?#iefix') format('embedded-opentype'),
         url('/fonts/open-dyslexic/OpenDyslexic-Regular.woff2') format('woff2'),
         url('/fonts/open-dyslexic/OpenDyslexic-Regular.woff') format('woff'),
         url('/fonts/open-dyslexic/OpenDyslexic-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/open-dyslexic/OpenDyslexic-Bold.eot');
    src: url('/fonts/open-dyslexic/OpenDyslexic-Bold.eot?#iefix') format('embedded-opentype'),
         url('/fonts/open-dyslexic/OpenDyslexic-Bold.woff2') format('woff2'),
         url('/fonts/open-dyslexic/OpenDyslexic-Bold.woff') format('woff'),
         url('/fonts/open-dyslexic/OpenDyslexic-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/open-dyslexic/OpenDyslexic-Italic.eot');
    src: url('/fonts/open-dyslexic/OpenDyslexic-Italic.eot?#iefix') format('embedded-opentype'),
         url('/fonts/open-dyslexic/OpenDyslexic-Italic.woff2') format('woff2'),
         url('/fonts/open-dyslexic/OpenDyslexic-Italic.woff') format('woff'),
         url('/fonts/open-dyslexic/OpenDyslexic-Italic.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/open-dyslexic/OpenDyslexic-Bold-Italic.eot');
    src: url('/fonts/open-dyslexic/OpenDyslexic-Bold-Italic.eot?#iefix') format('embedded-opentype'),
         url('/fonts/open-dyslexic/OpenDyslexic-Bold-Italic.woff2') format('woff2'),
         url('/fonts/open-dyslexic/OpenDyslexic-Bold-Italic.woff') format('woff'),
         url('/fonts/open-dyslexic/OpenDyslexic-Bold-Italic.otf') format('opentype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --paper-color: #ffffff;
    --paper-text-color: #000000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    /* iOS Safari scroll fix */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* Only apply overflow hidden on reader page */
body.reader-page {
    overflow: hidden;
    /* Prevent page-level scrolling on iOS */
    position: fixed;
    width: 100%;
    height: 100%;
    /* Prevent over-scroll behavior but allow normal scrolling */
    overscroll-behavior-y: none;
    /* Allow smooth scrolling */
    -webkit-overflow-scrolling: touch;
}

body.dark-theme {
    --bg-color: #000000;
    --text-color: #ffffff;
    --paper-color: #000000;
    --paper-text-color: #ffffff;
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
    /* Ensure inactive pages are completely hidden */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page.active {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Library Page Styles */
#library-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #000000;
    background-image: url('/ghanavyuha-v4.png');
    z-index: -1;
  }
#library-page {
    min-height: 100vh;
    /* Ensure proper scrolling on iOS */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Simple gradient background - no complex positioning needed */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #ffffff;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    width: 40px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #a70000;
}

.help-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #a70000;
    color: #a70000;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-btn:hover {
    background: #a70000;
    color: #ffffff;
    transform: scale(1.05);
}

/* Help Popup */
.help-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.help-popup.show {
    display: flex;
}

.help-popup-content {
    background: var(--bg-color);
    border: 2px solid #a70000;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.help-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #a70000;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.help-popup-close:hover {
    background: rgba(167, 0, 0, 0.1);
}

.help-popup-content h3 {
    color: #a70000;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.help-popup-content p {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.help-popup-content a {
    color: #a70000;
    text-decoration: none;
}

.help-popup-content a:hover {
    text-decoration: underline;
}

.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
    min-height: 60vh;
}

.hero-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000000;
    line-height: 1.25em;
}

.hero-content p {
    font-size: 1.2rem;
    color: #333333;
    margin: 0;
}

.hero-book {
    display: flex;
    justify-content: center;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 300px));
    gap: 2rem;
    justify-content: start;
}

.book-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.book-card.featured {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #a70000;
}

.book-card.coming-soon {
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed rgba(167, 0, 0, 0.5);
}

.book-card.coming-soon:hover {
    border-color: #a70000;
}

.coming-soon-cover {
    background: rgba(167, 0, 0, 0.1);
    border: 2px dashed rgba(167, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.coming-soon-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.book-progress {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #a70000;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.book-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #000000;
}

.book-cover {
    margin-bottom: 1rem;
}

.book-cover img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.book-author {
    color: #5c5c5c;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.read-btn {
    background: #a70000;
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
}

.read-btn:hover {
    background: #a70000;
    transform: translateY(-2px);
}

/* Reader Page Styles */
#reader-page {
    background: #ffffff;
    /* Ensure proper positioning for fixed elements */
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.reader-header {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid rgba(167, 0, 0, 0.3);
    /* Prevent header from being scrollable */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* Prevent touch events from propagating, but allow menu button */
    touch-action: none;
}

.menu-btn {
    background: none;
    border: none;
    color: #a70000;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
    /* Ensure button is touchable on mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.menu-btn:hover {
    background: rgba(167, 0, 0, 0.1);
}

.reader-title {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
    color: #000000;
}

.reader-authors {
    color: #5c5c5c;
    font-size: 0.9rem;
}

.reader-container {
    display: flex;
    height: calc(100dvh - 80px);
    overflow: hidden;
    /* Position below fixed header */
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    /* Ensure proper height calculation */
    box-sizing: border-box;
}

/* Sidebar Styles */
.sidebar {
    width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(167, 0, 0, 0.3);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100dvh - 80px);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    overflow: hidden;
    /* Prevent page scrolling when sidebar is open */
    -webkit-overflow-scrolling: touch;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(167, 0, 0, 0.3);
}

.sidebar-header h2 {
    color: #a70000;
    font-size: 1.2rem;
}

.close-sidebar {
    background: none;
    border: none;
    color: #a70000;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* Sidebar content area - scrollable */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Sidebar controls - fixed at bottom */
.sidebar-controls {
    flex-shrink: 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(167, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.control-buttons {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    justify-content: space-between;
}

.chapter-list {
    list-style: none;
    padding: 1rem 0;
}

.chapter-item {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.chapter-item:hover {
    background: rgba(167, 0, 0, 0.1);
    border-left-color: #a70000;
}

.chapter-item.active {
    background: rgba(167, 0, 0, 0.2);
    border-left-color: #a70000;
    color: #a70000;
}

.chapter-item a {
    color: #5c5c5c;
    text-decoration: none;
    display: block;
}

.chapter-item.active a {
    color: #a70000;
}

/* Removed old reader-controls styles - now using sidebar-controls */

.text-size-btn {
    background: #a70000;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.text-size-btn:hover {
    background: #a70000;
}

.theme-btn, .reset-btn, .dyslexia-btn {
    background: #a70000;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.theme-btn:hover, .reset-btn:hover, .dyslexia-btn:hover {
    background: #a70000;
}

.color-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.color-controls label {
    color: #5c5c5c;
    font-size: 0.9rem;
}

.color-picker input {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.library-btn {
    background: #a70000;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.library-btn:hover {
    background: #a70000;
}

/* Reading Area Styles */
.reading-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    background: var(--paper-color);
    color: var(--paper-text-color);
    -webkit-overflow-scrolling: touch;
    /* Prevent over-scroll that pushes header out of view */
    overscroll-behavior-y: contain;
    /* Ensure scroll is contained within bounds */
    scroll-behavior: auto;
}

/* Reading area when showing title page */
.reading-area:has(.title-page) {
    overflow: hidden;
    padding: 0;
    position: relative;
}

/* Fixed Audio Player at Bottom */
.fixed-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 2px solid #a70000;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.fixed-audio-player.visible {
    transform: translateY(0);
}

.dark-theme .fixed-audio-player {
    background: #000000;
    border-top: 2px solid #a70000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .fixed-audio-player {
        padding: 0.5rem 0.75rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
}

/* Plyr customization to match theme */
.fixed-audio-player .plyr--audio .plyr__controls {
    background: transparent;
    color: #000000;
    padding: 0.5rem 0;
}

.dark-theme .fixed-audio-player .plyr--audio .plyr__controls {
    color: #ffffff;
}

/* Play button and controls */
.fixed-audio-player .plyr--audio .plyr__control,
.fixed-audio-player .plyr__menu__container {
    color: #000000 !important;
    background: #ffffff !important;
}

.dark-theme .fixed-audio-player .plyr--audio .plyr__control,
.dark-theme .fixed-audio-player .plyr__menu__container {
    color: #ffffff !important;
    background: #000000 !important;
}

.fixed-audio-player .plyr--audio .plyr__control:hover,
.fixed-audio-player .plyr--audio .plyr__control.plyr__tab-focus,
.fixed-audio-player .plyr--audio .plyr__control[aria-expanded=true] {
    background: #a70000 !important;
    color: #ffffff !important;
}

/* Volume and settings icons */
.fixed-audio-player .plyr__control svg {
    fill: currentColor;
}

/* Progress bar */
.fixed-audio-player .plyr--audio .plyr__progress input[type=range] {
    color: #a70000;
}

.fixed-audio-player .plyr__progress__buffer {
    color: rgba(167, 0, 0, 0.25);
}

/* Time display */
.fixed-audio-player .plyr__time {
    color: #000000;
    font-size: 0.9rem;
}

.dark-theme .fixed-audio-player .plyr__time {
    color: #ffffff;
}

/* Volume slider */
.fixed-audio-player .plyr--audio input[type=range]::-webkit-slider-thumb {
    background: #a70000;
}

.fixed-audio-player .plyr--audio input[type=range]::-moz-range-thumb {
    background: #a70000;
}

/* Settings menu */
.fixed-audio-player .plyr__menu {
    background: #ffffff !important;
    border: 1px solid #a70000;
    color: #000000 !important;
}

.dark-theme .fixed-audio-player .plyr__menu {
    background: #000000 !important;
    color: #ffffff !important;
}

.fixed-audio-player .plyr__menu__container .plyr__control {
    color: #000000 !important;
}

.dark-theme .fixed-audio-player .plyr__menu__container .plyr__control {
    color: #ffffff !important;
}

.fixed-audio-player .plyr__menu__container .plyr__control:hover {
    background: #a70000 !important;
    color: #ffffff !important;
}

/* Settings menu - all text elements */
.fixed-audio-player .plyr__menu__container [role="menuitemradio"],
.fixed-audio-player .plyr__menu__container .plyr__menu__value {
    color: #000000 !important;
}

.dark-theme .fixed-audio-player .plyr__menu__container [role="menuitemradio"],
.dark-theme .fixed-audio-player .plyr__menu__container .plyr__menu__value {
    color: #ffffff !important;
}

/* Active/checked menu item */
.fixed-audio-player .plyr__menu__container [role="menuitemradio"][aria-checked="true"] {
    color: #a70000 !important;
}

/* Menu back button */
.fixed-audio-player .plyr__menu__container .plyr__control[data-plyr="menu"] {
    color: #000000 !important;
}

.dark-theme .fixed-audio-player .plyr__menu__container .plyr__control[data-plyr="menu"] {
    color: #ffffff !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .fixed-audio-player .plyr--audio .plyr__controls {
        padding: 0.25rem 0;
    }
    
    .fixed-audio-player .plyr__time {
        font-size: 0.8rem;
    }
}

.chapter-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.chapter-content.dyslexia-font {
    font-family: 'OpenDyslexic', sans-serif;
}

.reading-area.dyslexia-font {
    font-family: 'OpenDyslexic', sans-serif;
}

.title-page-overlay.dyslexia-font {
    font-family: 'OpenDyslexic', sans-serif;
}

.chapter-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--paper-text-color);
    text-align: center;
    line-height: 1.25em;
}

.chapter-content h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem 0;
    color: var(--paper-text-color);
}

.chapter-content p {
    margin-bottom: 1.5rem;
    /* text-align: justify; */
}

.chapter-content .center {
    text-align: center;
}

.chapter-content .italic {
    font-style: italic;
}

.chapter-content strong {
    font-weight: 600;
    color: var(--paper-text-color);
}

.chapter-content em {
    font-style: italic;
}

/* Title Page Styles */
.title-page {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Prevent any scrolling on title page */
    touch-action: none;
}

.title-page-overlay {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    padding: 4rem 3rem;
    border-radius: 8px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

body.dark-theme .title-page-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.book-title-main {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--paper-text-color);
    line-height: 1.3;
}

.book-credits {
    text-align: right;
    margin-top: 1.5rem;
}

.chapter-content p.author-credit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--paper-text-color);
    margin-bottom: 0.25rem;
}

.translator-credit {
    font-size: 0.9rem;
    color: var(--paper-text-color);
    font-style: italic;
    opacity: 0.8;
}

.continue-reading-btn {
    background: #a70000;
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.continue-reading-btn:hover {
    background: #a70000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chapter-navigation {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #333333;
}

/* Highlight Menu */
.highlight-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid #a70000;
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.highlight-menu.show {
    display: block;
}

.highlight-btn {
    background: #a70000;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0.25rem;
    transition: background 0.3s ease;
}

.highlight-btn:hover {
    background: #a70000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content {
        min-height: 300px;
        padding: 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .reader-header {
        padding: 1rem;
    }
    
    .reader-title {
        font-size: 1.2rem;
    }
    
    .reader-authors {
        display: none;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .sidebar-controls {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .control-buttons {
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .text-size-btn, .theme-btn, .reset-btn, .dyslexia-btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .library-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .reading-area {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .chapter-content {
        font-size: 1rem;
    }
    
    .chapter-content h1 {
        font-size: 2rem;
    }
    
    .library-grid {
        grid-template-columns: 1fr;
    }
    
    .book-title-main {
        font-size: 2rem;
    }
    
    .title-page-overlay {
        padding: 3rem 2rem;
        max-width: 450px;
    }
    
    .author-credit {
        font-size: 0.9rem;
    }
    
    .translator-credit {
        font-size: 0.8rem;
    }
    
    .continue-reading-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        margin-top: 1.5rem;
    }
    
    .chapter-navigation {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .hero-content {
        min-height: 250px;
        padding: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .book-card {
        padding: 1rem;
    }
    
    .chapter-content h1 {
        font-size: 1.5rem;
    }
    
    .chapter-content h2 {
        font-size: 1.3rem;
    }
    
    .book-title-main {
        font-size: 1.5rem;
    }
    
    .title-page-overlay {
        padding: 2rem 1.5rem;
        max-width: 90%;
        margin: 0 1rem;
    }
    
    .author-credit {
        font-size: 0.85rem;
    }
    
    .translator-credit {
        font-size: 0.75rem;
    }
    
    .continue-reading-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
        margin-top: 1.25rem;
    }
    
    .chapter-navigation {
        margin-top: 1.5rem;
        padding: 1rem 0;
    }
}
