/* ===== Book Chapter Selector Styling ===== */

/**
 * Full-screen modal for book and chapter selection
 * Child-friendly, touch-optimized interface
 */

.book-chapter-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.book-chapter-selector-modal.visible {
    opacity: 1;
    visibility: visible;
}

.book-chapter-selector-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.book-chapter-selector-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', cursive, sans-serif;
}

/* ===== Selector Header ===== */

.selector-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.selector-back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.selector-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

.selector-title {
    margin: 0;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
}

/* ===== Selector Content ===== */

.selector-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* ===== Testament Section ===== */

.testament-section {
    margin-bottom: 30px;
}

.testament-section:last-child {
    margin-bottom: 0;
}

.testament-header {
    color: #4B0082;
    font-size: 1.6em;
    margin: 0 0 20px 0;
    padding: 15px;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 15px;
    border-bottom: 3px solid #667eea;
    font-weight: bold;
}

/* ===== Books Grid ===== */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.book-button {
    padding: 20px 15px;
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.book-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1);
}

.book-button:active {
    transform: translateY(-1px) scale(0.98);
}

/* Shimmer effect for book buttons */
.book-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    border-radius: 15px;
}

.book-button:hover::before {
    left: 100%;
}

/* ===== Chapter Selection ===== */

.chapter-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 15px;
    border-bottom: 3px solid #667eea;
}

.chapter-subtitle {
    color: #666;
    font-size: 1.1em;
    margin: 0 0 10px 0;
}

.chapter-book-name {
    color: #4B0082;
    font-size: 2.2em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== Chapters Grid ===== */

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin: 0;
}

.chapter-button {
    padding: 18px 12px;
    border: 2px solid #667eea;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #E0F2FF, #F0F8FF);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4B0082;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-button:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #764ba2;
}

.chapter-button:active {
    transform: translateY(0) scale(0.98);
}

.chapter-button.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #4B0082;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* ===== Mobile Responsiveness ===== */

@media (max-width: 768px) {
    .book-chapter-selector-container {
        width: 98%;
        max-height: 95vh;
        border-radius: 15px;
    }

    .selector-header {
        padding: 15px;
        border-radius: 15px 15px 0 0;
    }

    .selector-back-btn {
        padding: 8px 12px;
        font-size: 1em;
    }

    .selector-title {
        font-size: 1.5em;
    }

    .selector-content {
        padding: 20px;
    }

    .testament-header {
        font-size: 1.4em;
        margin-bottom: 15px;
        padding: 12px;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .book-button {
        padding: 18px 12px;
        font-size: 1em;
        min-height: 75px;
    }

    .chapter-header {
        margin-bottom: 20px;
        padding: 15px;
    }

    .chapter-subtitle {
        font-size: 1em;
    }

    .chapter-book-name {
        font-size: 1.8em;
    }

    .chapters-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }

    .chapter-button {
        padding: 15px 10px;
        font-size: 1.1rem;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .book-chapter-selector-container {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .selector-header {
        border-radius: 0;
    }

    .selector-title {
        font-size: 1.3em;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
    }

    .book-button {
        padding: 16px 10px;
        font-size: 0.95rem;
        min-height: 70px;
    }

    .chapters-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 6px;
    }

    .chapter-button {
        padding: 12px 8px;
        font-size: 1rem;
        min-height: 45px;
    }
}

/* ===== Animations ===== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.book-chapter-selector-modal.visible .book-chapter-selector-container {
    animation: slideIn 0.3s ease;
}

/* ===== Scrollbar Styling ===== */

.book-chapter-selector-container::-webkit-scrollbar {
    width: 10px;
}

.book-chapter-selector-container::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
}

.book-chapter-selector-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.book-chapter-selector-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.selector-content::-webkit-scrollbar {
    width: 8px;
}

.selector-content::-webkit-scrollbar-track {
    background: transparent;
}

.selector-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.selector-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}
