/**
 * Jewish Bible Interpretation - Modern UI Styles
 * Complete visual overhaul with modern design principles
 * Version: 2.0
 */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

.jbi-verses-container,
.jbi-layered-navigation,
.jbi-on-page-search,
.jbi-chapter-info-accordion {
    box-sizing: border-box;
}

.jbi-verses-container *,
.jbi-layered-navigation *,
.jbi-on-page-search *,
.jbi-chapter-info-accordion * {
    box-sizing: inherit;
}

/* ========================================
   MODERN CONTAINER DESIGN
   ======================================== */

.jbi-verses-container {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 32px;
    margin: 24px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.jbi-verses-container:hover {
    box-shadow: 
        0 10px 15px rgba(0, 0, 0, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ========================================
   VERSE ITEMS - CARD DESIGN
   ======================================== */

.jbi-verse-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.jbi-verse-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #4A90E2 0%, #357ABD 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.jbi-verse-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04);
    border-color: #4A90E2;
}

.jbi-verse-item:hover::before {
    opacity: 1;
}

.jbi-verse-item.jbi-current-verse {
    background: linear-gradient(135deg, #EBF4FF 0%, #E3F2FD 100%);
    border-color: #4A90E2;
    box-shadow: 
        0 8px 24px rgba(74, 144, 226, 0.15),
        0 2px 8px rgba(74, 144, 226, 0.1);
}

.jbi-verse-item.jbi-current-verse::before {
    opacity: 1;
    width: 6px;
}

/* ========================================
   REFERENCE BADGE
   ======================================== */

.jbi-verse-reference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f2f5;
}

.jbi-verse-reference {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
    transition: all 0.3s ease;
}

.jbi-verse-reference:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
}

/* ========================================
   ACTION BUTTONS - MODERN PILL DESIGN
   ======================================== */

.jbi-verse-actions {
    display: flex;
    gap: 8px;
}

.jbi-permalink-button,
.jbi-favorite-button {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6c757d;
    font-size: 16px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jbi-permalink-button:hover,
.jbi-favorite-button:not(.active):hover {
    background: #ffffff;
    border-color: #4A90E2;
    color: #4A90E2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
}

/* Favorite button active state */
.jbi-favorite-button.active {
    background: linear-gradient(135deg, #FF6B9D 0%, #E74C3C 100%) !important;
    border-color: #E74C3C !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3) !important;
}

.jbi-favorite-button.active:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4) !important;
}

.jbi-favorite-button i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.jbi-favorite-button:hover i {
    transform: scale(1.1);
}

/* ========================================
   CONTENT WRAPPERS - DUAL TONE DESIGN
   ======================================== */

.jbi-verse-content-row {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

.jbi-verse-content-column,
.jbi-verse-interpretation-column {
    flex: 1;
    min-width: 0;
}

.jbi-verse-content-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.jbi-verse-content-wrapper:hover {
    border-color: #4A90E2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

.jbi-verse-interpretation-wrapper {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFFBF0 100%);
    border: 2px solid #FFE082;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.jbi-verse-interpretation-wrapper:hover {
    border-color: #FFD54F;
    box-shadow: 0 4px 12px rgba(255, 213, 79, 0.2);
}

.jbi-verse-content,
.jbi-verse-interpretation {
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    font-weight: 400;
}

.jbi-verse-content p:last-child,
.jbi-verse-interpretation p:last-child {
    margin-bottom: 0;
}

/* Hebrew text enhancement */
.jbi-verse-content,
.jbi-verse-interpretation {
    direction: rtl;
    text-align: right;
}

.jbi-verse-content[lang="he"],
.jbi-verse-interpretation[lang="he"] {
    font-family: 'David Libre', 'Frank Ruhl Libre', 'Times New Roman', serif;
    font-size: 18px;
    line-height: 2;
}

/* ========================================
   SECTION TITLES - ELEGANT HEADERS
   ======================================== */

.jbi-section-headers {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 3px solid #e9ecef;
}

.jbi-section-header-column {
    flex: 1;
    text-align: center;
}

.jbi-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========================================
   NAVIGATION - MODERN CONTROLS
   ======================================== */

.jbi-verse-navigation {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.jbi-verse-nav-button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.jbi-verse-nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
}

.jbi-verse-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.jbi-verse-select {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #ffffff;
    min-width: 180px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jbi-verse-select:hover {
    border-color: #4A90E2;
}

.jbi-verse-select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* ========================================
   FLOATING NAVIGATION - MODERN FAB DESIGN
   ======================================== */

.jbi-floating-nav {
    position: fixed;
    z-index: 1000;
    display: flex;
    gap: 12px;
}

.jbi-floating-nav-right {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

.jbi-floating-nav-left {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

.jbi-floating-nav-bottom {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.jbi-floating-nav-bottom .jbi-floating-nav-counter {
    margin: 0 10px;
}

.jbi-floating-nav-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    font-size: 20px;
}

.jbi-floating-nav-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.jbi-floating-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.jbi-floating-nav-counter {
    padding: 10px 20px;
    background: rgba(44, 62, 80, 0.9);
    color: #ffffff;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ========================================
   LAYERED NAVIGATION - SIDEBAR DESIGN
   ======================================== */

.jbi-layered-navigation {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.jbi-layered-navigation-title {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    padding: 20px 24px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 16px;
}

.jbi-navigation-container {
    overflow-y: auto;
    padding: 16px;
    flex: 1;
}

.jbi-book-container {
    margin-bottom: 16px;
}

.jbi-book-header {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #2c3e50;
}

.jbi-book-header:hover {
    background: #e9ecef;
    border-color: #4A90E2;
    transform: translateX(4px);
}

.jbi-book-header.active,
.jbi-active-book .jbi-book-header {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    border-color: #357ABD;
    color: #ffffff;
}

.jbi-book-header i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.jbi-chapters-container {
    padding-left: 16px;
    margin-top: 8px;
}

.jbi-chapter-item {
    padding: 10px 16px;
    margin: 4px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jbi-chapter-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.jbi-chapter-item a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

.jbi-active-chapter .jbi-chapter-item {
    background: #E3F2FD;
    font-weight: 600;
}

.jbi-verse-item {
    padding: 8px 16px;
    margin: 2px 0 2px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.jbi-layered-navigation .jbi-verse-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.jbi-layered-navigation .jbi-verse-item a {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
}

.jbi-layered-navigation .jbi-verse-item.jbi-active-item {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    border-left: 4px solid #357ABD;
}

.jbi-layered-navigation .jbi-verse-item.jbi-active-item a {
    color: #ffffff;
    font-weight: 600;
}

/* ========================================
   SEARCH - MODERN INPUT DESIGN
   ======================================== */

.jbi-on-page-search {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.jbi-search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.jbi-search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.jbi-search-input:focus {
    outline: none;
    border-color: #4A90E2;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.jbi-search-button {
    padding: 14px 24px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.jbi-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
}

.jbi-search-highlight {
    background-color: #fff3cd !important;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.jbi-search-highlight-active {
    background-color: #ffa500 !important;
    color: #000 !important;
}

/* ========================================
   DARK MODE - ENHANCED CONTRAST
   ======================================== */

.jbi-dark-mode-active .jbi-verses-container {
    background: linear-gradient(to bottom, #1a1a1a 0%, #0f0f0f 100%);
}

.jbi-dark-mode-active .jbi-verse-item {
    background: #222222;
    border-color: #333333;
}

.jbi-dark-mode-active .jbi-verse-item.jbi-current-verse {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2847 100%);
    border-color: #4A90E2;
}

.jbi-dark-mode-active .jbi-verse-content-wrapper {
    background: linear-gradient(135deg, #2a2a2a 0%, #222222 100%);
    border-color: #333333;
}

.jbi-dark-mode-active .jbi-verse-interpretation-wrapper {
    background: linear-gradient(135deg, #2a2410 0%, #221f0f 100%);
    border-color: #3a3410;
}

.jbi-dark-mode-active .jbi-verse-content,
.jbi-dark-mode-active .jbi-verse-interpretation {
    color: #e0e0e0;
}

.jbi-dark-mode-active .jbi-layered-navigation {
    background: #1a1a1a;
}

.jbi-dark-mode-active .jbi-book-header {
    background: #222222;
    border-color: #333333;
    color: #e0e0e0;
}

.jbi-dark-mode-active .jbi-book-header:hover {
    background: #2a2a2a;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .jbi-verses-container {
        padding: 20px;
        border-radius: 12px;
    }
    
    .jbi-verse-item {
        padding: 16px;
    }
    
    .jbi-verse-content-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .jbi-section-headers {
        flex-direction: column;
        gap: 12px;
    }
    
    .jbi-floating-nav-right,
    .jbi-floating-nav-left {
        right: 16px;
        left: auto;
    }
    
    .jbi-floating-nav-button {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .jbi-verse-navigation {
        flex-wrap: wrap;
        padding: 16px;
    }
    
    .jbi-verse-select {
        width: 100%;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .jbi-floating-nav,
    .jbi-verse-actions,
    .jbi-verse-navigation {
        display: none !important;
    }
    
    .jbi-verse-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

.jbi-verse-item:focus-within {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.jbi-favorite-button:focus,
.jbi-permalink-button:focus,
.jbi-verse-nav-button:focus,
.jbi-search-button:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

/* Ensure icons are visible */
.fas, .far, .fab {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900;
    display: inline-block !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.far {
    font-weight: 400 !important;
}

.fab {
    font-family: "Font Awesome 5 Brands" !important;
    font-weight: 400 !important;
}
