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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

header p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* Upload Zone */
.upload-zone {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.upload-zone:hover {
    border-color: #2196F3;
    background: #f8f9fa;
}

.upload-zone.dragover {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.upload-prompt svg {
    color: #2196F3;
    margin-bottom: 20px;
}

.upload-prompt p {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-prompt small {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Upload Status */
.upload-status {
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#status-text {
    color: #2196F3;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #4CAF50);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #2196F3;
    font-size: 1rem;
    font-weight: 600;
}

/* ETTR Result */
.ettr-result {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border-left: 6px solid #2196F3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ettr-status h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.ettr-status p {
    color: #555;
    line-height: 1.8;
}

/* Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.thumbnail-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.thumbnail-box img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.histogram-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#histogram-canvas {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#histogram-stats {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .histogram-wrapper {
        flex-direction: column;
    }

    #histogram-stats {
        width: 100%;
    }

    .stats-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .channel-stats {
        flex: 1;
        min-width: 150px;
    }
}

/* Print/Export */
@media print {
    .upload-zone {
        display: none;
    }

    #histogram-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
