:root {
    --bg-dark: #0f1117;
    --panel-bg: #181b24;
    --accent-purple: #9333ea;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --border-color: #2e3447;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --piano-white: #f8f9fa;
    --piano-black: #1a1a1a;
    --piano-green: #10b981;
    --piano-blue: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 12px;
}

.container {
    max-width: 1786px;
    margin: 0 auto;
}

.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--accent-purple);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.grid-sys {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.sys-item {
    background: #0f1117;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.sys-item label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.sys-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.sys-controls input[type="file"] {
    display: none;
}

/* Piano Horizontal */
.piano-horizontal-container {
    position: relative;

    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 15px;
    background: #0f1117;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.piano-horizontal-container::-webkit-scrollbar {
    height: 8px;
}

.piano-horizontal-container::-webkit-scrollbar-track {
    background: #1a1d27;
    border-radius: 4px;
}

.piano-horizontal-container::-webkit-scrollbar-thumb {
    background: #3a3f52;
    border-radius: 4px;
}

.piano-horizontal-container::-webkit-scrollbar-thumb:hover {
    background: #4a4f62;
}

.piano-horizontal {
    display: flex;
    position: relative;
    height: 180px;
    min-width: max-content;
    padding: 0 20px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Teclas Brancas */
.piano-white-key {
    width: 45px;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 8px;
    transition: all 0.15s ease;
    color: #333;
}

.piano-white-key:hover {
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
}

.piano-white-key:active {
    background: #d0d0d0;
    transform: scaleY(0.98);
}

.piano-white-key.has-sample {
    background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
}

.piano-white-key.selected {
    background: linear-gradient(180deg, #bfdbfe 0%, #93c5fd 100%);
    box-shadow: 0 0 0 3px var(--accent-blue);
    z-index: 2;
}

/* Teclas Pretas */
.piano-black-key {
    position: relative;
    width: 28px;
    height: 60%;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #000;
    border-radius: 0 0 3px 3px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 5px;
    transition: all 0.15s ease;
    color: #fff;
    margin-left: -14px;
    margin-right: -14px;
}

.piano-black-key:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
}

.piano-black-key:active {
    background: #000;
    transform: scaleY(0.98);
}

.piano-black-key.has-sample {
    background: linear-gradient(180deg, #047857 0%, #065f46 100%);
}

.piano-black-key.selected {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 0 0 3px var(--accent-blue);
    z-index: 4;
}

.piano-white-key .note-number,
.piano-black-key .note-number {
    font-weight: bold;
    font-size: 10px;
    line-height: 1;
}

.piano-white-key .note-name,
.piano-black-key .note-name {
    font-size: 9px;
    opacity: 0.7;
    line-height: 1;
    margin-top: 2px;
}

.piano-white-key .note-indicator,
.piano-black-key .note-indicator {
    position: absolute;
    top: 5px;
    font-size: 10px;
    font-weight: bold;
}

.piano-white-key .note-indicator {
    color: #059669;
}

.piano-black-key .note-indicator {
    color: #34d399;
}

/* Painel de Edição */
.edit-panel {
    background: #0f1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

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

.edit-panel-header h4 {
    color: var(--text-main);
    font-size: 14px;
}

.selected-note-display {
    background: var(--accent-purple);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.edit-panel-content {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.edit-panel-content .input-dark {
    flex: 1;
    min-width: 150px;
}

/* Inputs */
.input-dark {
    padding: 8px;
    background: #0f1117;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    width: 100%;
}

.input-dark:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-header {

    height: 30px;
}

/* Botões */
.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-purple {
    background: var(--accent-purple);
    color: white;
}

.btn-green {
    background: var(--accent-green);
    color: white;
}

.btn-blue {
    background: var(--accent-blue);
    color: white;
}

.btn-red {
    background: var(--accent-red);
    color: white;
}

.btn-icon {
    width: 38px;
    min-width: 38px;
}

.btn-export {
    width: 100%;
    padding: 14px;
    background: var(--accent-green);
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: all 0.3s;
}

.btn-export:hover {
    background: #0d9668;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Loading Indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid #333;
    border-top: 4px solid var(--accent-purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes keyPress {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.95);
    }

    100% {
        transform: scaleY(1);
    }
}

/* Responsividade */
/* @media (max-width: 768px) {
    .piano-horizontal {
        height: 150px;
    }
    
    .piano-white-key {
        width: 35px;
    }
    
    .piano-black-key {
        width: 22px;
    }
    
    .piano-white-key .note-number,
    .piano-black-key .note-number {
        font-size: 8px;
    }
    
    .piano-white-key .note-name,
    .piano-black-key .note-name {
        font-size: 7px;
    }
    
    .edit-panel-content {
        flex-direction: column;
    }
    
    .edit-panel-content .input-dark {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 16px !important;
    }
    
    .piano-horizontal {
        height: 120px;
    }
    
    .piano-white-key {
        width: 30px;
    }
    
    .piano-black-key {
        width: 18px;
        height: 55%;
    }
} */