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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #004B87 0%, #0066B3 100%);
    min-height: 100vh;
    padding: 20px 30px;
    color: #333;
}

.container {
    max-width: 95%;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #004B87 0%, #0066B3 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px 50px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.drop-zone {
    border: 3px dashed #0066B3;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: #f0f7fc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: #C9A961;
    background: #e6f2f9;
    transform: translateY(-2px);
}

.drop-zone.drag-over {
    border-color: #C9A961;
    background: #e6f2f9;
    border-style: solid;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: #0066B3;
}

.drop-text {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 10px;
}

.drop-text-or {
    font-size: 1rem;
    color: #999;
    margin: 15px 0;
}

.browse-btn {
    background: linear-gradient(135deg, #004B87 0%, #0066B3 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 75, 135, 0.3);
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 179, 0.4);
}

.browse-btn:active {
    transform: translateY(0);
}

.file-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #777;
}

.file-name {
    display: none;
    margin-top: 15px;
    padding: 12px 20px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    color: #2e7d32;
    font-weight: 500;
}

/* Error Display */
.error-display {
    padding: 16px 20px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    color: #c62828;
    margin-bottom: 20px;
    font-weight: 500;
}

.error-display.hidden {
    display: none;
}

/* Success Display */
.success-display {
    padding: 16px 20px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    color: #2e7d32;
    margin-bottom: 20px;
    font-weight: 500;
}

.success-display.hidden {
    display: none;
}

/* Side Panel Empty State */
.no-files {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 20px;
    font-style: italic;
}

/* Plot Area with Side Panel */
.plot-area {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-top: 30px;
}

.plot-area.hidden {
    display: none;
}

/* Side Panel */
.side-panel {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 800px;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #004B87 0%, #0066B3 100%);
    color: white;
}

.side-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.add-files-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-files-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clear-all-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* File Card */
.file-card {
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.file-card:last-child {
    margin-bottom: 0;
}

.file-card-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    border-bottom: 1px solid #e9ecef;
}

.file-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-color-indicator:hover {
    transform: scale(1.2);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.file-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0066B3;
}

.file-card-name {
    flex: 1;
    font-size: 0.7rem;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.file-remove-btn:hover {
    color: #dc3545;
}

/* Metadata Toggle */
.metadata-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s ease;
}

.metadata-toggle:hover {
    background: #e9ecef;
}

.metadata-toggle-icon {
    transition: transform 0.2s ease;
}

.metadata-toggle.expanded .metadata-toggle-icon {
    transform: rotate(180deg);
}

/* File Metadata */
.file-metadata {
    display: none;
    padding: 10px 12px;
    background: #fafbfc;
    border-top: 1px solid #e9ecef;
}

.file-metadata.expanded {
    display: block;
}

.file-metadata-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.file-metadata-table td {
    padding: 4px 0;
    vertical-align: top;
}

.file-metadata-table td:first-child {
    font-weight: 600;
    color: #666;
    width: 45%;
    padding-right: 8px;
}

.file-metadata-table td:last-child {
    color: #333;
}

.no-metadata {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

.plot-section {
    flex: 1;
}

.plot-section.hidden {
    display: none;
}

#plotContainer {
    width: 100%;
    min-height: 780px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .plot-area {
        grid-template-columns: 1fr;
    }

    .side-panel {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    .logo {
        max-width: 200px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

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

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .drop-text {
        font-size: 1rem;
    }

    .side-panel {
        max-height: 250px;
    }

    #plotContainer {
        min-height: 520px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .browse-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}
