
/* ==========================================
   MUSIC PRACTICE STUDIO V3
   ========================================== */

:root {
    --background: #e9eef4;
    --surface: #ffffff;
    --dark: #172334;
    --dark-light: #26354a;
    --sidebar: #14263a;
    --sidebar-card: #1c3047;
    --accent: #0fbaa6;
    --accent-hover: #0b9889;
    --text: #243247;
    --muted: #64748b;
    --border: #dce3eb;
    --radius: 12px;

    --header-height: 78px;
    --player-height: 90px;
    --sidebar-width: 320px;
    --sidebar-collapsed-width: 48px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.45;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

input[type="checkbox"],
input[type="range"] {
    accent-color: var(--accent);
}

/* ==========================================
   APPLICATION
   ========================================== */

.studio-app {
    min-height: 100vh;
}

/* ==========================================
   HEADER
   ========================================== */

.app-header {
    min-height: var(--header-height);
    padding: 14px 24px;

    background: var(--dark);
    color: white;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border-bottom: 1px solid #31445b;
}

.app-brand h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.app-brand p {
    margin: 3px 0 0;
    font-size: 13px;
    color: #afc0d2;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions button {
    width: 40px;
    height: 40px;

    border: 1px solid #43556b;
    border-radius: 9px;

    background: var(--dark-light);
    color: white;

    font-size: 22px;
}

.header-actions button:hover {
    background: #344b65;
}

/* ==========================================
   WORKSPACE
   ========================================== */

.studio-workspace {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        var(--sidebar-width);

    align-items: stretch;
    min-height: calc(100vh - var(--header-height));

    padding-bottom: var(--player-height);
    transition: grid-template-columns 0.25s ease;
}

/* ==========================================
   SHEET MUSIC
   ========================================== */

.score-workspace {
    min-width: 0;
    padding: 12px;
}

.score-panel {
    min-height: 600px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 3px 12px rgba(20, 35, 55, 0.06);
    padding: 18px;
}

.score-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    padding-bottom: 12px;
    margin-bottom: 16px;

    border-bottom: 1px solid var(--border);
}

.score-heading h2 {
    margin: 0;
    font-size: 17px;
}

#scoreInstrument {
    color: var(--muted);
    font-size: 13px;
}

#score {
    width: 100%;
    min-height: 480px;
    overflow-x: auto;
    background: white;
}

/* alphaTab cursor */

.at-cursor-bar {
    background: rgba(15, 186, 166, 0.12);
}

.at-cursor-beat {
    background: var(--accent);
    width: 3px;
}

.at-highlight * {
    fill: #e65c48;
    stroke: #e65c48;
}

/* ==========================================
   RIGHT SIDEBAR
   ========================================== */

.studio-sidebar {
    min-width: 0;
    background: var(--sidebar);
    color: #eaf1f8;

    padding: 14px;
    border-left: 1px solid #30455b;

    display: flex;
    flex-direction: column;
    gap: 12px;

    overflow: hidden;
}

.sidebar-section {
    background: var(--sidebar-card);
    border: 1px solid #324960;
    border-radius: 11px;
    padding: 15px;
    min-width: 0;
}

.sidebar-section h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.sidebar-section p {
    margin: 8px 0;
}

.song-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.song-artist {
    color: #b9c8d8;
    font-size: 13px;
}

.status-message {
    font-size: 12px;
    color: #7cdbcf;
    overflow-wrap: anywhere;
}

/* FILE IMPORT */

#musicFile {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 14px;
    border: 1px solid #506783;
    border-radius: 8px;

    background: #29425e;
    color: white;

    cursor: pointer;
    font-size: 13px;
}

.file-button:hover {
    background: #365474;
}

/* INSTRUMENT SELECT */

#instrument {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;

    background: #223a54;
    color: white;

    border: 1px solid #526b87;
    border-radius: 8px;
}

/* MIXER */

.mixer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mixer[hidden] {
    display: none;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.setting-row input[type="checkbox"] {
    width: 19px;
    height: 19px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.slider-row input[type="range"] {
    flex: 1;
    width: 40px;
    min-width: 0;
}

.slider-row span:last-child {
    min-width: 38px;
    text-align: right;
}

/* LOOP SETTINGS */

.loop-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loop-inputs label {
    font-size: 13px;
}

.loop-inputs input {
    width: 70px;
    min-width: 0;
    padding: 8px 6px;

    background: #223a54;
    color: white;

    border: 1px solid #526b87;
    border-radius: 8px;

    text-align: center;
}

.setting-hint {
    font-size: 12px;
    color: #b9c8d8;
}

/* INFORMATION */

.information-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    margin: 10px 0;
    font-size: 13px;
}

.information-row strong {
    font-weight: 600;
    text-align: right;
}

/* ==========================================
   COLLAPSED SIDEBAR
   ========================================== */

.studio-app.sidebar-collapsed .studio-workspace {
    grid-template-columns:
        minmax(0, 1fr)
        var(--sidebar-collapsed-width);
}

.studio-app.sidebar-collapsed .studio-sidebar {
    padding: 8px 5px;
    align-items: center;
}

.studio-app.sidebar-collapsed .sidebar-section {
    display: none;
}

/* ==========================================
   FIXED BOTTOM PLAYER
   ========================================== */

.bottom-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;

    background: var(--dark);
    color: white;

    border-top: 1px solid #41546c;
    box-shadow: 0 -5px 24px rgba(10, 20, 35, 0.25);
}

.bottom-player-inner {
    min-height: var(--player-height);

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 16px;
    padding: 14px 24px;
}

/* TRANSPORT */

.player-transport {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-transport button {
    width: 46px;
    height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #263a52;
    color: white;

    border: 1px solid #455a73;
    border-radius: 50%;

    font-size: 20px;
}

.player-transport button.primary {
    width: 58px;
    height: 58px;

    background: var(--accent);
    border-color: var(--accent);

    font-size: 26px;
}

.player-transport button:hover:not(:disabled) {
    background: #36516f;
}

.player-transport button.primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

/* TEMPO */

.player-tempo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-label {
    font-size: 13px;
    color: #c7d5e3;
}

.bpm-control {
    display: flex;
    align-items: center;
    overflow: hidden;

    background: #253950;
    border: 1px solid #49617c;
    border-radius: 10px;
}

.bpm-control button {
    width: 40px;
    height: 44px;

    background: transparent;
    color: white;

    border: 0;
    font-size: 22px;
}

.bpm-control button:hover:not(:disabled) {
    background: #36516d;
}

.bpm-control label {
    display: flex;
    align-items: center;
    gap: 5px;

    padding: 0 10px;
    border-left: 1px solid #49617c;
    border-right: 1px solid #49617c;
}

#bpmInput {
    width: 60px;
    padding: 8px 0;

    background: transparent;
    border: 0;
    outline: none;

    color: white;
    font-size: 21px;
    font-weight: 700;
    text-align: center;

    appearance: textfield;
    -moz-appearance: textfield;
}

#bpmInput::-webkit-inner-spin-button,
#bpmInput::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bpm-control label span {
    font-size: 11px;
    color: #b8c9d9;
}

.tempo-reference {
    font-size: 12px;
    color: #b7c8d8;
    white-space: nowrap;
}

/* LOOP AND METRONOME */

.player-loop,
.player-metronome {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.toolbar-toggle input {
    width: 18px;
    height: 18px;
}

#loopSummary {
    color: #73e0d3;
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================
   FULLSCREEN MODE
   ========================================== */

.studio-app.practice-fullscreen .app-header {
    display: none;
}

.studio-app.practice-fullscreen .studio-workspace {
    min-height: 100vh;
}

.studio-app.practice-fullscreen .score-workspace {
    padding: 0;
}

.studio-app.practice-fullscreen .score-panel {
    border-radius: 0;
    min-height: 100vh;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1150px) {
    :root {
        --sidebar-width: 280px;
        --player-height: 120px;
    }

    .bottom-player-inner {
        justify-content: center;
        gap: 12px 24px;
    }
}

@media (max-width: 750px) {
    :root {
        --sidebar-width: 260px;
        --player-height: 170px;
    }

    .app-header {
        padding: 12px 16px;
    }

    .app-brand h1 {
        font-size: 19px;
    }

    .studio-workspace {
        display: block;
    }

    .studio-sidebar {
        border-left: 0;
        border-top: 1px solid #30455b;
    }

    .studio-app.sidebar-collapsed .studio-sidebar {
        display: none;
    }

    .score-workspace {
        padding: 8px;
    }

    .score-panel {
        padding: 10px;
    }

    .bottom-player-inner {
        padding: 10px;
        gap: 10px 18px;
    }

    .player-transport button {
        width: 40px;
        height: 40px;
    }

    .player-transport button.primary {
        width: 48px;
        height: 48px;
    }

    .tempo-reference {
        display: none;
    }
}


/* ==========================================
   MUSIC PRACTICE STUDIO V3
   STEP 11 — PLAYER IMPROVEMENTS
   ========================================== */

/* PLAY / PAUSE + STOP */

.player-transport {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#playPause {
    width: 54px;
    height: 54px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--accent);
    color: white;

    border: 1px solid var(--accent);
    border-radius: 50%;

    font-size: 23px;
    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

#playPause:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

#playPause:active:not(:disabled) {
    transform: scale(0.96);
}

#stop {
    width: 42px;
    height: 42px;
    font-size: 17px;
}

/* MEASURE NAVIGATION */

.player-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.player-navigation label {
    color: #c7d5e3;
    font-size: 13px;
    white-space: nowrap;
}

#goToMeasure {
    width: 65px;
    height: 42px;
    padding: 6px 8px;

    background: #253950;
    color: white;

    border: 1px solid #49617c;
    border-radius: 8px;

    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

#goToMeasure:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

#goToMeasure::-webkit-inner-spin-button,
#goToMeasure::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#goToMeasure {
    appearance: textfield;
    -moz-appearance: textfield;
}

#goToMeasureBtn {
    height: 42px;
    padding: 0 14px;

    background: #29425e;
    color: white;

    border: 1px solid #49617c;
    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;

    transition: background 0.15s ease;
}

#goToMeasureBtn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
}

/* KEEP THE BOTTOM PLAYER COMPACT */

.bottom-player-inner {
    justify-content: center;
    column-gap: 24px;
    row-gap: 10px;
}

/* RESPONSIVE PLAYER */

@media (max-width: 1200px) {
    .bottom-player-inner {
        column-gap: 16px;
    }

    .player-tempo {
        gap: 8px;
    }

    .tempo-reference {
        display: none;
    }
}

@media (max-width: 850px) {
    .bottom-player-inner {
        justify-content: center;
        padding: 10px 12px;
        gap: 10px 16px;
    }

    .player-navigation label {
        font-size: 12px;
    }

    #goToMeasure {
        width: 58px;
    }

    #goToMeasureBtn {
        padding: 0 10px;
    }

    #playPause {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 500px) {
    .player-navigation {
        gap: 5px;
    }

    .player-navigation label {
        display: none;
    }

    #goToMeasure {
        width: 55px;
        height: 38px;
    }

    #goToMeasureBtn {
        height: 38px;
    }
}

/* FILE OPENING INFORMATION */

.file-help {
    margin: 12px 0 6px;
    color: #dce7f2;
    font-size: 13px;
    line-height: 1.5;
}

.file-formats {
    margin: 0 0 10px;
    color: #a9bed1;
    font-size: 12px;
    line-height: 1.6;
}

.file-formats strong {
    color: #5ee0c0;
    font-weight: 600;
}

.file-privacy {
    margin: 0;
    color: #a9bed1;
    font-size: 11px;
    line-height: 1.5;
}



/* ==========================================
   APPLICATION CREDITS
   ========================================== */

.studio-credits {
    margin-top: auto;
    padding: 18px 12px;
    text-align: center;
    color: #a9bed1;
    font-size: 12px;
}

.studio-credits p {
    margin: 5px 0;
}

.studio-credits .credits-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.studio-credits .credits-tagline {
    color: #8fa8bf;
    font-size: 11px;
}

.credits-divider {
    height: 1px;
    background: #34485f;
    margin: 14px 0;
}

.studio-credits a {
    color: #5ee0c0;
    font-weight: 600;
    text-decoration: none;
}

.studio-credits a:hover {
    text-decoration: underline;
}

.studio-credits strong {
    color: #ffffff;
}

/* Hide credits when sidebar is collapsed */
.studio-app.sidebar-collapsed .studio-credits {
    display: none;
}
