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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: aliceblue;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.header {
    text-align: center;
    padding-bottom: 15px;
}

h1 {
    color: #333;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

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

.stats {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.stat {
    background: white;
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-label {
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.plot-wrapper {
    flex: 1;
    min-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 10px;
    overflow: hidden;
    position: relative;
}

.legend-controls {
    position: absolute;
    top: 45px;
    right: 15px;
    z-index: 100;
    display: flex;
    gap: 4px;
}

.legend-btn {
    padding: 3px 8px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid #999;
    border-radius: 3px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e0e0e0 100%);
    color: #333;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.8);
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.1s ease;
}

.legend-btn:hover {
    background: linear-gradient(to bottom, #fff 0%, #e8e8e8 100%);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.legend-btn:active {
    background: linear-gradient(to bottom, #d0d0d0 0%, #e0e0e0 100%);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.2);
    transform: translateY(1px);
}

#pca-plot {
    width: 100% !important;
    height: 100% !important;
}

.js-plotly-plot, .plotly {
    width: 100% !important;
    height: 100% !important;
}

.footer {
    text-align: center;
    padding-top: 15px;
    color: #888;
    font-size: 0.8rem;
}

.instructions {
    margin-top: 10px;
    padding: 10px 16px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #555;
    text-align: center;
}

.instructions strong {
    color: #1976d2;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    h1 {
        font-size: 1.3rem;
    }
    .stats {
        gap: 10px;
    }
    .stat {
        padding: 8px 12px;
    }
    .stat-value {
        font-size: 1.1rem;
    }
}
