/* 
 * Shared Book Stylesheet
 * Common styles for all book content sections
 * Based on Book HTML Style Guide
 */

/* ===== FLOATING NAVIGATION BAR ===== */
.floating-nav {
    position: fixed;
    top: 48px; /* Default position below main menu, will be adjusted by JS */
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(240, 240, 240, 0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: top 0.2s ease; /* Smooth transition when position changes */
}

.floating-nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-prev, .nav-next {
    flex: 1;
    min-width: 0;
}

.nav-prev {
    text-align: left;
}

.nav-contents {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 350px;
}

.nav-contents select {
    font-size: 0.9rem;
    border: 1px solid rgba(74, 144, 226, 0.4);
    border-radius: 6px;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    width: 100%;
    font-weight: 500;
}

.nav-contents select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.nav-next {
    text-align: right;
}

/* Add padding to chapter-view to account for fixed nav */
.chapter-view {
    padding-top: 80px; /* Account for main menu (48px) + floating nav height */
}

/* Mobile responsive */
@media (max-width: 768px) {
    .floating-nav {
        top: 40px; /* Default position below main menu on mobile, will be adjusted by JS */
        transition: top 0.2s ease; /* Smooth transition when position changes */
    }

    .chapter-view {
        padding-top: 70px; /* Adjusted for mobile menu height */
    }

    .floating-nav-content {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .nav-prev a, .nav-next a {
        font-size: 0.85rem;
        max-width: 100px;
    }

    /* Mobile: hide text and show only arrows */
    @media (max-width: 768px) {
        .nav-prev a, .nav-next a {
            font-size: 0;
            position: relative;
            padding: 0.25rem 0.5rem;
        }
        
        .nav-prev a:before {
            content: "←";
            font-size: 0.85rem;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
        
        .nav-next a:after {
            content: "→";
            font-size: 0.85rem;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
    }

    .nav-contents {
        min-width: 140px;
        max-width: 200px;
    }

    .nav-contents select {
        font-size: 0.8rem;
    }
}

/* ===== BASE TYPOGRAPHY ===== */
.book-section {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    max-width: 1400px;
    margin: 0 auto;
}

.book-section p {
    margin: 1rem 0;
    font-size: 1.05rem;
    line-height: 1.8;
}

.book-section strong {
    color: #764ba2;
}

.book-section em {
    font-style: italic;
    color: #555;
}

/* ===== HEADINGS ===== */
.book-section h2 {
    color: #1a202c;
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 4px solid #4a90e2;
}

.book-section h3 {
    color: #1a202c;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 4px solid #4a90e2;
}

.book-section h4 {
    color: #764ba2;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-left: 10px;
    border-left: 5px solid #764ba2;
}

.book-section h5 {
    color: #4a90e2;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

/* ===== LINKS ===== */
.book-section a {
    color: #4a90e2;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.book-section a:hover {
    border-bottom-color: #4a90e2;
}

/* ===== BLOCKQUOTES ===== */
.book-section blockquote {
    background: #f9f9f9;
    border-left: 5px solid #764ba2;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    border-radius: 6px;
}

.book-section blockquote p {
    margin: 0.5rem 0;
}

/* ===== SCRIPTURE BLOCKS ===== */
.scripture-block {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 5px solid #4a90e2;
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1.9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.scripture-block .verse-ref {
    font-weight: 600;
    color: #764ba2;
}

.scripture-block .highlight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    color: #856404;
}

/* ===== HIGHLIGHT (STANDALONE) ===== */
.highlight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    color: #856404;
}

/* ===== CALLOUT BOXES ===== */
.info-callout {
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    border-left: 5px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-callout.blue {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #2196f3;
}

.info-callout.blue strong {
    color: #1565c0;
}

.info-callout.green {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-color: #4caf50;
}

.info-callout.green strong {
    color: #2e7d32;
}

.info-callout.gold {
    background: linear-gradient(135deg, #fff9e6, #ffe4a3);
    border-color: #ffc107;
}

.info-callout.gold strong {
    color: #856404;
}

.info-callout.red {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-color: #f44336;
}

.info-callout.red strong {
    color: #c62828;
}

/* ===== MESSAGE BOXES ===== */
.msg {
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-weight: 500;
}

.msg--highlight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    color: #856404;
}

.msg--info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    color: #1565c0;
}

/* ===== IMPORTANT CALLOUT ===== */
.important-callout {
    background: linear-gradient(135deg, #fff9e6, #ffe4a3);
    border: 3px solid #ffc107;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.important-callout strong {
    color: #856404;
    font-size: 1.15rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== TABLES ===== */
.book-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

/* Override Syncfusion RTE table styles */
.book-section .e-rte-table th {
    background: none !important;
    border: none !important;
    padding: 15px !important;
    height: auto !important;
    min-width: auto !important;
}

.book-section .e-rte-table td {
    border: 1px solid #dee2e6 !important;
    padding: 10px !important;
    height: auto !important;
    min-width: auto !important;
}

/* Only apply purple gradient to tables with thead */
.book-section table:has(thead) {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-section thead {
    background: linear-gradient(135deg, #4a90e2, #764ba2);
    color: white;
}

.book-section thead th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    font-size: 1rem;
}

.book-section tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.book-section tbody tr:hover {
    background: #f8f9fa;
}

.book-section tbody tr:last-child {
    border-bottom: none;
}

.book-section tbody td {
    padding: 12px 15px;
    color: #2c3e50;
}

.book-section tbody tr:nth-child(even) {
    background: #fafafa;
}

.book-section tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* ===== TIMELINE TABLE CELLS ===== */
.night-cell {
    background: #2e74b5;
    color: white;
    text-align: center;
    border: 2px solid #1e5a8f !important;
    padding: 20px !important;
    font-weight: 600;
    font-size: 1.2rem;
}

.day-cell {
    background: #ffd966;
    text-align: center;
    border: 2px solid #d4a830 !important;
    padding: 20px !important;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.2rem;
}

/* Timeline table specific styling */
.book-section table:has(.night-cell),
.book-section table:has(.day-cell) {
    width: 120%;
    max-width: 120%;
    margin-left: -10%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 3px solid #4a90e2;
    border-radius: 12px;
    overflow: hidden;
}

.book-section table:has(.night-cell) th,
.book-section table:has(.day-cell) th {
    border: 2px solid #5a67d8 !important;
    padding: 15px !important;
    text-align: center !important;
    vertical-align: top !important;
    line-height: 1.4;
}

.book-section table:has(.night-cell) th:first-child,
.book-section table:has(.day-cell) th:first-child {
    border-top-left-radius: 10px;
}

.book-section table:has(.night-cell) th:last-child,
.book-section table:has(.day-cell) th:last-child {
    border-top-right-radius: 10px;
}

.book-section table:has(.night-cell) td:first-child,
.book-section table:has(.day-cell) td:first-child {
    border-bottom-left-radius: 10px;
}

.book-section table:has(.night-cell) td:last-child,
.book-section table:has(.day-cell) td:last-child {
    border-bottom-right-radius: 10px;
}

.book-section table:has(.night-cell) td,
.book-section table:has(.day-cell) td {
    width: auto;
}

.book-section table:has(.night-cell) small,
.book-section table:has(.day-cell) small {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: normal;
}

/* ===== CONTAINERS & CARDS ===== */
.calendar-container {
    margin: 2rem auto;
    padding: 20px;
    max-width: 1600px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.header {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    background: linear-gradient(135deg, #4a90e2, #764ba2);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* ===== IMAGE CONTAINERS ===== */
.image-container {
    margin: 2rem 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-caption {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
}

/* ===== LISTS ===== */
.book-section ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.book-section ul li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.book-section ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.book-section ol li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
    margin: 3rem 0;
    border: none;
    border-top: 2px solid #e0e0e0;
}

/* ===== LEGEND ===== */
.legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 1.5rem 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 1.5rem 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .book-section table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .book-section {
        padding: 15px;
    }

    .book-section h2,
    .book-section h3 {
        font-size: 1.5rem;
    }

    .book-section h4 {
        font-size: 1.2rem;
    }

    .scripture-block {
        padding: 1rem;
        font-size: 1rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ===== CHAPTER 7 PROOF SECTION STYLES ===== */
.proof-section {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, system-ui, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
}

.proof-section h2 {
    color: #1a202c;
    font-size: 1.875rem;
    font-weight: 700;
    margin: 1.5rem 0;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.75rem;
}

.proof-section h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
}

/* Calendar comparison table */
.cal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cal-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px;
    font-weight: 600;
    border: 1px solid #5a67d8;
}

.cal-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    min-width: 90px;
}

.cal-table .greg {
    background: #f0f4ff;
    font-weight: 600;
    color: #2c3e50;
}

.cal-table .zadok {
    background: #fafafa;
    color: #c45911;
}

.cal-table .new-year {
    background: linear-gradient(135deg, #fbe4d5, #f9d5c1);
    color: #c45911;
    font-weight: 700;
}

.cal-table .last-day {
    background: #fff9e6;
    color: #c45911;
    font-style: italic;
}

.cal-table .sat {
    font-weight: 700;
}

.cal-table .empty {
    background: #f8f9fa;
}

.cal-table .eq {
    color: #d97706;
    font-size: 0.85em;
}

.note-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.hl {
    text-decoration: underline;
    color: #236fa1;
    font-weight: 600;
}

/* ===== TOOLTIP STYLES ===== */

/* Tooltip trigger span */
.term-tooltip {
    color: #6f42c1;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    cursor: help;
    position: relative;
    transition: color 0.2s ease;
}

.term-tooltip:hover {
    color: #5a2ea6;
}

/* Tooltip popup container */
.tooltip-popup {
    position: fixed;
    background: white;
    border: 2px solid #6f42c1;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(111, 66, 193, 0.3);
    padding: 15px;
    max-width: 400px;
    z-index: 10000;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tooltip-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #6f42c1;
}

.tooltip-popup-content {
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

.tooltip-popup-content p {
    margin: 0 0 8px 0;
}

.tooltip-popup-content p:last-child {
    margin-bottom: 0;
}

.tooltip-popup-content strong {
    color: #6f42c1;
}

.tooltip-close {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tooltip-close:hover {
    color: #6f42c1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tooltip-popup {
        max-width: 90%;
        left: 5% !important;
        right: 5%;
    }
}

