/* Font Definitions */
@font-face {
    font-family: 'SBL Hebrew';

    src: local("SBL Hebrew"), local("SBLHebrew"),
         url(/src/fonts/SBLHebrew.woff2) format("woff2"),
         url(/src/fonts/SBLHebrew.woff) format("woff"),

         url(https://www.hebcal.com/i/SBLHebrew-1.56a.woff2) format("woff2"),
         url(https://www.hebcal.com/i/SBLHebrew-1.56a.woff) format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: fallback;
}
        body {
            font-family: 'SBL Hebrew', sans-serif;
            padding: 20px;
            direction: rtl;
        }
        #search-form {
            margin-bottom: 20px;
        }
        .music-container {
            margin-top: 20px;
        }
        #loading {
            display: none;
            color: #666;
        }
        .text-danger {
            color: red;
        }

/* Theme Variables */
:root {
    --base-bg: #ffffff;
    --base-text: #000000;
    --music-bg: #ffffff;
    --music-text: #000000;
}

:root[data-theme="dark"] {
    --base-bg: #000000;
    --base-text: #ffffff;
    --music-bg: #1a1a1a;
    --music-text: #ffffff;
}

/* Base Layout */
body {
    height: 100%;
    margin: 0;
    padding: 20px;
    background-color: var(--base-bg);
    color: var(--base-text);
    font-family: 'SBL Hebrew', sans-serif;
    direction: rtl;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#box {
    background-color: var(--base-bg);
    color: var(--base-text);
    width: 100%;
    min-height: 100vh;
    margin: auto;
    display: flex;
    flex-direction: column;
}

/* Search Form Styles */
#search-form {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    margin-bottom: 20px;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.search-type {
    color: var(--base-text);
    margin-bottom: 10px;
}

.form-control {
    max-width: 300px;
    display: inline-block;
}

.form-select {
    background-color: var(--base-bg);
    color: var(--base-text);
    border-color: var(--base-text);
}

.form-select:focus {
    border-color: var(--base-text);
    box-shadow: 0 0 0 0.25rem rgba(128, 128, 128, 0.25);
}

/* Verse Text and Tables */

.source-text-area {
    width: 100%;
    max-width: 100%; /* Ensure it doesn't overflow */
    border-collapse: collapse;
    direction: rtl;
    table-layout: fixed; /* Fixed layout for better control */
}

.source-text-area th,
.source-text-area td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: right;
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word; /* Modern word wrapping */
}

.source-text-area th {
    background-color: #D6EEEE;
}

.source-text-highlighted-area {
    background-color: #FFFF99;
}

/* Loading State */
.loading {
    color: var(--base-text);
    text-align: center;
    padding: 20px;
}

#loading {
    display: none;
    color: #666;
}

/* Music Container Styles */
.music-container {
    margin: 20px auto;
    max-width: 800px;
    width: 100%;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: var(--music-bg);
    color: var(--music-text);
}

#music-display {
    width: 100%;
    min-height: 120px;
    background-color: var(--music-bg);
}

/* SVG Music Notation Styles */
#music-display svg {
    color: var(--music-text) !important;
    background-color: var(--music-bg);
    width: 100% !important;
    height: auto !important;
}

#music-display svg * {
    fill: var(--music-text) !important;
    stroke: var(--music-text) !important;
}

/* Music Controls */
.music-controls {
    background-color: var(--base-bg);
    color: var(--base-text);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.music-controls label {
    font-weight: 100;
}

.form-range::-webkit-slider-thumb {
    background: var(--base-text);
}

.form-range::-moz-range-thumb {
    background: var(--base-text);
}



/* ABC Button */
#copy-abc-button {
    width: 120px;
    max-width: 120px;
    height: 30px;
    font-size: 14px;
    padding: 0 10px;
    margin: 10px;
    box-sizing: border-box;
}

/* Error Styles */
.error,
.text-danger {
    color: #ff0000;
    text-align: center;
    padding: 10px;
}

#title {
            text-align: center;
        }
        
#verse-content {
            display: inline-block;
            direction: rtl;
			font-size: 16px;
        }
		
.options-button {
            position: fixed;
            top: 10px;
            left: 10px;
            z-index: 1050; /* Ensures it stays above other content */
        }

    .table-container {
        width: 100%;
        margin-bottom: 20px;
        /* overflow-x removed to prevent horizontal scrolling */
    }
    
       /* Define column widths */
	
/* Table Styling for Proportional Text and Layout grok*/
.source-text-area {
    font-family: 'SBL Hebrew', sans-serif;
    font-size: 24px; /* 60% of 40px for proportionality */
    direction: rtl;
    border-collapse: collapse; /* Clean table borders */
    background-color: var(--base-bg);
    color: var(--base-text);
    margin: 20px auto; /* Center the table with spacing */
    max-width: 100%; /* Use full available width */
    width: 100%; /* Responsive width */
    table-layout: fixed; /* Fixed layout for better control */
}

/* Table Header and Cell Styling */
.source-text-area th,
.source-text-area td {
    padding: 10px; /* Add padding for readability */
    border: 1px solid #ddd; /* Light border for clarity */
    text-align: center; /* Center-align text */
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word; /* Modern word wrapping */
}
    /* Column Widths for Even Distribution */
.source-text-area th:nth-child(1),
.source-text-area td:nth-child(1) { /* #W */
    width: 5%;
}

.source-text-area th:nth-child(2),
.source-text-area td:nth-child(2) { /* ציטוט */
    width: 12%;
}

.source-text-area th:nth-child(3),
.source-text-area td:nth-child(3) { /* מילה */
    width: 12%;
}

.source-text-area th:nth-child(4),
.source-text-area td:nth-child(4) { /* הברות */
    width: 12%;
}

.source-text-area th:nth-child(5),
.source-text-area td:nth-child(5) { /* תעתיק */
    width: 12%;
}

.source-text-area th:nth-child(6),
.source-text-area td:nth-child(6) { /* מיקס */
    width: 42%; /* Wider for syllable(note) format */
}

.source-text-area th:nth-child(7),
.source-text-area td:nth-child(7) { /* #הברות */
    width: 5%;
}

/* For smaller screens, adjust column visibility */
@media screen and (max-width: 768px) {
    .source-text-area th:nth-child(4),
    .source-text-area td:nth-child(4),
    .source-text-area th:nth-child(5),
    .source-text-area td:nth-child(5) {
        display: none; /* Hide less important columns on small screens */
    }
}