/* style.css */

/* Basic Reset & Font for HTML element */
html {
    margin: 0;
    padding: 0;
    height: 100%; /* Good practice */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* Base font for the page */
}

/* Body styles for plexus background */
body {
    margin: 0;
    padding: 0;
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevent scrollbars from canvas itself affecting layout */
    background-color: #000000; /* BLACK BACKGROUND for canvas and page */
}

/* Plexus Canvas Styling */
#plexus-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place canvas behind the content */
    pointer-events: none; /* Allow mouse events to pass through to content */
}

/* Plexus Content Wrapper - new wrapper for original content */
.plexus-content-wrapper {
    position: relative; /* For z-index stacking against canvas */
    z-index: 1;      /* Ensure content is above the canvas */
    height: 100vh;   /* Occupy full viewport height */
    overflow-y: auto;/* Enable vertical scrolling for content if it overflows */
    box-sizing: border-box;

    /* Apply original body's text color for the content */
    color: #d1d5db;
    /* font-family is inherited from html */

    /* Layout for .bible-container: center it and allow its own padding */
    display: flex;
    justify-content: center; /* Horizontally center .bible-container */
    align-items: flex-start; /* Align .bible-container to the top */
}

/* Main Outer Container - Original .bible-container styles */
.bible-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children like header, controls */
    padding: 24px 16px; /* Existing padding - creates space from wrapper edges */
    box-sizing: border-box;
    width: 100%; /* Take full width of its alignment context in plexus-content-wrapper */
}

header {
    width: 100%;
    max-width: 800px;
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 10px;
    border-bottom: 1px solid #25282c;
}

header h1 {
    font-size: 2.2em;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: bold;
}

.gradient-text-effect {
    color: #007bff;
    background: linear-gradient(to right, #add8e6, #4169e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.controls {
    width: 100%;
    max-width: 800px;
    background-color: #111827;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #374151;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

#verse-display {
    width: 100%;
    max-width: 800px;
    background-color: #111827;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #374151;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    min-height: 300px;
    line-height: 1.8;
}

#verse-display.scroll-window-active {
    max-height: 570px;
    overflow-y: auto;
}

.controls label {
    margin-right: 8px;
    color: #9ca3af;
    align-self: center;
    font-size: 0.9em;
}

.controls select, .controls button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #4b5563;
    background-color: #1f2937;
    color: #d1d5db;
    font-size: 0.95em;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.controls select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-13z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 9px;
    padding-right: 32px;
}

.controls select:hover, .controls button:hover {
    border-color: #3b82f6;
    background-color: #374151;
}

.controls select:focus, .controls button:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.controls button {
    min-width: 120px;
    font-weight: 500;
}

.controls button:disabled {
    background-color: #1f2937;
    color: #6b7280;
    border-color: #4b5563;
    cursor: not-allowed;
    box-shadow: none;
}
.controls button:disabled:hover {
    border-color: #4b5563;
    background-color: #1f2937;
}

.control-group {
    display: flex;
    align-items: center;
}

/* --- MODIFIED CHECKBOX STYLING START --- */
.checkbox-group input[type="checkbox"] {
    /* Reset default appearance */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Dimensions and alignment (consistent with original) */
    width: 15px;
    height: 15px;
    margin-right: 6px;
    cursor: pointer;
    vertical-align: middle;

    /* Custom box styling */
    background-color: #3b82f6; /* Blue background for UNCHECKED state */
    border: 1px solid #3b82f6;  /* Blue border, same as background for a solid look */
    border-radius: 3px;         /* Optional: slightly rounded corners */

    position: relative; /* For positioning the custom checkmark */
    display: inline-block; /* Ensures proper layout */
    outline: none; /* Remove default outline, we'll use a custom focus style */
}

/* Custom checkmark using a pseudo-element (visible only when checked) */
.checkbox-group input[type="checkbox"]::before {
    content: "";
    position: absolute;
    box-sizing: border-box;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border-style: solid;
    border-color: white; /* Color of the checkmark */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0; /* Hidden by default (when unchecked) */
    transition: opacity 0.1s ease-in-out;
}

/* Show the checkmark when the checkbox is checked */
.checkbox-group input[type="checkbox"]:checked::before {
    opacity: 1; /* Make checkmark visible */
}

/* Checked state: background remains the same, checkmark is handled by ::before */
.checkbox-group input[type="checkbox"]:checked {
    /* background-color and border-color are already set by the base rule,
       but explicitly stating them here can prevent unexpected overrides. */
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Custom focus style (important for accessibility) */
.checkbox-group input[type="checkbox"]:focus-visible { /* Modern browsers */
    outline: 2px solid #8ec3ff; /* A lighter blue for focus */
    outline-offset: 1px;
}
/* Fallback focus for older browsers or if :focus-visible is not preferred */
.checkbox-group input[type="checkbox"]:focus {
    outline: 2px solid #8ec3ff; /* Consistent with :focus-visible */
    outline-offset: 1px;
}
/* --- MODIFIED CHECKBOX STYLING END --- */


.checkbox-group label {
    font-size: 0.9em;
    color: #9ca3af;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 0;
}

.verse-block {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #374151;
}
.verse-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.verse {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    position: relative;
    padding-left: 2.5em;
    min-height: 1.5em;
}

.verse-number {
    font-weight: 600;
    color: #3b82f6;
    font-size: 0.9em;
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 2em;
    text-align: right;
    margin-right: 0.5em;
}

.verse-text-rtl, .verse-text-ltr {
    display: block;
}

.original-text {
    color: #e5e7eb;
}
.verse-text-rtl.original-text {
    font-family: "Ezra SIL", "SBL Hebrew", "Noto Sans Hebrew", "Times New Roman", serif;
    font-size: 1.2em;
}
.verse-text-ltr.original-text {
    font-family: "SBL Greek", "Gentium Plus", "Noto Sans Greek", "Times New Roman", serif;
    font-size: 1.1em;
}

.verse-translation {
    margin-top: 8px;
    padding-left: 2.5em;
}

.english-text {
    color: #9ca3af;
    font-size: 0.9em;
    font-style: italic;
    line-height: 1.6;
}

.loading-indicator {
    font-style: italic;
    color: #9ca3af;
    text-align: center;
    padding: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.9em;
    }
    .controls, #verse-display {
        padding: 16px;
    }
    .controls {
        gap: 12px;
    }
     .checkbox-group {
        flex-basis: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }
     #verse-display.scroll-window-active {
        max-height: 350px;
    }
}

@media (max-width: 640px) {
    .bible-container {
        padding: 16px 8px;
    }
    header {
        margin-bottom: 24px;
    }
    header h1 {
        font-size: 1.6em;
        margin-bottom: 8px;
    }
    header {
        padding-bottom: 8px;
    }
    .controls, #verse-display {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .control-group {
        width: 100%;
        margin-bottom: 10px;
        justify-content: flex-start;
    }
    .control-group:last-child {
        margin-bottom: 0;
    }
    .controls select, .controls button {
        width: 100%;
    }
    .controls label:not(.checkbox-group label) {
        display: block;
        margin-bottom: 4px;
        margin-right: 0;
    }
    .checkbox-group {
        margin-top: 5px;
        justify-content: flex-start;
    }
    .checkbox-group label {
         margin-bottom: 0;
    }

    .verse, .verse-translation {
        padding-left: 2.2em;
    }
    .verse-number {
        width: 1.8em;
        margin-right: 0.4em;
    }
     #verse-display.scroll-window-active {
        max-height: 300px;
    }
}