/* =========================================================
   READING.CSS — Reader Page Styles
   ========================================================= */

/* -------- LAYOUT PRINCIPAL DEL READER (3 columnas) -------- */
.reader-grid {
    display: grid;
    grid-template-columns: 250px 1fr 280px;
    gap: 1.5rem;
    padding: var(--content-padding);
}

/* ===================================
   SCRIPTURE LIST (Panel Izquierdo)
   =================================== */
.scripture-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(10, 26, 47, 0.08);
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
}

.scripture-container h2 {
    font-family: var(--title-font);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--deep-blue);
    font-weight: 600;
}

.scripture-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scripture-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,250,250,0.95));
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(10, 26, 47, 0.05);
}

.scripture-item:hover {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-color: var(--gold);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.scripture-item:active {
    transform: translateX(3px) scale(0.98);
}

.scripture-item.active {
    background: linear-gradient(135deg, var(--gold), #C49B33);
    color: white;
    border-color: var(--gold);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.scripture-item.active .scripture-name {
    color: white;
    font-weight: 600;
}

.scripture-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.scripture-name {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.3;
    font-family: var(--body-font);
}

/* ===================================
   READING CONTENT (Panel Central)
   =================================== */
.reading-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(10, 26, 47, 0.08);
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
    position: relative;
}

/* Welcome message */
#reading-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dark);
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.6;
}

#reading-welcome p {
    padding: 2rem;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.05), rgba(212, 175, 55, 0.02));
    border-radius: 12px;
    border: 2px dashed var(--gold);
}

/* Scripture Title */
#scripture-title {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--gold);
}

#scripture-title h2 {
    font-family: var(--title-font);
    font-size: 1.8rem;
    color: var(--deep-blue);
    font-weight: 700;
    margin: 0;
}

/* Books & Chapters Container */
#books-container h3,
#chapters-container h3 {
    font-family: var(--title-font);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--deep-blue);
    font-weight: 600;
}

.books-list,
.chapters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.book-item,
.chapter-item {
    padding: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,250,250,0.95));
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    text-align: center;
    font-weight: 500;
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(10, 26, 47, 0.05);
}

.book-item:hover,
.chapter-item:hover {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.25);
}

.book-item:active,
.chapter-item:active {
    transform: translateY(-2px) scale(0.98);
}

/* Chapter Content */
#chapter-content {
    line-height: 1.8;
    font-family: var(--body-font);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.chapter-title {
    font-family: var(--title-font);
    font-size: 1.5rem;
    color: var(--deep-blue);
    font-weight: 700;
}

.chapter-navigation {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--gold), #C49B33);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--body-font);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.nav-btn:hover {
    background: linear-gradient(135deg, #C49B33, var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
}

.nav-btn:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

.nav-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.verse {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background var(--transition-fast);
}

.verse:hover {
    background: rgba(212, 175, 55, 0.05);
}

.verse-number {
    display: inline-block;
    min-width: 35px;
    font-weight: 700;
    color: var(--gold);
    margin-right: 0.5rem;
}

.verse-text {
    display: inline;
    color: var(--text-dark);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ===================================
   TOOLBAR - MEJORADO SIN SCROLL
   =================================== */

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
}

.toolbar h3 {
    font-family: var(--title-font);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--deep-blue);
}

/* Botones del toolbar en GRID 2x3 */
.toolbar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.toolbar-btn {
    padding: 0.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,250,250,0.95));
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 6px rgba(10, 26, 47, 0.05);
    text-align: center;
}

.toolbar-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    transform: translateY(-2px);
}

.toolbar-btn.active {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold), #C49B33);
    color: white;
}

/* Control panel compacto */
.control-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: rgba(245, 244, 239, 0.5);
    border-radius: 8px;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-content h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--deep-blue);
}

.panel-info {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* Textarea más compacta */
.notes-textarea {
    min-height: 150px;
    max-height: 200px;
    font-size: 0.9rem;
    padding: 0.75rem;
}

/* Botones de acción más pequeños */
.panel-action-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

/* Color palette compacta */
.color-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

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

/* Dark mode */
body.dark .toolbar h3 {
    color: var(--gold);
}

body.dark .toolbar-btn {
    background: rgba(40, 40, 40, 0.9);
    color: var(--text-light);
}

body.dark .control-panel {
    background: rgba(30, 30, 30, 0.5);
}

/* Notes Textarea */
.notes-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    font-family: var(--body-font);
    font-size: 0.95rem;
    line-height: 1.6;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    resize: vertical;
    transition: var(--transition-fast);
    background: rgba(255, 255, 255, 0.9);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Color Palette (Highlighter) */
.color-palette {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.color-btn {
    padding: 1rem;
    border: 3px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: var(--transition-fast);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    font-family: var(--body-font);
}

.color-btn:hover {
    border-color: var(--deep-blue);
    transform: scale(1.05);
}

.color-btn:active {
    transform: scale(0.98);
}

/* Music Controls */
.music-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: var(--body-font);
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.music-select:focus {
    outline: none;
    border-color: var(--gold);
}

#youtube-player-container {
    width: 100%;
    margin: 1rem 0;
}

#youtube-player {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
}

.music-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.music-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--deep-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--body-font);
    transition: var(--transition-smooth);
}

.music-btn:hover {
    background: #0d2342;
    transform: translateY(-2px);
}

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

/* Progress Display */
#progress-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.progress-item h5 {
    font-family: var(--title-font);
    font-size: 1rem;
    color: var(--deep-blue);
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), #C49B33);
    transition: width 0.5s ease;
}

/* Dark Mode para Toolbar */
body.dark .toolbar {
    background: rgba(30, 30, 30, 0.95);
}

body.dark .toolbar h3,
body.dark .panel-content h4 {
    color: var(--gold);
}

body.dark .control-panel {
    background: rgba(40, 40, 40, 0.7);
    border-color: #444;
}

body.dark .panel-info {
    color: #aaa;
}

body.dark .notes-textarea,
body.dark .music-select {
    background: rgba(50, 50, 50, 0.9);
    border-color: #555;
    color: var(--text-light);
}

body.dark .notes-textarea:focus,
body.dark .music-select:focus {
    border-color: var(--gold);
}

body.dark .progress-item {
    background: rgba(50, 50, 50, 0.7);
}

body.dark .progress-item h5 {
    color: var(--gold);
}

body.dark .progress-bar {
    background: #444;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.2rem;
    color: var(--text-dark);
    opacity: 0.6;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Breadcrumb navigation */
.breadcrumb {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.04));
    border-radius: 8px;
    flex-wrap: wrap;
    border-left: 3px solid var(--gold);
}

.breadcrumb-item {
    color: var(--gold);
    cursor: pointer;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
    color: var(--deep-blue);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-dark);
    opacity: 0.4;
}

/* ===================================
   SCROLLBAR CUSTOM
   =================================== */
.scripture-container::-webkit-scrollbar,
.reading-content::-webkit-scrollbar,
.toolbar::-webkit-scrollbar {
    width: 8px;
}

.scripture-container::-webkit-scrollbar-track,
.reading-content::-webkit-scrollbar-track,
.toolbar::-webkit-scrollbar-track {
    background: rgba(245, 244, 239, 0.5);
    border-radius: 4px;
}

.scripture-container::-webkit-scrollbar-thumb,
.reading-content::-webkit-scrollbar-thumb,
.toolbar::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.scripture-container::-webkit-scrollbar-thumb:hover,
.reading-content::-webkit-scrollbar-thumb:hover,
.toolbar::-webkit-scrollbar-thumb:hover {
    background: #C49B33;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1200px) {
    .reader-grid {
        grid-template-columns: 220px 1fr 250px;
    }

    .scripture-thumb {
        width: 32px;
        height: 32px;
    }

    .scripture-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 900px) {
    .reader-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .scripture-container {
        max-height: 250px;
    }

    .toolbar {
        max-height: 200px;
    }

    .books-list,
    .chapters-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 600px) {
    .reader-grid {
        gap: 1rem;
        padding: 1rem;
    }

    .reading-content {
        padding: 1.5rem;
    }

    .chapter-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .books-list,
    .chapters-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
}

/* Botón Mark as Complete */
.complete-btn {
    background: linear-gradient(135deg, #4caf50, #388e3c) !important;
}

.complete-btn:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32) !important;
}

.complete-btn.completed {
    background: linear-gradient(135deg, #9e9e9e, #757575) !important;
    cursor: not-allowed;
}
/* ===================================
   HIGHLIGHTER STYLES
   =================================== */

.highlight {
    padding: 2px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.highlight:hover {
    opacity: 0.8;
}

.highlight-yellow {
    background-color: rgba(255, 235, 59, 0.5);
}

.highlight-orange {
    background-color: rgba(255, 152, 0, 0.5);
}

.highlight-green {
    background-color: rgba(76, 175, 80, 0.5);
}

.highlight-pink {
    background-color: rgba(233, 30, 99, 0.5);
}

/* Dark mode highlights */
body.dark .highlight-yellow {
    background-color: rgba(255, 235, 59, 0.3);
}

body.dark .highlight-orange {
    background-color: rgba(255, 152, 0, 0.3);
}

body.dark .highlight-green {
    background-color: rgba(76, 175, 80, 0.3);
}

body.dark .highlight-pink {
    background-color: rgba(233, 30, 99, 0.3);
}
/* ===================================
   YOUTUBE MUSIC PLAYER
   =================================== */

.music-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-family: var(--body-font);
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

.music-select:focus {
    outline: none;
    border-color: var(--gold);
}

#youtube-player-container {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.music-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.music-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--gold), #C49B33);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: var(--body-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

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

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

/* Dark mode */
body.dark .music-select {
    background: rgba(40, 40, 40, 0.9);
    border-color: #555;
    color: var(--text-light);
}

body.dark #youtube-player-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

