/* Global styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: #0056b3;
    margin-bottom: 0.5rem;
}

/* Upload section */
.upload-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.upload-container {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background-color: #f9f9f9;
    transition: border-color 0.3s ease;
}

.upload-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.upload-type-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    transition: background-color 0.3s ease;
}

.upload-type-toggle:hover {
    background-color: #f0f0f0;
}

.upload-type-toggle input[type="radio"] {
    margin: 0;
}

.upload-type-toggle input[type="radio"]:checked ~ span,
.upload-type-toggle:has(input[type="radio"]:checked) {
    font-weight: bold;
    color: #007bff;
}

.upload-container.highlight {
    border-color: #0056b3;
    background-color: rgba(0, 86, 179, 0.05);
}

.file-input-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.file-input-container input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-label {
    display: block;
    cursor: pointer;
    padding: 2rem;
}

.drag-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.small-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

button {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #003d82;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Progress bar */
.progress-container {
    margin-top: 1.5rem;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background-color: #4CAF50;
    width: 0;
    transition: width 0.3s ease;
}

#status-message {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Results section */
.results-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.results-section h2 {
    margin-bottom: 1.5rem;
    color: #0056b3;
}

.results-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1.5rem;
}

.tab-button {
    background-color: transparent;
    color: #333;
    border: none;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    background-color: #f5f5f5;
}

.tab-button.active {
    border-bottom: 2px solid #0056b3;
    color: #0056b3;
    font-weight: 600;
}

.tab-content {
    padding: 1rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

#processed-files-list, #error-files-list {
    list-style-type: none;
    padding: 0 1rem;
}

#processed-files-list li, #error-files-list li {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
}

#error-files-list li {
    color: #d9534f;
}

#figures-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 1.5rem;
}

.figure-container {
    text-align: center;
}

.figure-container img {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.figure-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

/* Download section */
.download-section h3 {
    margin: 1.5rem 0 0.8rem;
    color: #0056b3;
    font-size: 1.2rem;
}

.download-section h3:first-child {
    margin-top: 0;
}

.download-list {
    list-style-type: none;
    padding: 0;
}

.download-list li {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-list li:hover {
    background-color: #f5f5f5;
}

.download-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #0056b3;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.download-link:hover {
    background-color: #e6f7ff;
}

.download-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.action-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    margin: 10px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.action-button:hover {
    background-color: #45a049;
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.file-checkbox {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4CAF50;
}

#download-measurement-list li,
#download-unique-list li, 
#download-ml-prediction-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    min-height: 40px;
}

#download-measurement-list .file-checkbox:checked + .download-link,
#download-unique-list .file-checkbox:checked + .download-link,
#download-ml-prediction-list .file-checkbox:checked + .download-link {
    font-weight: bold;
    color: #4CAF50;
}

.select-all-container {
    margin: 10px 0;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.select-all-container input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.select-all-container label {
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}
