body {
    font-family: 'Be Vietnam Pro', sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    /* background-image: url('Images/Bible background.jpg'); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #e0e0e0; /* Light gray for body text */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dark overlay */
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background: rgba(23, 32, 42, 0.95); /* Darker background for container */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h2 {
    color: #90caf9; /* Light blue for headings */
    text-align: center;
    font-weight: 700;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px; 
    color: #bbdefb; /* Lighter blue for labels */
}

.main-section-label {
    color: #ffab40; /* Amber for main section labels */
}

hr {
    border: none;
    border-top: 1px solid #424242; /* Darker border for separator */
    margin: 30px 0;
}

textarea, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #546e7a; /* Darker border */
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box; /* Important */
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Be Vietnam Pro', sans-serif;
}
        
textarea, input[type="text"], input[type="number"] {
    background-color: #263238; /* Dark background for inputs */
    color: #e0e0e0; /* Light text for inputs */
}

input[type="file"] {
    cursor: pointer;
}

input::file-selector-button {
    font-weight: bold;
    color: #2980b9;
    padding: 8px 12px;
    border: 1px solid #2980b9;
    border-radius: 6px;
    background-color: #37474f; /* Darker background for file selector button */
    cursor: pointer;
    transition: background-color 0.2s;
}

input::file-selector-button:hover {
    background-color: #455a64; /* Slightly lighter dark on hover */
}


textarea:focus, input[type="text"]:focus, input[type="number"]:focus {
    border-color: #3498db; /* Peter River */
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
    outline: none;
}

button {
    background: linear-gradient(45deg, #3498db, #2980b9); /* Peter River to Belize Hole */
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    /* width: 100%; */
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.4);
    font-family: 'Be Vietnam Pro', sans-serif;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.6);
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    background: linear-gradient(45deg, #bdc3c7, #95a5a6);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#report b {
    color: #81d4fa; /* Light blue for bold text in report */
}


#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 30, 40, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}

.loader {
    border: 8px solid #7f8c8d; /* Asbestos */
    border-top: 8px solid #3498db; /* Peter River */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}

#loadingOverlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
    font-family: 'Be Vietnam Pro', sans-serif;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style for italic helper text */
.main-section-label i { 
    color: #9e9e9e; /* Gray for italic helper text */
    font-size: 0.9em;
}

.background-picker {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    align-items: flex-start;
}

.thumbnail-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.thumbnail-label {
    font-size: 0.8em;
    color: #9e9e9e;
}

.static-thumbnail, .custom-file-upload {
    width: 100px;
    height: 60px;
    border-radius: 4px;
    border: 1px solid #546e7a;
    object-fit: cover;
}

.custom-file-upload {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    background-color: #263238;
    transition: background-color 0.2s, border-color 0.2s;
    overflow: hidden; /* To contain the user thumbnail */
}

.custom-file-upload:hover {
    background-color: #37474f;
    border-color: #90caf9;
}

.custom-file-upload .fa-plus {
    color: #90caf9;
    font-size: 24px;
    transition: opacity 0.2s;
}

.user-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.static-thumbnail.selected, .custom-file-upload.selected {
    border: 2px solid #3498db; /* Peter River */
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.7);
}

/* --- Preview Modal Styles --- */
#previewOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 30, 40, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Higher than loading overlay */
    padding: 2vh;
    box-sizing: border-box;
}

#previewContainer {
    position: relative;
    background: #2c3e50;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.4);
    width: 100%;
    max-width: 90vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

#previewHeader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #424242;
    flex-shrink: 0;
}

#previewHeader h3 {
    margin: 0;
    color: #90caf9;
    font-size: 1.2em;
}

.preview-disclaimer {
    color: #e74c3c;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 4px;
    margin-bottom: 0;
}

.preview-controls {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    width: 100%;
    border-top: 1px solid #424242;
    border-bottom: 1px solid #424242;
    margin-top: 10px;
    margin-bottom: revert;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bbdefb;
    font-size: 0.9em;
}

.slider-group input[type="range"] {
    width: 150px;
}

.slider-group span {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
    font-size: 1em;
    color: #fff;
}

.color-picker {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 15px;
    border-left: 1px solid #546e7a;
    padding-left: 15px;
}

.color-picker input[type="radio"] {
    display: none; /* Ẩn radio button gốc */
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #7f8c8d; /* Màu viền mặc định */
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.color-swatch:hover {
    transform: scale(1.15);
}

/* Khi radio được chọn, style cho label (swatch) liền kề nó */
.color-picker input[type="radio"]:checked + .color-swatch {
    border-color: #3498db; /* Peter River */
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.8);
    transform: scale(1.1);
}
#closePreviewBtn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    background: #e74c3c;
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 32px;
    text-align: center;
    padding: 0;
    font-weight: bold;
    z-index: 2010;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.2s, background-color 0.2s;
}

#closePreviewBtn:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

#tileContainer {
    flex-grow: 1;
    overflow: hidden;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    background-color: #1c2833;
}

.slide-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slide-number {
    font-weight: bold;
    color: #bbdefb;
}

.slide-tile-viewer {
    position: relative;
    background-color: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 1px solid #546e7a;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#slideViewerWrapper, #slideViewer, #previewControls {
    display: none; /* No longer used */
}

.preview-text-element {
    position: absolute;
    box-sizing: border-box;
    padding: 0.5%; /* Small padding for text */
    line-height: 0.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
}

/* Style for superscript verse numbers in preview */
.preview-text-element sup {
    position: relative;
    font-size: 75%;
    line-height: 0;
    vertical-align: baseline;
    top: -0.5em;
}

#previewControls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 20px;
    flex-shrink: 0;
}

#previewControls button {
    width: auto;
    padding: 10px 20px;
    font-size: 1em;
}

#slideCounter {
    color: white;
    font-size: 1.1em;
    min-width: 50px;
    text-align: center;
}

#previewDownload {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #424242;
    flex-shrink: 0;
}

#previewDownload button {
    width: auto;
    padding: 12px 30px;
}