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

body {
    font-family: "Courier New", monospace;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

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

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

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-box {
    background: white;
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: #333;
    background: #f0f0f0;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-box p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 5px;
}

.upload-box small {
    color: #888;
}

.file-info,
.controls,
.results-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
}

.file-info h3,
.results-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item label {
    font-weight: 600;
    color: #555;
}

.info-item span {
    color: #333;
    font-family: "Courier New", monospace;
}

.controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section label {
    font-weight: 600;
    color: #555;
}

.filter-section select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-section select:focus {
    outline: none;
    border-color: #667eea;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-buttons button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.export-buttons button:hover {
    background: #5a6fd8;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

#midiTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

#midiTable th {
    background: #333;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

#midiTable td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

#midiTable tbody tr:nth-child(even) {
    background: #f9f9f9;
}

#midiTable tbody tr:hover {
    background: #eaeaea;
}

.hex-bytes {
    font-family: "Courier New", monospace;
    background: #f0f0f0;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    letter-spacing: 1px;
}

.message-type {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}

.message-type.meta {
    background: #e3f2fd;
    color: #1976d2;
}
.message-type.note-on {
    background: #e8f5e8;
    color: #2e7d32;
}
.message-type.note-off {
    background: #ffebee;
    color: #d32f2f;
}
.message-type.control {
    background: #fff3e0;
    color: #f57c00;
}
.message-type.program {
    background: #f3e5f5;
    color: #7b1fa2;
}
.message-type.pitch {
    background: #e0f2f1;
    color: #00796b;
}
.message-type.aftertouch {
    background: #fce4ec;
    color: #c2185b;
}
.message-type.sysex {
    background: #e8eaf6;
    color: #3f51b5;
}

.channel-info {
    font-family: "Courier New", monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.time-info {
    font-family: "Courier New", monospace;
    font-size: 11px;
}

.description {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

.error-message {
    background: #ffebee;
    border: 2px solid #f44336;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.error-content h3 {
    color: #d32f2f;
    margin-bottom: 10px;
}

.error-content p {
    color: #666;
}

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

    header h1 {
        font-size: 2rem;
    }

    .upload-box {
        padding: 40px 15px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .export-buttons {
        justify-content: center;
    }

    #midiTable {
        font-size: 11px;
    }

    #midiTable th,
    #midiTable td {
        padding: 8px 4px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.processing {
    text-align: center;
    padding: 40px;
    color: #666;
}

.processing .loading {
    margin-right: 10px;
}
