/**
 * Scripture Reader Modal Styles
 * Beautiful, functional Bible reading experience
 */

/* Modal Overlay */
.modal-overlay#scriptureModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay#scriptureModal.active {
    display: flex;
}

/* Modal Content */
.scripture-modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(239, 122, 56, 0.2);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Header */
.scripture-modal-header {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.scripture-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.nav-chapter-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(239, 122, 56, 0.1);
    border: 1px solid rgba(239, 122, 56, 0.3);
    color: var(--forge-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.nav-chapter-btn:hover {
    background: rgba(239, 122, 56, 0.2);
    border-color: var(--forge-primary);
    transform: scale(1.05);
}

.nav-chapter-btn:active {
    transform: scale(0.95);
}

.scripture-selectors {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 500px;
}

.scripture-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    color: var(--white);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23afafaf' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.scripture-select:focus {
    outline: none;
    border-color: var(--forge-primary);
    background-color: rgba(239, 122, 56, 0.05);
}

.scripture-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.scripture-select option {
    background: #1a1a1a;
    color: var(--white);
}

#scriptureBook {
    flex: 2;
    min-width: 150px;
}

#scriptureChapter {
    flex: 0.7;
    min-width: 80px;
}

#scriptureVerse {
    flex: 1.2;
    min-width: 120px;
}

.scripture-translation {
    display: flex;
    align-items: center;
}

#scriptureTranslation {
    min-width: 90px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-400);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Modal Body */
.scripture-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

/* Scrollbar Styling */
.scripture-modal-body::-webkit-scrollbar {
    width: 8px;
}

.scripture-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.scripture-modal-body::-webkit-scrollbar-thumb {
    background: rgba(239, 122, 56, 0.3);
    border-radius: 4px;
}

.scripture-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 122, 56, 0.5);
}

/* Loading State */
.scripture-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(239, 122, 56, 0.1);
    border-top-color: var(--forge-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scripture-loading p {
    color: var(--gray-400);
    font-size: 1rem;
}

/* Error State */
.scripture-error {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: var(--gray-400);
}

.scripture-error i {
    font-size: 3rem;
    color: #e74c3c;
}

/* Content */
.scripture-content {
    display: none;
}

.chapter-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--forge-primary);
    margin: 0 0 2rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(239, 122, 56, 0.2);
}

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

.verse {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.verse:hover {
    background: rgba(255, 255, 255, 0.03);
}

.verse.highlighted {
    background: rgba(239, 122, 56, 0.1);
    border-left: 4px solid var(--forge-primary);
    padding-left: calc(1rem - 4px);
    box-shadow: 0 4px 12px rgba(239, 122, 56, 0.2);
}

.verse-number {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--forge-primary);
    min-width: 35px;
    text-align: right;
    flex-shrink: 0;
    user-select: none;
}

.verse-text {
    color: var(--gray-200);
    font-size: 1.063rem;
    line-height: 1.8;
    flex: 1;
}

/* Footer */
.scripture-modal-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
}

.scripture-copyright {
    color: var(--gray-500);
    font-size: 0.75rem;
    margin: 0;
    text-align: center;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .scripture-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .scripture-modal-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .scripture-controls {
        width: 100%;
    }

    .scripture-selectors {
        max-width: none;
        flex: 1;
    }

    .scripture-translation {
        width: 100%;
    }

    #scriptureTranslation {
        width: 100%;
    }

    .modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .scripture-modal-body {
        padding: 1.5rem 1rem;
    }

    .chapter-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .verse {
        gap: 0.75rem;
    }

    .verse-number {
        min-width: 30px;
        font-size: 0.813rem;
    }

    .verse-text {
        font-size: 1rem;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    .scripture-selectors {
        flex-wrap: wrap;
    }

    #scriptureBook,
    #scriptureChapter,
    #scriptureVerse {
        min-width: 0;
    }

    #scriptureBook {
        width: 100%;
    }

    #scriptureChapter,
    #scriptureVerse {
        flex: 1;
    }

    .verse {
        flex-direction: column;
        gap: 0.5rem;
    }

    .verse-number {
        text-align: left;
    }
}
