/* Book Style CSS - BibleHelpMe */

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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #2c1810 0%, #1a0e08 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

/* Ambient lighting effect */
.ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center top, rgba(255, 223, 186, 0.1) 0%, transparent 70%);
    pointer-events: none !important;
    z-index: 1;
    touch-action: none;
}

.bible-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
}

/* Ensure main content is visible on mobile */
@media (max-width: 768px) {
    .bible-container {
        padding: 10px 15px;
        gap: 10px;
    }
}

/* Scripture Header */
.scripture-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0;
    min-height: 70px;
    background: linear-gradient(180deg, rgba(44,24,16,0.97), rgba(26,14,8,0.9));
    backdrop-filter: blur(3px);
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-logo {
    width: 70px;
    height: 70px;
    padding: 0;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.scripture-subtitle {
    margin: 0 !important;
    color: #e8c97c !important;
    font-style: italic !important;
    font-size: 2.2em !important;
    line-height: 1.3 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 0.5px !important;
}

.header-ornament {
    font-size: 24px;
    color: #d4af37;
    animation: shimmer 3s infinite;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Book navigation buttons inside the book area */
.page-back {
    position: absolute; /* relative to .open-book */
    left: 12px;
    top: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    border: 1px solid rgba(139, 69, 19, 0.35);
    border-radius: 18px;
    color: #3d2817;
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 15; /* above book pages/spine */
}

.page-back:hover,
.page-back:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    filter: brightness(1.05);
    outline: none;
}

.page-back:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25) inset;
}

/* Next button mirrors Back button */
.page-next {
    position: absolute; /* relative to .open-book */
    right: 12px;
    top: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    border: 1px solid rgba(139, 69, 19, 0.35);
    border-radius: 18px;
    color: #3d2817;
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 15;
}

.page-next:hover,
.page-next:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    filter: brightness(1.05);
    outline: none;
}

.page-next:active { transform: translateY(0); }

:root { --icon-size: 76px; }

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute; /* relative to .open-book */
    right: 12px;
    top: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    border: 1px solid rgba(139, 69, 19, 0.35);
    border-radius: 18px;
    color: #3d2817;
    font-family: 'Crimson Text', serif;
    font-size: 1em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 15;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    filter: brightness(1.05);
    outline: none;
}

 

/* Book-shaped header icon container */
.header-book-icon {
    position: fixed;
    top: 10px;
    left: 12px;
    width: var(--icon-size);
    height: calc(var(--icon-size) * 1.3);
    border: 2px solid #d4af37;
    border-radius: 6px 10px 10px 6px; /* subtle rounded cover corners */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25), 0 0 20px rgba(212, 175, 55, 0.25);
    background: linear-gradient(135deg, rgba(249,243,233,0.85), rgba(244,232,208,0.85));
    overflow: hidden;
    z-index: 12; /* above header background, below modals */
}

/* Decorative spine on the left */
.header-book-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 100%;
    background: linear-gradient(90deg, #3d2817 0%, #5c3d24 60%, rgba(60,40,25,0.9) 100%);
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.35);
}

/* Subtle page edge on the right */
.header-book-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.1));
    opacity: 0.5;
}

.header-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-title {
    font-family: 'Cinzel', serif;
    font-size: 2.1em; /* slightly reduced to reclaim vertical space */
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    letter-spacing: 2px;
}

/* The Open Book Container */
.open-book {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    position: relative;
    height: 100%;
    max-width: calc(100vw - 252px);
    margin: 0;
    perspective: none;
    transform-style: flat;
    padding: 0 80px 0 60px; /* Increased left padding to prevent text in spine */
    overflow: auto;
}

/* Book Spine */
.book-spine {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 100%;
    background: linear-gradient(90deg, 
        #3d2817 0%, 
        #5c3d24 20%, 
        #4a3019 50%, 
        #5c3d24 80%, 
        #3d2817 100%);
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
    border-radius: 5px;
}

.spine-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 80%;
    background: repeating-linear-gradient(
        0deg,
        #d4af37 0px,
        #d4af37 2px,
        transparent 2px,
        transparent 10px
    );
    opacity: 0.3;
}

/* Book Pages */
.book-page {
    flex: 1;
    height: 100%;
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    padding: 40px 45px 40px 55px; /* Increased left padding to prevent text in spine */
    position: relative;
    overflow: visible;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    min-width: 400px;
}

.left-page {
    border-radius: 20px 0 0 20px;
    transform: none; /* Remove 3D transform */
    margin-right: 2px;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            rgba(139, 69, 19, 0.05) 28px,
            rgba(139, 69, 19, 0.05) 29px
        ),
        linear-gradient(90deg, rgba(139, 69, 19, 0.1) 0%, transparent 5%),
        linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
}

.right-page {
    border-radius: 0 20px 20px 0;
    transform: none; /* Remove 3D transform */
    margin-left: 2px;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            rgba(139, 69, 19, 0.05) 28px,
            rgba(139, 69, 19, 0.05) 29px
        ),
        linear-gradient(270deg, rgba(139, 69, 19, 0.1) 0%, transparent 5%),
        linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
}

.page-number {
    font-family: 'Cinzel', serif;
    color: #8b4513;
    font-size: 1.2em;
    font-weight: 600;
}

.chapter-title {
    font-family: 'Cinzel', serif;
    color: #8b4513;
    font-size: 1em;
    font-style: italic;
    text-align: center;
    display: block;
    width: 100%;
}

/* Page Content */
.page-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #3d2817;
    text-align: left; /* Change from justify to left for better readability */
    max-height: 450px;
    overflow-y: auto;
    padding-right: 15px;
    width: calc(100% - 15px); /* Account for scrollbar */
    box-sizing: border-box;
}

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

.page-content::-webkit-scrollbar-track {
    background: rgba(139, 69, 19, 0.1);
    border-radius: 3px;
}

.page-content::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 3px;
}

/* Progress Ribbon (Right Page) */
.right-page .progress-ribbon {
    margin: 6px 0 10px 0;
}

.right-page .ribbon-steps {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.95em;
    color: #8b6b4a;
}

.right-page .ribbon-step {
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    position: relative;
    overflow: hidden;
}

.right-page .ribbon-step.active {
    background: rgba(212, 175, 55, 0.28);
    color: #5a431f;
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.4), 0 0 8px rgba(212, 175, 55, 0.2);
}

/* Traveling dot inside the active step to signal activity */
.right-page .ribbon-step.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #d4af37;
    filter: drop-shadow(0 0 4px #d4af37);
    animation: stepDot 1.1s ease-in-out infinite;
}

.right-page .ribbon-step.done {
    background: rgba(126, 190, 95, 0.2);
    border-color: rgba(126, 190, 95, 0.35);
    color: #2f5e2a;
}

.right-page .ribbon-sep {
    color: rgba(139, 69, 19, 0.4);
}

.right-page .ribbon-bar {
    position: relative;
    height: 6px;
    background: rgba(139, 69, 19, 0.25);
    border: 1px solid rgba(139, 69, 19, 0.35);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.right-page .ribbon-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    /* Gold base + diagonal stripes overlay for motion */
    background-image: linear-gradient(90deg, #d4af37, #f5e1a4),
                      repeating-linear-gradient(45deg,
                        rgba(255,255,255,0.25) 0px,
                        rgba(255,255,255,0.25) 10px,
                        rgba(212,175,55,0.15) 10px,
                        rgba(212,175,55,0.15) 20px);
    background-blend-mode: overlay;
    background-size: 100% 100%, 20px 20px;
    background-position: 0 0, 0 0;
    transition: width 300ms ease;
    animation: stripes 1s linear infinite;
}

/* Keyframes for moving elements */
@keyframes stripes {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 20px 0; }
}

@keyframes stepDot {
    0%   { transform: translate(0, -50%); }
    50%  { transform: translate(calc(100% - 18px), -50%); }
    100% { transform: translate(0, -50%); }
}

/* Verse Numbers */
.verse-number {
    float: left;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    color: #8b4513;
    margin-right: 8px;
    font-weight: 600;
}

/* On the right (AI) page, do not float the verse number; keep text full-width */
.right-page .verse-number {
    float: none;
    display: inline;
    vertical-align: baseline;
}

/* Drop Cap */
.drop-cap {
    float: left;
    font-family: 'Cinzel', serif;
    font-size: 4em;
    line-height: 0.8;
    margin-right: 5px;
    margin-top: 5px;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Welcome Text */
.welcome-text {
    display: block;
    margin-bottom: 20px;
}

/* Page Footer */
.page-footer {
    position: absolute;
    bottom: 20px;
    left: 40px;
    right: 40px;
}

.ornamental-border {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 69, 19, 0.3) 20%, 
        rgba(139, 69, 19, 0.5) 50%, 
        rgba(139, 69, 19, 0.3) 80%, 
        transparent 100%);
}

/* Scripture Input Area */
.scripture-input-container {
    margin: 0 0 0 -25px;  /* Increased left margin to move container further left */
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    position: sticky; /* keep input visible */
    bottom: 0;
    z-index: 5;
    width: calc(100vw - 252px - 66px); /* Match right page width with new dimensions */
    margin-left: 30px; /* Decreased left margin to move container left */
    margin-right: auto; /* Push to left to align with right page */
}

/* Book-shaped icon placed at the left of the input */
.input-book-icon {
    width: 96px; /* square so image fills without bands */
    height: 96px;
    border: none; /* no frame */
    border-radius: 12px; /* rounded corners */
    background: transparent; /* no gradient */
    box-shadow: none; /* no glow */
    position: relative;
    overflow: hidden; /* clip image to rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* edge-to-edge image */
    flex: 0 0 auto; /* do not stretch */
}

.input-book-icon::before { content: none; }

.input-book-icon::after { content: none; }

.input-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill container edge-to-edge */
    object-position: center;
    display: block;
    position: relative;
    z-index: 1; /* under spine/page overlays */
    border-radius: inherit; /* rounded corners on the image */
    border: 0; box-shadow: none; background: transparent; /* eliminate any residual border effects */
}

/* Keep things comfortable on smaller screens */
@media (max-width: 700px) {
  .input-book-icon { width: 76px; height: 76px; }
  .inscribe-button { width: 46px; height: 46px; }
  .scripture-input { font-size: 1em; }
}

.scripture-input {
    flex: 1;
    background: rgba(249, 243, 233, 0.9);
    border: 2px solid #8b4513;
    border-radius: 5px;
    padding: 10px 14px; /* slightly reduced to fit the icon */
    font-family: 'Crimson Text', serif;
    font-size: 1.1em;
    color: #3d2817;
    resize: vertical;
    min-height: 46px; /* small reduction per request */
    max-height: 140px;
    touch-action: manipulation;
}

.scripture-input::placeholder {
    color: rgba(139, 69, 19, 0.5);
    font-style: italic;
}

.scripture-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    background: rgba(249, 243, 233, 1);
}

/* Inscribe Button */
.inscribe-button {
    width: 52px; /* compact icon-only button */
    height: 52px;
    padding: 0; /* no internal padding for square shape */
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    border: 2px solid #d4af37;
    border-radius: 10px;
    color: #f4e8d0;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.inscribe-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%);
}

.inscribe-button .button-text { display: none; }
.button-ornament { font-size: 1.3em; }

/* Learn More Button */
.scripture-learn-more {
    margin-top: 15px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #6b5b95 0%, #8e7cc3 100%);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    color: #f4e8d0;
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.scripture-learn-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(107, 91, 149, 0.3);
}

/* World View Controls */
.world-view-controls {
    margin-top: 10px;
    display: inline-block;
    position: relative;
}

.world-view-button {
    padding: 8px 14px;
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    border: 1px solid rgba(139, 69, 19, 0.35);
    border-radius: 4px;
    color: #3d2817;
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.world-view-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.05);
}

.wv-icon {
    font-size: 1.05em;
}

.world-view-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    min-width: 260px;
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    border: 1px solid rgba(139, 69, 19, 0.35);
    border-radius: 6px;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.25);
    display: none;
    z-index: 50;
    overflow: hidden;
}

.world-view-menu.show {
    display: block;
}

/* Actions row for Learn More + World View */
.message-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Normalize spacing/alignment when buttons are in the actions row */
.message-actions .scripture-learn-more { margin-top: 0; }
.message-actions .world-view-controls {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
}
.message-actions .world-view-button { margin: 0; }

.world-view-item {
    padding: 10px 12px;
    font-size: 0.95em;
    color: #4b3621;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 1px dashed rgba(139, 69, 19, 0.2);
}

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

.world-view-item:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #2f1f12;
}

/* Text Writing Animation */
@keyframes writeText {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.writing-text {
    animation: writeText 0.5s ease-out forwards;
}

/* Character by Character animation */
.char-animate {
    opacity: 0;
    animation: fadeInChar 0.5s ease forwards;
}

/* Word animation for better readability */
.word-animate {
    display: inline-block;
    opacity: 0;
    animation: fadeInWord 0.3s ease forwards;
}

@keyframes fadeInWord {
    to {
        opacity: 1;
    }
}

@keyframes fadeInChar {
    to {
        opacity: 1;
    }
}

/* Writing Animation with Quill */
.writing-animation {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.writing-animation.active {
    display: block;
}

.quill-pen {
    animation: writing 2s infinite ease-in-out;
}

@keyframes writing {
    0%, 100% { transform: rotate(-5deg) translateX(0); }
    25% { transform: rotate(5deg) translateX(10px); }
    50% { transform: rotate(-5deg) translateX(20px); }
    75% { transform: rotate(5deg) translateX(10px); }
}

/* Processing Overlay (high-tech, book-themed) */
.processing-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: radial-gradient(circle at center, rgba(244, 232, 208, 0.95) 0%, rgba(244, 232, 208, 0.85) 60%, rgba(244, 232, 208, 0) 70%);
    padding: 20px 28px 26px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 0 30px rgba(212, 175, 55, 0.15);
}

.process-orb {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff7d6 0%, #f5e6b8 45%, #e3c778 70%, #b08d2d 100%);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

.orb-core {
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #fff5c2, #ffd86b);
    box-shadow: 0 0 12px #ffd86b, 0 0 30px rgba(212, 175, 55, 0.8);
}

.orb-ring {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px dashed rgba(212, 175, 55, 0.65);
    animation: rotateCW 6s linear infinite;
}
.orb-ring.ring2 {
    inset: 18px;
    border-style: solid;
    border-color: rgba(139, 69, 19, 0.35);
    animation: rotateCCW 5s linear infinite;
}

.orb-scan {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.45) 12%, rgba(255,255,255,0.0) 24%);
    mix-blend-mode: screen;
    animation: sweep 2.4s linear infinite;
}

.orb-glyphs {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: 'Cinzel', serif;
    color: rgba(139, 69, 19, 0.45);
}
.orb-glyphs span {
    position: absolute;
    font-size: 18px;
    opacity: 0.7;
}
.orb-glyphs span:nth-child(1) { top: 16%; left: 28%; }
.orb-glyphs span:nth-child(2) { top: 26%; right: 22%; }
.orb-glyphs span:nth-child(3) { bottom: 24%; left: 22%; }
.orb-glyphs span:nth-child(4) { bottom: 18%; right: 26%; }

.process-caption {
    font-family: 'Crimson Text', serif;
    font-size: 16px;
    color: #5a4a3a;
    background: rgba(249, 243, 233, 0.95);
    padding: 8px 14px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.12);
}

@keyframes rotateCW { to { transform: rotate(360deg); } }
@keyframes rotateCCW { to { transform: rotate(-360deg); } }
@keyframes sweep {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shimmer effect */
@keyframes shimmer {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Hide legacy progress ribbon in book UI (replaced by processing overlay) */
.progress-ribbon {
    display: none !important;
}

/* Page Turn Effect */
.page-turn-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(249, 243, 233, 0.8) 49%, 
        rgba(139, 69, 19, 0.1) 50%, 
        rgba(249, 243, 233, 0.8) 51%, 
        transparent 100%);
    z-index: 100;
    pointer-events: none;
}

.page-turning {
    animation: pageTurn 1s ease-in-out;
}

@keyframes pageTurn {
    0% {
        transform: rotateY(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: rotateY(-180deg);
        opacity: 0;
    }
}

/* Message blocks */
.message-block {
    margin-bottom: 20px;
    padding: 10px 0;
    position: relative;
    animation: fadeIn 0.5s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.user-message {
    font-style: italic;
    color: #654321;
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 3px solid rgba(139, 69, 19, 0.2);
}

.ai-message {
    color: #3d2817;
    line-height: 1.8;
}

/* Bible reference links */
.bible-reference {
    color: #8b4513;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

.bible-reference:hover {
    color: #d4af37;
    text-decoration: underline;
}

/* Verse Modal Styling */
.verse-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verse-modal-content {
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid #8b4513;
}

.verse-modal-close {
    float: right;
    font-size: 2em;
    color: #8b4513;
    cursor: pointer;
    transition: color 0.3s ease;
}

.verse-modal-close:hover {
    color: #d4af37;
}

/* Study Tools Panel */
.study-tools-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.tool-toggle {
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.tool-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.tools-content {
    position: absolute;
    top: 60px;
    right: 0;
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
    min-width: 150px;
}

.study-tools-panel.active .tools-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tool-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 15px;
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    color: #3d2817;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: left;
}

.tool-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #8b4513;
}

/* Study Tools Side Menu */
.study-tools-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 220px;
    height: 100vh;
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    border-left: 3px solid #d4af37;
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 20px 20px 25px; /* Increased left padding for more space */
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

/* Show sidebar when toggled */
.study-tools-sidebar.show {
    transform: translateX(0);
}

.study-tools-sidebar.collapsed {
    transform: translateX(100%);
}

/* Hide sidebar by default on mobile */
@media (max-width: 768px) {
    .study-tools-sidebar {
        width: 85vw;
        max-width: 320px;
    }
    
    .study-tools-sidebar.show { transform: translateX(0); }
}

.sidebar-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.sidebar-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: #3d2817;
    margin: 0 0 8px 0;
    text-shadow: 1px 1px 2px rgba(212, 175, 55, 0.3);
}

.sidebar-subtitle {
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    color: #8b4513;
    margin: 0;
    font-style: italic;
}

.sidebar-tools {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: 'Crimson Text', serif;
}

.tool-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
}

.tool-btn:active {
    transform: translateY(0);
}

.tool-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    color: white;
    border-color: #d4af37;
}

.tool-btn.active .tool-title,
.tool-btn.active .tool-description {
    color: white;
}

.tool-icon {
    font-size: 24px;
    min-width: 24px;
    text-align: center;
}

.tool-info {
    flex: 1;
}

.tool-title {
    font-size: 16px;
    font-weight: 600;
    color: #3d2817;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.tool-description {
    font-size: 12px;
    color: #8b4513;
    font-style: italic;
    transition: color 0.3s ease;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.sidebar-tip {
    font-family: 'Crimson Text', serif;
    font-size: 13px;
    color: #5a4a3a;
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    color: white;
    border: none;
    width: 40px;
    height: 60px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 1001;
    font-size: 16px;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: none; /* Hidden by default, shown via JS */
}

.sidebar-toggle:hover {
    right: 15px;
    box-shadow: -6px 0 15px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile toggle button */
@media (max-width: 768px) {
    .sidebar-toggle {
        top: 90px;
        right: 15px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        font-size: 20px;
    }
    
    .sidebar-toggle.show {
        display: flex;
    }
}

/* Responsive Design for Sidebar */
@media (max-width: 1024px) {
    .study-tools-sidebar {
        width: 200px;
    }
    
    .sidebar-toggle.collapsed {
        right: 200px;
    }
}


/* Study Modals */
.study-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 14, 8, 0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.study-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.study-modal-content {
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 3px solid #d4af37;
    position: relative;
}

.study-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #f4e8d0 0%, #e8dcc0 100%);
}

.study-modal-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: #3d2817;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.study-modal-close {
    font-size: 28px;
    color: #8b4513;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.study-modal-close:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
}

.study-modal-body {
    padding: 25px;
}

/* Scripture Buttons */
.scripture-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    color: #3d2817;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-family: 'Crimson Text', serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.scripture-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.5);
}

.scripture-btn:active {
    transform: translateY(0);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    color: #3d2817;
    margin-bottom: 8px;
    font-size: 16px;
}

.scripture-input, .scripture-textarea, .scripture-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    font-family: 'Crimson Text', serif;
    font-size: 16px;
    background: rgba(249, 243, 233, 0.8);
    color: #3d2817;
    transition: all 0.3s ease;
}

.scripture-input:focus, .scripture-textarea:focus, .scripture-select:focus {
    outline: none;
    border-color: #d4af37;
    background: #f9f3e9;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.scripture-textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Crimson Text', serif;
    color: #3d2817;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d4af37;
}

/* Items Lists */
.items-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    background: rgba(249, 243, 233, 0.5);
    padding: 10px;
}

.items-list:empty::before {
    content: "No items yet...";
    font-style: italic;
    color: #8b4513;
    text-align: center;
    padding: 20px;
    display: block;
}

.item-card {
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #d4af37;
}

.item-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #3d2817;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-content {
    font-family: 'Crimson Text', serif;
    color: #5a4a3a;
    line-height: 1.5;
}

.item-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.item-action-btn {
    background: none;
    border: 1px solid #d4af37;
    color: #8b4513;
    padding: 6px 12px;
    border-radius: 15px;
    font-family: 'Crimson Text', serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-action-btn:hover {
    background: #d4af37;
    color: white;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    background: rgba(249, 243, 233, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 8px 12px;
    border-radius: 15px;
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    color: #3d2817;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-option:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

.filter-option.active {
    background: #d4af37;
    color: white;
    border-color: #b08d2d;
}

/* Search Results */
.search-results {
    margin-top: 20px;
    padding: 15px;
    background: rgba(249, 243, 233, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    font-family: 'Crimson Text', serif;
}

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

.result-reference {
    font-weight: 600;
    color: #8b4513;
    margin-bottom: 5px;
}

.result-text {
    color: #5a4a3a;
    line-height: 1.4;
}

.result-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #8b4513;
    display: flex;
    gap: 15px;
}

/* Progress Indicators */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37 0%, #b08d2d 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    color: #3d2817;
    min-width: 60px;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .study-modal-content {
        width: 95%;
        margin: 10px;
    }

    .study-modal-header {
        padding: 15px 20px;
    }

    .study-modal-body {
        padding: 20px;
    }

    .tools-content {
        right: -10px;
    }

    .study-tools-panel {
        top: 15px;
        right: 15px;
    }
}

/* Scrollbar Styling */
.items-list::-webkit-scrollbar {
    width: 8px;
}

.items-list::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

.items-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}

/* Audio Controls */
.audio-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    color: #3d2817;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-family: 'Crimson Text', serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.audio-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
}

.audio-btn:active {
    transform: translateY(0);
}

.audio-btn.active {
    background: linear-gradient(135deg, #b08d2d 0%, #8b6b23 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Audio speed controls */
.audio-speed-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(249, 243, 233, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.speed-label {
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    color: #3d2817;
    font-weight: 600;
}

.speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: rgba(212, 175, 55, 0.3);
    outline: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.speed-slider::-webkit-slider-thumb:hover {
    background: #b08d2d;
    transform: scale(1.1);
}

.speed-value {
    font-family: 'Crimson Text', serif;
    font-size: 12px;
    color: #8b4513;
    min-width: 30px;
    text-align: center;
}

/* Audio status indicator */
.audio-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 8px;
}

.audio-status.show {
    display: flex;
}

.audio-status.speaking {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
}

.audio-status.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

/* Audio control panel */
.audio-control-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #f9f3e9 0%, #f4e8d0 100%);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid #d4af37;
    z-index: 1000;
    display: none;
    min-width: 200px;
}

.audio-control-panel.show {
    display: block;
}

.audio-control-panel h4 {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: #3d2817;
    margin: 0 0 10px 0;
    text-align: center;
}

.audio-control-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.audio-control-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b08d2d 100%);
    color: #3d2817;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-family: 'Crimson Text', serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.audio-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.audio-control-btn:active {
    transform: translateY(0);
}

.audio-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive audio controls */
@media (max-width: 768px) {
    .audio-btn {
        font-size: 10px;
        padding: 4px 8px;
        margin-left: 4px;
    }
    
    .audio-control-panel {
        bottom: 10px;
        right: 10px;
        min-width: 180px;
        padding: 12px;
    }
    
    .audio-status {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .open-book {
        flex-direction: column;
        height: auto;
        padding: 0 20px;
        max-width: 100vw;
    }
    
    .book-page {
        transform: none !important;
        margin: 10px 0 !important;
        border-radius: 10px !important;
        min-width: 100%;
        padding: 30px 20px;
    }
    
    .book-spine {
        display: none;
    }
    
    .app-title {
        font-size: 1.8em;
    }
    
    /* Mobile Touch Targets */
    .inscribe-button {
        min-width: 60px;
        min-height: 60px;
        padding: 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
    }
    
    .scripture-input {
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 60px;
        touch-action: manipulation;
    }
    
    .scripture-learn-more,
    .world-view-button,
    .tool-btn,
    .scripture-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
    }
    
    .bible-reference,
    .verse-link {
        min-height: 44px;
        padding: 8px 12px;
        display: inline-flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    .verse-modal-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 32px;
        touch-action: manipulation;
    }
    
    .study-modal-close {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .page-back,
    .page-next {
        min-width: 60px;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 1em;
        touch-action: manipulation;
    }
    
    .scripture-input-container {
        width: calc(100vw - 40px);
        margin-left: 0;
        margin-right: 0;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .input-book-icon {
        width: 60px;
        height: 60px;
    }
    
    .study-tools-sidebar {
        touch-action: pan-y;
    }
}

/* Search Status Text */
.search-status {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244, 232, 208, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    color: #5a4a3a;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
    white-space: nowrap;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Quiz Components */
.quiz-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 0;
}

.quiz-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.quiz-info {
    background: rgba(249, 243, 233, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.quiz-info p {
    margin: 8px 0;
    font-family: 'Crimson Text', serif;
    color: #3d2817;
}

.quiz-preview {
    background: rgba(249, 243, 233, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.quiz-preview h4 {
    font-family: 'Cinzel', serif;
    color: #3d2817;
    margin-bottom: 10px;
}

.preview-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    font-family: 'Crimson Text', serif;
    color: #5a4a3a;
}

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

.preview-item em {
    color: #8b4513;
    font-style: normal;
}

/* Quiz Questions */
.quiz-question {
    background: rgba(249, 243, 233, 0.8);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.question-number {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #d4af37;
    font-weight: bold;
}

.question-type {
    font-family: 'Crimson Text', serif;
    font-size: 12px;
    color: #8b4513;
    background: rgba(212, 175, 55, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: capitalize;
}

.question-text {
    font-family: 'Crimson Text', serif;
    font-size: 18px;
    color: #3d2817;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Question Options */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.option-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(249, 243, 233, 0.6);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
}

.option-label input[type="radio"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
}

.option-text {
    font-family: 'Crimson Text', serif;
    font-size: 16px;
    color: #3d2817;
    line-height: 1.5;
    flex: 1;
}

.option-label:has(input:checked) {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

/* Question Input */
.question-input {
    margin-bottom: 20px;
}

/* Question Navigation */
.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.scripture-btn.secondary {
    background: rgba(212, 175, 55, 0.2);
    color: #8b4513;
    border: 1px solid rgba(212, 175, 55, 0.5);
}

.scripture-btn.secondary:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* Quiz Progress */
.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(249, 243, 233, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.quiz-score {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: #3d2817;
}

/* Quiz Results */
.quiz-results {
    text-align: center;
}

.results-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: #d4af37;
    margin-bottom: 15px;
}

.final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.score-number {
    font-family: 'Cinzel', serif;
    font-size: 48px;
    font-weight: bold;
    color: #d4af37;
}

.score-percentage {
    font-family: 'Crimson Text', serif;
    font-size: 24px;
    color: #8b4513;
    font-weight: 600;
}

/* Results Feedback */
.results-feedback {
    margin: 20px 0;
}

.feedback {
    font-family: 'Crimson Text', serif;
    font-size: 18px;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.feedback.excellent {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.feedback.good {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #3d2817;
}

.feedback.fair {
    background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
    color: white;
}

.feedback.needs-improvement {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* Results Review */
.results-review {
    text-align: left;
    margin-top: 30px;
}

.results-review h4 {
    font-family: 'Cinzel', serif;
    color: #3d2817;
    margin-bottom: 15px;
    text-align: center;
}

.review-item {
    background: rgba(249, 243, 233, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.review-item.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.review-item.incorrect {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.review-question {
    font-family: 'Crimson Text', serif;
    font-size: 16px;
    color: #3d2817;
    margin-bottom: 10px;
    font-weight: 600;
}

.review-answers {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.user-answer {
    color: #8b4513;
}

.correct-answer {
    color: #28a745;
    font-weight: 600;
}

.explanation {
    color: #5a4a3a;
    font-style: italic;
}

/* Quiz Error */
.quiz-error {
    text-align: center;
    padding: 20px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    color: #dc3545;
    font-family: 'Crimson Text', serif;
}

/* Responsive Quiz */
@media (max-width: 768px) {
    .quiz-overview {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .question-navigation button {
        width: 100%;
    }
    
    .quiz-progress {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .review-answers {
        font-size: 13px;
    }
}
