/* VS CODE DARK+ THEME */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Consolas', 'Monaco', 'Courier New', monospace;
}

body {
    background-color: #1e1e1e;
    color: #cccccc;
    height: 100vh;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.sidebar {
    width: 22%;
    background-color: #252526;
    border-right: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1rem;
    overflow-y: auto;
    height: 100vh;
}

.sidebar h2 {
    color: #007acc;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid #3c3c3c;
    padding-bottom: 0.6rem;
}

.model-badge {
    background: linear-gradient(135deg, #007acc 0%, #4ec9b0 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,122,204,0.3);
}

.upload-section {
    background-color: #333333;
    border-left: 3px solid #007acc;
    padding: 1.2rem 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.upload-section h3 {
    color: #007acc;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.upload-btn {
    background-color: #3c3c3c;
    color: #cccccc;
    border: 1px dashed #007acc;
    padding: 0.8rem;
    width: 100%;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.upload-btn:hover {
    background-color: #4c4c4c;
    border-color: #4ec9b0;
}

#fileInput {
    display: none;
}

.file-name {
    font-size: 0.8rem;
    color: #9c9c9c;
    margin-top: 0.5rem;
    word-break: break-all;
}

.eval-button {
    background-color: #007acc;
    color: white;
    border: none;
    width: 100%;
    padding: 0.8rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.eval-button:hover {
    background-color: #005a9e;
}

.model-info-card {
    background-color: #333333;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 3px solid #4ec9b0;
}

.model-info-card h4 {
    color: #4ec9b0;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.info-label {
    color: #9c9c9c;
}

.info-value {
    color: #cccccc;
    font-weight: 500;
}

.highlight-value {
    color: #4ec9b0;
    font-weight: 600;
}

.sidebar-footer {
    color: #6e6e6e;
    font-size: 0.7rem;
    text-align: center;
    margin-top: 1rem;
    border-top: 1px solid #3c3c3c;
    padding-top: 0.8rem;
}

.main {
    width: 78%;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    background-color: #1e1e1e;
    height: 100vh;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: #333333;
    border-radius: 6px;
    padding: 1.2rem 1rem;
    border: 1px solid #464646;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.metric-card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 0.5px;
}

.metric-card .value {
    font-size: 2.2rem;
    font-weight: 500;
    color: #007acc;
    line-height: 1.2;
}

.metric-card .unit {
    font-size: 0.9rem;
    color: #aaa;
    margin-left: 4px;
}

/* ===== FIXED CHARTS SECTION - 50-50 SPLIT ===== */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;  /* Exactly 50% each */
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
}

.chart-card {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #3e3e42;
    width: 100%;
    box-sizing: border-box;
}

.chart-card h3 {
    color: #cccccc;
    font-weight: 400;
    font-size: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #007acc;
    padding-left: 0.8rem;
}

.chart-canvas-wrapper {
    position: relative;
    height: 250px;  /* Fixed height for consistency */
    width: 100%;
}

.chart-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 250px;
}

/* ===== SEGMENTATION SECTION ===== */
.segmentation-container {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid #3e3e42;
    margin: 2rem 0;
}

.segmentation-container h3 {
    color: #cccccc;
    font-weight: 400;
    border-left: 4px solid #007acc;
    padding-left: 0.8rem;
    margin-bottom: 1.2rem;
}

.image-showcase {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.image-box {
    flex: 1;
    min-width: 300px;
    background-color: #1e1e1e;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #3e3e42;
}

.image-box h4 {
    color: #9cdcfe;
    font-weight: 400;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.image-preview {
    width: 100%;
    height: 250px;
    background-color: #2a2a2a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img, 
.image-preview canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.placeholder-text {
    color: #666;
    font-size: 0.9rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background-color: #333333;
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #cccccc;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #555;
}

.prediction-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #252526;
    border-radius: 4px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    color: #9c9c9c;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.stat-value {
    color: #4ec9b0;
    font-weight: 500;
    font-size: 1rem;
}

.metrics-detailed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.metric-detailed-card {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #3e3e42;
}

.metric-detailed-card h4 {
    color: #007acc;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 0.5rem;
}

.metric-detailed-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(2px);
}

.loading-box {
    background: #333333;
    padding: 2rem 3rem;
    border-radius: 8px;
    border: 2px solid #007acc;
    color: #007acc;
    font-size: 1.8rem;
    font-weight: 500;
}

.training-badge {
    display: inline-block;
    background-color: #4ec9b0;
    color: #1e1e1e;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.api-indicator {
    display: inline-block;
    background-color: #007acc;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* Responsive fixes */
@media (max-width: 1400px) {
    .legend-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chart-canvas-wrapper {
        height: 200px;
    }
}

@media (max-width: 1200px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-grid {
        grid-template-columns: 1fr;  /* Stack on smaller screens */
    }
}