/* ============================================
   ARK Identity Bible Selector v12
   Full-screen accordion-style navigation
   ============================================ */

/* Full Screen Container */
.bible-selector-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.bible-selector-fullscreen.active {
    display: flex;
}

/* Screens */
.bs-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    background: #0a0a0a;
}

.bs-screen.active {
    display: flex;
}

/* Header */
.bs-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #0a0a0a;
    border-bottom: 1px solid #222;
    gap: 12px;
    flex-shrink: 0;
}

.bs-back-btn {
    background: none;
    border: none;
    color: #e8b562;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-back-btn:hover {
    background: rgba(232, 181, 98, 0.1);
}

.bs-title {
    flex: 1;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.bs-version-select select {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e8b562;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.bs-header-spacer {
    width: 40px;
}

/* Book List */
.bs-book-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Section Headers */
.bs-section-header {
    padding: 16px 20px 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e8b562;
    background: #0a0a0a;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Book Item */
.bs-book-item {
    border-bottom: 1px solid #1a1a1a;
}

.bs-book-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.bs-book-row:hover {
    background: #151515;
}

.bs-book-row:active {
    background: #1a1a1a;
}

.bs-book-name {
    flex: 1;
    font-size: 18px;
    color: #fff;
}

.bs-book-chapters {
    font-size: 13px;
    color: #666;
    margin-right: 12px;
}

.bs-expand-icon {
    color: #666;
    transition: transform 0.2s;
}

.bs-book-item.expanded .bs-expand-icon {
    transform: rotate(180deg);
    color: #e8b562;
}

.bs-book-item.expanded .bs-book-name {
    color: #e8b562;
}

/* Chapter Grid */
.bs-chapter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 8px 20px 20px;
    background: #111;
}

.bs-chapter-btn {
    aspect-ratio: 1;
    background: #222;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-chapter-btn:hover {
    background: #333;
}

.bs-chapter-btn:active {
    background: #5f0c0b;
    transform: scale(0.95);
}

/* Verse Screen Content */
.bs-verse-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    gap: 24px;
}

/* Verse Options */
.bs-verse-options {
    display: flex;
    gap: 12px;
}

.bs-option-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: #151515;
    border: 2px solid #222;
    border-radius: 12px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.bs-option-btn svg {
    width: 32px;
    height: 32px;
}

.bs-option-btn span {
    font-size: 14px;
    font-weight: 500;
}

.bs-option-btn:hover {
    background: #1a1a1a;
    border-color: #333;
}

.bs-option-btn.active {
    background: rgba(95, 12, 11, 0.2);
    border-color: #5f0c0b;
    color: #e8b562;
}

/* Range Inputs */
.bs-range-inputs {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    justify-content: center;
}

.bs-range-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bs-range-group label {
    font-size: 13px;
    color: #666;
    text-align: center;
}

.bs-range-group input {
    width: 80px;
    padding: 12px 16px;
    background: #151515;
    border: 2px solid #333;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.bs-range-group input:focus {
    border-color: #e8b562;
}

.bs-range-separator {
    color: #666;
    font-size: 16px;
    padding-bottom: 14px;
}

/* Load Button */
.bs-load-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #5f0c0b 0%, #7a1a19 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
    box-shadow: 0 4px 12px rgba(95, 12, 11, 0.3);
}

.bs-load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(95, 12, 11, 0.4);
}

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

.bs-load-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.bs-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bs-spin 0.8s linear infinite;
}

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

/* No Results */
.bs-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .bs-header {
        padding: 10px 12px;
    }
    
    .bs-title {
        font-size: 16px;
    }
    
    .bs-chapter-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        padding: 6px 16px 16px;
    }
    
    .bs-chapter-btn {
        font-size: 14px;
    }
    
    .bs-verse-content {
        padding: 20px 16px;
    }
    
    .bs-option-btn {
        padding: 16px 12px;
    }
    
    .bs-option-btn svg {
        width: 28px;
        height: 28px;
    }
}

/* Tablet+ */
@media (min-width: 768px) {
    .bs-chapter-grid {
        grid-template-columns: repeat(10, 1fr);
        max-width: 600px;
        margin: 0 auto;
    }
    
    .bs-book-list {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }
    
    .bs-verse-content {
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .bs-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    
    .bs-load-btn {
        margin-bottom: env(safe-area-inset-bottom);
    }
}
