body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 2em; 
    line-height: 1.6; 
    background-color: #f4f4f9;
    color: #333;
    margin: auto;
    width: 50%;
    padding: 10px;
}

h2, h3 {
    color: #2c3e50;
}
.header {
    color: white;
    text-align: center;
    margin-bottom: 1em;
    background-color: #dd2938;
}

/* --- Controls Styling --- */
.controls {
    margin-bottom: 2em;
}

.container {
    background-color: white;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    border-radius: 15px;
}

.content {
    padding-right: 20px;
    padding-left: 20px;
    padding-bottom: 20px;
    box-shadow: none;
}

/* Input group styling */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.input-group input[type="text"] {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

.input-group input[type="text"]:invalid {
    border-color: #e74c3c;
}

/* Custom checkbox styling */
.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    padding: 10px 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.checkbox-label .checkmark {
    margin-left: 5px;
}

.controls button {
    padding: 10px 18px;
    border: none;
    background-color: #3498db;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px 5px 5px 0;
    vertical-align: middle;
}

.controls button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.controls button:hover:not(:disabled) {
    background-color: #2980b9;
}

/* Custom file upload button */
input[type="file"] {
    display: none;
}

.custom-file-upload {
    display: inline-block;
    padding: 10px 18px;
    cursor: pointer;
    background-color: #2ecc71;
    color: white;
    border-radius: 5px;
    font-size: 16px;
    vertical-align: middle;
    margin-right: 10px;
}

.custom-file-upload:hover {
    background-color: #27ae60;
}

/* --- Status & File List Styling --- */
#status { 
    font-style: italic; 
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Loading spinner */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.show {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulsing dots animation as alternative */
.loading-dots {
    display: none;
}

.loading-dots.show {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: #555;
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 #555,
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 #555,
            .5em 0 0 #555;
    }
}

#fileList {
    list-style-type: none;
    padding: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 250px;
    overflow-y: auto;
}

#fileList li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

#fileList li:last-child {
    border-bottom: none;
}

.success, .text-success {
    color: #27ae60;
    font-weight: bold;
}

.error, .text-error {
    color: #e74c3c;
    font-weight: bold;
}

.text-processing {
    color: #f39c12;
    font-weight: bold;
}

/* FontAwesome icon spacing in buttons and labels */
.controls button i,
.custom-file-upload i {
    margin-right: 8px;
}

/* File list icon spacing */
#fileList i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}