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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 10px;
    min-height: 100vh;
    --dot-bg: black;
    --dot-color: #666666;
    --dot-size: 0.5px;
    --dot-space: 10px;
    background:
        linear-gradient(90deg, var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
        linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
        var(--dot-color);
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: auto;
    min-height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

header {
    background: #417bb4;
    color: white;
    padding: 5px 15px;
    flex-shrink: 0;
}

h1 {
    font-size: 16px;
    font-weight: 600;
}

.controls {
    padding: 10px 20px 0px 20px;
    background: #ecf0f1;
    border-bottom: 1px solid #bdc3c7;
    flex-shrink: 0;
}

.control-row {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: #34495e;
    padding-left: 5px;
}

select,
input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

input[type="number"] {
    min-width: 50px;
    width: 120px;
}

button {
    padding: 8px 16px;
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover {
    background: #3498db;
}

button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

button.success {
    background: #229954;
}

button.success:hover {
    background: #39b26c;
}

button.warning {
    background: #e67e22;
}

button.warning:hover {
    background: #d35400;
}

.image-grid-container {
    padding: 0px 5px 5px 5px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-height: 100%;
}

.image-cell {
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 100%;
    padding: 2px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    background: #f8f9fa;
}

.image-cell .filename {
    font-size: 10px;
    font-weight: bold;
    color: #696969;
    padding: 2px 4px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-cell .image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.image-cell img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
}

.image-cell .placeholder {
    color: #95a5a6;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.status {
    padding: 9px 20px;
    background: #d5f4e6;
    border-left: 4px solid #27ae60;
    margin: 10px;
    border-radius: 0px;
    font-size: 14px;
    display: none;
    align-self: stretch;
    text-align: center;
    z-index: 10;
}

.status.error {
    background: #fadbd8;
    border-left-color: #e74c3c;
}

.info-box {
    display: flex !important;
    justify-content: space-between;
    background: #c7e5ee;
    padding: 5px;
    margin: 5px;
    border-radius: 4px;
    font-size: 13px;
    color: #2c3e50;
}

.pagination-controls {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
}

.pagination-controls button {
    padding: 6px 10px;
    font-size: 13px;
    height: 30px;
}

.pagination-controls span {
    font-weight: 500;
    color: #34495e;
}

.du-slider-panel {
    padding: 10px 10px 0px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    border-top: 0.5px solid #bdc3c7;
    width: 100%;
}

.aug-slider-panel {
    padding: 10px 10px 0px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    border-top: 0.5px solid #bdc3c7;
    width: 100%;
}

.aug-slider-container {
    display: flex;
    flex-direction: column;
    margin: 0px 30px 0px 0px;
}

.aug-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
}

.aug-checkbox-container input[type="checkbox"] {
    min-width: auto;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.aug-checkbox-container label {
    cursor: pointer;
    padding-left: 0;
    margin: 0;
}

.image-cell.augmented {
    border: 1px solid #ff9933 !important;
}

.image-cell .status-label {
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9px;
    font-weight: bold;
    padding: 2px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.image-cell.augmented .status-label {
    background: #ffbc79;
    color: #212121;
    align-items: center;
}
.du-slider-label {
    font-size: 13px;
    font-weight: 500;
    color: #34495e;
    margin: 0px 0px 8px -5px;
}

.du-slider {
    width: 160px;
    height: 5px;
}

/* noUiSlider customization - use !important to override library defaults */
.noUi-target {
    background: #e0e0e0;
    border-radius: 3px;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.noUi-connect {
    background: #2980b9 !important;
}

.noUi-handle {
    width: 14px !important;
    height: 14px !important;
    border-radius: 2px !important;
    background: #fff !important;
    border: 2px solid #2980b9 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none !important;
}

.noUi-horizontal .noUi-handle {
    width: 14px !important;
    height: 14px !important;
    right: -7px !important;
    top: -5px !important;
    border: 0.5px solid #999999 !important;
}

.noUi-horizontal {
    height: 7px !important;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #666;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
}

.image-modal-close:hover {
    color: #e74c3c;
}

.image-modal-body {
    display: flex;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.image-modal-left {
    flex: 2;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-modal-left img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.image-modal-right {
    flex: 1;
    background: #f8f9fa;
    padding: 30px;
    overflow-y: auto;
    border-left: 1px solid #dee2e6;
}

.image-modal-right h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    word-break: break-word;
}

.metric-group {
    margin-bottom: 20px;
}

.metric-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.metric-label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.metric-value {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}
