/* ===================================
   BOOK READER STYLES
   ================================== */

.book-reader-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px); /* 72px = user-hub topbar */
    min-height: 600px;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
}

/* Reader Header */
.reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    flex-shrink: 0;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
}

.reader-title {
    flex: 1;
    text-align: center;
}

.reader-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

.reader-title p {
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Header Progress Slider */
.header-progress-container {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-progress-container .page-slider-container {
    flex: 1;
    min-width: 0;
}

.header-progress-container .page-slider {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
}

.reader-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* Settings and Bookmarks Panels */
.reader-settings-panel,
.bookmarks-panel {
    position: absolute;
    right: -360px;
    top: 0;
    width: 320px;
    height: 100%;
    background: rgba(10, 18, 36, 0.97);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.5rem;
    z-index: 50;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.reader-settings-panel.open,
.bookmarks-panel.open {
    right: 0;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.6);
}

.reader-settings-panel h3,
.bookmarks-panel h3 {
    margin: 0 0 1.5rem 0;
    color: white;
    font-size: 1.3rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.setting-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

#fontSizeValue {
    color: var(--accent);
    font-weight: 600;
}

/* Bookmarks List */
.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.bookmark-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.bookmark-info i {
    color: var(--accent);
}

.bookmark-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.btn-icon-small:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* Book Display */
.book-display {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 2rem 5.5rem; /* bottom pad for nav controls overlay */
    perspective: 2000px;
    position: relative;
    overflow: auto;
    scroll-behavior: smooth;
}

/* Theme Variants */
.book-display.theme-dark .book-page {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
}

.book-display.theme-sepia .book-page {
    background: linear-gradient(135deg, #f5f0e8 0%, #e8dcc8 100%);
    color: #3e2723;
}

.book-display.theme-light .book-page {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
}

/* 3D Book Wrapper */
.book-3d-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 1600px; /* Increased from 1400 */
    min-height: 600px; /* Increased from 520 */
    height: 80vh; /* Take up more vertical space */
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform-style: preserve-3d;
    border-radius: 12px;
    overflow: hidden;
    align-self: flex-start;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Book Pages */
.book-page {
    flex: 1;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    transform-style: preserve-3d;
    overflow: hidden; /* container handles scroll if needed */
}

/* left-page / right-page decorators */
.left-page {
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: inset -15px 0 30px rgba(0, 0, 0, 0.3);
}

.right-page {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 15px 0 30px rgba(0, 0, 0, 0.2);
}

/* Page Flip Animations */
.book-page.flipping-next {
    animation: flipNext 0.6s ease forwards;
    transform-origin: left center;
}

.book-page.flipping-prev {
    animation: flipPrev 0.6s ease forwards;
    transform-origin: right center;
}

@keyframes flipNext {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-90deg);
        box-shadow: -20px 0 40px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: rotateY(-180deg);
    }
}

@keyframes flipPrev {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: rotateY(180deg);
    }
}

.page-flip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease;
}

/* Page Content */
.page-content {
    flex: 1;
    font-size: 16px;
    line-height: 1.8;
    overflow: auto; /* Allow scrolling if zoomed in */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
}

/* Make PDF canvases fill their container properly */
.page-content canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin: auto;
}

.page-content::-webkit-scrollbar {
    width: 6px;
}

.page-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.page-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.page-text p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.page-text .quote {
    font-style: italic;
    color: var(--accent);
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    margin: 1.5rem 0;
}

.page-number {
    position: absolute;
    bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.left-page .page-number {
    left: 3rem;
}

.right-page .page-number {
    right: 3rem;
}

/* Chapter Pages */
.chapter-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
}

.chapter-number {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.chapter-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
}

/* Navigation Controls */
.book-nav-controls {
    position: sticky;
    bottom: 0.75rem;
    left: 50%;
    /* Can't translate sticky+left, so use flex parent centering */
    margin: 0.75rem auto 0;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 20;
}

.btn-page-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.btn-page-nav:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.btn-page-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-slider-container {
    flex: 1;
    min-width: 300px;
}

.page-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-radius: 3px;
    cursor: pointer;
}

.page-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.5);
    transition: all 0.3s ease;
}

.page-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 15px rgba(124, 58, 237, 0.7);
}

.page-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.5);
}

/* Quick Actions Bar */
.quick-actions-bar {
    padding: 0.6rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-quick {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.btn-quick:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

.btn-quick i {
    font-size: 1rem;
}

/* Note Modal — same pattern as .quiz-session-modal: absolute inside .book-reader-container */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    display: none;
    flex-direction: column;
    z-index: 3000;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: transparent;
    border: none;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.modal-body {
    padding: 2rem;
}

.modal-body textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary,
.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #6d28d9;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(30, 27, 75, 0.97));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-success {
    border-left: 3px solid #10b981;
}

.toast-success::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.toast-error {
    border-left: 3px solid #ef4444;
}

.toast-error::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Custom Confirm Dialog */
.reader-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease;
}

.reader-confirm-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: confirmSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmSlideIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.reader-confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fbbf24;
    flex-shrink: 0;
}

.reader-confirm-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.reader-confirm-message {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

.reader-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .book-3d-wrapper {
        width: 98%;
    }
    
    .book-page {
        padding: 1.25rem;
    }
    
    .chapter-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    /* Height matches the usable viewport minus the user-hub top bar */
    .book-reader-container {
        height: calc(100dvh - var(--header-height, 80px));
        height: calc(100vh - 80px); /* fallback for browsers without dvh */
    }

    /* Collapse reader header to two items: back + actions.
       Hide the center progress slider — the footer nav controls handle navigation. */
    .reader-header {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .header-progress-container {
        display: none;
    }

    .reader-title h2 {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }

    .reader-title p {
        display: none; /* hide subtitle on mobile */
    }

    .btn-back {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Single-page layout for mobile */
    .book-3d-wrapper {
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 300px; /* was 600px — fits in a phone screen now */
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    /* Show only one page at a time on mobile — right-page is hidden */
    .book-page {
        min-height: 65dvh;
        min-height: 65vh; /* fallback */
        padding: 1.25rem 1rem;
    }

    .right-page {
        display: none; /* Single-page reading on mobile */
    }

    .left-page {
        border-right: none;
        border-radius: 8px; /* standalone card look */
    }

    /* Compact book display padding */
    .book-display {
        padding: 0.75rem 0.5rem 1rem;
    }

    /* Nav controls bar — make it span full width, compact */
    .book-nav-controls {
        width: calc(100% - 2rem);
        padding: 0.65rem 1rem;
        gap: 0.5rem;
        border-radius: 12px;
        justify-content: space-between;
    }

    /* Slider fills space between prev/next buttons */
    .page-slider-container {
        min-width: 0;
        flex: 1;
    }

    /* Slightly smaller nav buttons for mobile */
    .btn-page-nav {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    /* Quick actions wrap nicely */
    .quick-actions-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .btn-quick {
        flex: 1;
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        justify-content: center;
    }

    /* Panels slide over full width */
    .reader-settings-panel,
    .bookmarks-panel {
        width: 100%;
        right: -100%;
    }

    /* TOC panel slides from left, full width */
    .toc-panel {
        width: 100%;
        left: -100%;
    }
}

/* ===================================
   ENHANCED FEATURES STYLES
   ================================== */

/* Table of Contents Panel */
.toc-panel {
    position: absolute;
    left: -360px;
    top: 0;
    width: 320px;
    height: 100%;
    background: rgba(10, 18, 36, 0.97);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.5rem;
    z-index: 50;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.toc-panel.open {
    left: 0;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.6);
}

.toc-panel h3 {
    margin: 0 0 1.5rem 0;
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toc-item:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
    transform: translateX(5px);
}

.toc-title {
    color: white;
    font-weight: 500;
}

.toc-page {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Reading Statistics */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: var(--accent);
    font-weight: 600;
}

/* Keyboard hint badges */
.kbd-hint {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin-left: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--accent);
}

/* Modal overlay for shortcuts */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-dialog {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

kbd {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fullscreen adjustments */
.book-reader-container:fullscreen {
    height: 100vh;
}

.book-reader-container:fullscreen .reader-header {
    position: sticky;
    top: 0;
}

/* Improved quick actions bar responsiveness */
@media (max-width: 768px) {
    .toc-panel {
        width: 100%;
        left: -100%;
    }
    
    .kbd-hint {
        display: none;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}
