* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    padding-bottom: 100px;
    background: #1e1e1e;
    color: #d4d4d4;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #2d2d2d;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

h1 {
    margin-top: 0;
    color: #e6e6e6;
    font-weight: 400;
    font-size: 1.6rem;
    border-bottom: 1px solid #3d3d3d;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

/* Wybór pliku */
.file-select-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.file-select-wrapper label {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

.file-select-wrapper select {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    min-width: 320px;
    background: #3d3d3d;
    color: #e6e6e6;
    cursor: pointer;
    transition: border-color 0.15s;
}

.file-select-wrapper select:hover {
    border-color: #5a5a5a;
}

.file-select-wrapper select:focus {
    outline: none;
    border-color: #6a6a6a;
}

.file-select-wrapper button {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    background: #3d3d3d;
    color: #e6e6e6;
    cursor: pointer;
    transition: background 0.15s;
}

.file-select-wrapper button:hover {
    background: #4a4a4a;
}

/* Kontener nut */
#osmd-container {
    border: 1px solid #3d3d3d;
    padding: 15px;
    min-height: 450px;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

/* Przyklejony pasek sterowania */
#control-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2d2d2d;
    color: #d4d4d4;
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.4);
    z-index: 1000;
    border-top: 1px solid #3d3d3d;
}

.control-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.transport-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

#control-bar button {
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    background: #3d3d3d;
    color: #e6e6e6;
    transition: background 0.15s;
    font-weight: 400;
}

#control-bar button:hover:not(:disabled) {
    background: #4a4a4a;
}

#control-bar button:disabled {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #555;
    cursor: not-allowed;
}

#control-bar button#playBtn:not(:disabled) {
    background: #4a7c4e;
    border-color: #5a8c5e;
}

#control-bar button#playBtn:hover:not(:disabled) {
    background: #5a8c5e;
}

#control-bar button#stopBtn:not(:disabled) {
    background: #8c4a4a;
    border-color: #9c5a5a;
}

#control-bar button#stopBtn:hover:not(:disabled) {
    background: #9c5a5a;
}

#control-bar button#pauseBtn:not(:disabled) {
    background: #8c7a4a;
    border-color: #9c8a5a;
}

#control-bar button#pauseBtn:hover:not(:disabled) {
    background: #9c8a5a;
}

/* Partia w pasku */
#parts-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.part-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #3d3d3d;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    font-size: 11px;
    transition: opacity 0.15s;
}

.part-chip.muted {
    opacity: 0.35;
}

.part-chip.solo {
    background: #d4a017;
    border-color: #e6b020;
    color: #1e1e1e;
}

.part-chip .part-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #b0b0b0;
}

.part-chip button {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 9px;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background: #4a4a4a;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

.part-chip button:hover {
    background: #5a5a5a;
    color: #ccc;
}

.part-chip button.mute-btn.active {
    background: #8c4a4a;
    color: #e6e6e6;
}

.part-chip button.solo-btn.active {
    background: #d4a017;
    color: #1e1e1e;
}

/* Kontrola tempa */
.tempo-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-left: 1px solid #3d3d3d;
    margin-left: auto;
}

.tempo-control label {
    font-size: 11px;
    color: #888;
}

.tempo-control input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    font-size: 12px;
    background: #3d3d3d;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #e6e6e6;
    text-align: center;
}

.tempo-control input[type="number"]:focus {
    outline: none;
    border-color: #6a6a6a;
}

.tempo-control input[type="number"]::-webkit-inner-spin-button,
.tempo-control input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Kontrola pętli */
.loop-control {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-left: 1px solid #3d3d3d;
}

.loop-control button {
    padding: 6px 10px;
    font-size: 14px;
    background: #3d3d3d;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
}

.loop-control button.active {
    background: #d4a017;
    border-color: #e6b020;
    color: #1e1e1e;
}

.loop-control button:hover:not(.active) {
    background: #4a4a4a;
}

.loop-control button.active:hover {
    background: #e6b020;
}

.loop-control input[type="number"] {
    width: 50px;
    padding: 4px 6px;
    font-size: 11px;
    background: #3d3d3d;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #e6e6e6;
    text-align: center;
}

.loop-control span {
    color: #666;
    font-size: 11px;
}

.loop-control .loop-label {
    color: #888;
    font-size: 11px;
    margin-right: 2px;
}

#status-text {
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
    padding-left: 10px;
    border-left: 1px solid #3d3d3d;
}

/* Pasek ładowania */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 30, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    width: 300px;
}

.loading-text {
    color: #e6e6e6;
    font-size: 14px;
    margin-bottom: 15px;
}

.loading-bar {
    height: 6px;
    background: #3d3d3d;
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: #4a7c4e;
    border-radius: 3px;
    transition: width 0.2s;
}

.loading-percent {
    color: #888;
    font-size: 12px;
    margin-top: 8px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
}

::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}
