@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&family=Orbitron:wght@500&family=Roboto+Condensed:wght@300&display=swap');

/* ===== DESIGN SYSTEM - CARD FOUNDATION ===== */
/* Primary cards for main practice elements */
.card-primary {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card-primary:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Secondary cards for controls and settings */
.card-secondary {
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.3s ease;
}

.card-secondary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Card headers */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.card-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ===== MAIN LAYOUT ===== */
.random-music-notes {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Raleway', sans-serif;
}

/* ===== HEADER SECTION ===== */
.app-header {
    margin-bottom: 24px;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.app-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.app-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.quick-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tempo-display, .speed-indicator {
    text-align: center;
}

.tempo-label {
    font-size: 12px;
    color: #666;
    display: block;
}

.tempo-value {
    font-size: 18px;
    font-weight: 600;
    color: #ff6600;
}

.speed-name {
    font-size: 16px;
    color: #666;
    font-style: italic;
}

.primary-controls {
    display: flex;
    justify-content: flex-end;
}

.start-stop-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.start-stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.start-stop-btn:active {
    transform: translateY(0);
}

/* ===== CONTROLS SECTION ===== */
.controls-section {
    margin-bottom: 24px;
}

/* ===== PRACTICE AREA ===== */
.practice-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    margin-bottom: 24px;
}

.note-display-card {
    grid-column: 1 / -1;
}

.instrument-card {
    grid-column: 1 / -1;
}

.next-note-card {
    grid-column: 1 / -1;
}

/* Note Display Redesign */
.note-display-content {
    text-align: center;
}

.random-note {
    font-size: 8rem; /* Reduced from 18rem */
    font-weight: 600;
    color: #1a1a1a;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.difficulty-badge {
    background: #e5e5e5;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-message {
    font-size: 16px;
    color: #666;
    margin-top: 12px;
}

/* Instrument Card */
.instrument-content {
    margin-top: 8px;
}

.view-indicator {
    color: #666;
    font-size: 14px;
}

.current-view {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

/* Next Note Card */
.next-note-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.next-note-label {
    font-size: 14px;
    color: #666;
}

.next-note-preview {
    font-size: 2rem;
    font-weight: 600;
    color: #3192e7;
}

/* ===== METRONOME CARD ===== */
.metronome-card {
    margin-bottom: 24px;
}

.metronome-content {
    display: grid;
    gap: 24px;
}

.tempo-control-group, .measure-control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.tempo-settings {
    display: flex;
    align-items: center;
    gap: 16px;
}

.adjust-tempo-btn {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adjust-tempo-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.tempo-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e5e5e5;
    outline: none;
    cursor: pointer;
}

.tempo-display-detailed {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.current-tempo {
    font-size: 24px;
    font-weight: 600;
    color: #ff6600;
}

.tempo-unit {
    font-size: 12px;
    color: #666;
}

.measure-stepper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stepper {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stepper:hover {
    background: #e9ecef;
}

.measure-count {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 40px;
    text-align: center;
}

.beats-per-measure-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.main-control-section {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.primary-btn {
    background: linear-gradient(135deg, #3192e7, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(49, 146, 231, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(49, 146, 231, 0.4);
}

.metronome-status .status-indicator {
    background: #fef3c7;
    color: #d97706;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== SETTINGS PANEL ===== */
.settings-panel {
    margin-bottom: 24px;
}

.settings-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e5e5;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: #f8f9fa;
    color: #1a1a1a;
    font-weight: 600;
}

.tab-btn:hover:not(.active) {
    background: #f0f0f0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.modern-select {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
}

.modern-select:focus {
    outline: none;
    border-color: #3192e7;
    box-shadow: 0 0 0 2px rgba(49, 146, 231, 0.1);
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.toggle-label {
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
}

.note-selection-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.midi-device-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #e9ecef;
}

.voice-settings {
    margin-left: 32px;
    margin-top: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.experimental-label {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.settings-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    margin-top: 20px;
}

.reset-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: #fecaca;
}

.reset-icon {
    font-size: 16px;
    margin-right: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Mobile Layout */
@media (max-width: 768px) {
    .random-music-notes {
        padding: 16px;
    }

    /* Stack header elements vertically on mobile */
    .header-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
        gap: 16px;
    }

    .app-title h1 {
        font-size: 20px;
    }

    .start-stop-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Single column practice area */
    .practice-area {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Smaller note display on mobile */
    .random-note {
        font-size: 6rem;
        min-height: 80px;
    }

    /* Stack controls vertically */
    .controls-container {
        flex-direction: column;
        gap: 16px;
    }

    /* Stack tempo controls */
    .tempo-settings {
        flex-direction: column;
        gap: 12px;
    }

    .tempo-slider {
        width: 100%;
    }

    /* Mobile-friendly settings tabs */
    .settings-tabs {
        flex-wrap: wrap;
        gap: 2px;
    }

    .tab-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Larger touch targets on mobile */
    .segmented-control-btn,
    .view-tab {
        min-height: 48px;
        font-size: 15px;
        min-width: 105px;
    }
}

/* Tablet Layout */
@media (min-width: 769px) and (max-width: 1024px) {
    .practice-area {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .note-display-card {
        grid-column: 1 / -1;
    }
    
    .instrument-card {
        grid-column: 1 / -1;
    }
    
    .next-note-card {
        grid-column: 1 / 2;
    }
}

/* Desktop Layout */
@media (min-width: 1025px) {
    .practice-area {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .note-display-card {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    
    .instrument-card {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    
    .next-note-card {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
    
    .metronome-card {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
select:focus,
input:focus {
    outline: 2px solid #3192e7;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card-primary,
    .card-secondary {
        border: 2px solid #000;
    }
    
    .difficulty-badge,
    .status-indicator,
    .current-view {
        border: 1px solid #000;
    }
}



.random-music-notes div, 
.random-music-notes span, 
.random-music-notes label {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
.random-music-notes article, 
.random-music-notes aside, 
.random-music-notes details, 
.random-music-notes figcaption, 
.random-music-notes figure, 
.random-music-notes footer, 
.random-music-notes header, 
.random-music-notes hgroup, 
.random-music-notes menu, 
.random-music-notes nav, 
.random-music-notes section {
    display: block;
}


.random-music-notes {
    font-family: 'Raleway', sans-serif !important;
    color: black;
    align-items: center;
    display: flex;
    flex-direction: column;
}

.random-music-notes body {
    background: white;
    color: black;
    margin: 0;
}

.random-music-notes input[type="radio"],
.random-music-notes input[type="checkbox"] {
    margin: 8px 10px;
}

.random-music-notes label {
    font-size: 16px;
}

.random-music-notes .no-highlight {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.random-music-notes .disabled {
    color: #999;
}

.random-music-notes img.attachment-kleo-full-width {
    width: 100%;
    display: none;
}

/* Controls container for both switchers */
.random-music-notes .controls-container {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.random-music-notes .segmented-control-container,
.random-music-notes .view-switcher-container {
    display: flex;
    z-index: 1;
    align-items: center;
    justify-content: center;
    flex: 1; /* Make both containers equal width */
}

/* Unified switcher styling for both Notes/Chords and Keyboard/Staff */
.random-music-notes .segmented-control,
.random-music-notes .view-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    background-color: #fff;
    border-radius: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 4px;
}

.random-music-notes .segmented-control-btn,
.random-music-notes .view-tab {
    padding: 8px 16px;
    background-color: transparent;
    border: none;
    font-size: 17px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 20px;
    position: relative;
    font-family: 'Raleway', sans-serif;
    height: 40px; /* Ensure consistent vertical height */
    min-height: 40px; /* Prevent height variations */
    flex: 1; /* Make each button take equal space within its container */
    min-width: 120px; /* Minimum width for readability */
}

.random-music-notes .segmented-control-btn:first-child,
.random-music-notes .view-tab:first-child {
    border-radius: 20px 0 0 20px;
}

.random-music-notes .segmented-control-btn:last-child,
.random-music-notes .view-tab:last-child {
    border-radius: 0 20px 20px 0;
}

/* Notes/Chords switcher - Blue theme */
.random-music-notes .segmented-control-btn.active {
    background-color: #3192e7;
    color: white;
    box-shadow: 0 2px 4px rgba(49, 146, 231, 0.3);
}

/* Piano/Staff switcher - Purple theme */
.random-music-notes .view-tab.active {
    background-color: #834fd9 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(131, 79, 217, 0.3);
}

/* Notes/Chords switcher hover - Blue theme */
.random-music-notes .segmented-control-btn:hover:not(.active) {
    background-color: rgba(49, 146, 231, 0.1);
    color: #3192e7;
}

/* Piano/Staff switcher hover - Purple theme */
.random-music-notes .view-tab:hover:not(.active) {
    background-color: rgba(131, 79, 217, 0.1);
    color: #834fd9;
}


/* Legacy styles removed - now using unified styling above */


.random-music-notes .top-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    margin-top: 32px;
    padding: 20px 10px;
}

.random-music-notes .speed-box,
.random-music-notes .random-note,
.random-music-notes #next-note-container {
    width: 100%;
}

.random-music-notes .speed-name {
    font-size: 3.25rem;
    color: #ff6600;
}

.random-music-notes #tempo {
    font-size: 3rem;
    padding: 8px 5px;
}

.random-music-notes .random-note {
    display: flex;
    height: 200px;
    font-size: 18rem;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    margin-top: 0px;
    margin-bottom: 20px;
}

.random-music-notes .advanced-font {
    font-size: 10rem;
}

.random-music-notes .single-note {
    font-size: 15rem;
}

.random-music-notes #next-note-container {
    display: flex;
    font-size: 4.5rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 40px;
    margin-top: 40px;
    white-space: nowrap;
    height: 80px;
}

.random-music-notes #next-note-word {
    display: inline;
    color: #4586c9;
}

.random-music-notes #next-note {
    display: inline;
    font-weight: 600;
    margin-left: 10px;
}

.random-music-notes #metronome {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.random-music-notes .tempo-settings {
    display: flex;
    margin-top: 0px;
    flex-direction: row;
}

.random-music-notes .tempo-settings .slider-container {
    width: 300px;
}

.random-music-notes .tempo-settings .slider {
    width: 100%;
}

.random-music-notes .tempo-settings .adjust-tempo-btn {
    font-size: 57px;
    min-width: 56px;
    min-height: 56px;
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
    border-radius: 50%;
    border: 1px solid #ccc;
    text-align: center;
    cursor: pointer;
    margin: 10px;
}

.random-music-notes .tempo-settings .decrease-tempo {
    line-height: 50px !important;
}

.random-music-notes .tempo-settings .increase-tempo {
    line-height: 55px !important;
}

.random-music-notes .start-stop {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
    font-size: 1.45rem;
    text-align: center;
    background: #ff6600;
    border-radius: 50%;
    border: none;
    color: #fff;
    line-height: 70px !important;
    margin: 0px 10px;
    cursor: pointer;
    font-weight: bold;
}

.random-music-notes .start-stop:hover {
    background-color: orangered;
}

.random-music-notes .measures {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px 15px;
}

.random-music-notes .measure-count {
    font-size: 29px;
}

.random-music-notes .measure-stepper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.random-music-notes .measures .stepper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    font-size: 45px;
    border-radius: 50%;
    border: 1px solid #ccc;
    text-align: center;
    cursor: pointer;
    margin: 12px;
}

.random-music-notes .measures .stepper:hover {
    background-color: #3192e7;
    color: white;
}

.random-music-notes .measures .add-beats {
    line-height: 42px !important;
}

.random-music-notes .measures .subtract-beats {
    line-height: 35px !important;
}

.random-music-notes .beats-per-measure-text {
    text-align: center;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.random-music-notes .adjust-tempo-btn:hover {
    background-color: #3192e7;
    color: white;
}

.random-music-notes .fade-out {
    animation: fadeOut 1s;
    opacity: 0;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.random-music-notes #midiDeviceSelector {
    width: clamp(220px, 280px, 40vw);
}

.random-music-notes .disabled {
    opacity: .5;
    pointer-events: none;
    cursor: not-allowed;
}

.random-music-notes #difficulty {
    font-size: 18px;
    width: 200px;
    color: #333;
}

.random-music-notes .difficulty-settings {
    display: none;
    margin-bottom: 12px;
}

.random-music-notes .random-note {
    will-change: transform;
    transform: translateZ(0);
}

.random-music-notes .piano {
    --white-key-height: '';
    --white-key-width: calc(var(--white-key-height)/5);
    height: var(--white-key-height);
    min-height:var(--white-key-height);
    transform: perspective(700px) rotateX(25deg);
    display: flex;
    margin: auto;
    overflow: hidden;
    border-top: 2px solid black;
    border-left: 2px solid black;
    border-right: 2px solid black;
    border-bottom: 3px solid black;
    width: fit-content;
}

.random-music-notes .one-octave {
    display: flex;
    justify-content: center;
    --white-key-height: 240px !important;
    --white-key-width: calc(var(--white-key-height)/5);
    height: var(--white-key-height)
}

.random-music-notes .key-set {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.random-music-notes .white-keys,
.random-music-notes .black-keys {
    display: flex;
}

.random-music-notes .white-keys {
    display: flex;
    height: 100%;
}

.random-music-notes .black-keys {
    position: absolute;
    top: 0;
    height: 60%;
    z-index: 1;
}

.random-music-notes .black-key-group {
    height: 60%;
}

.random-music-notes .black-key-group .black-key {
    left: 0;
}

.random-music-notes .black-key-group .black-key + .black-key {
    left: 25px;
}

.random-music-notes .black-key-group .black-key + .black-key + .black-key {
    left: 50px;
}

.random-music-notes .white-key,
.random-music-notes .black-key {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    border-top: none;
}

.random-music-notes .white-key {
    background-color: white;
    flex: 1;
    width: var(--white-key-width);
    border-bottom: 1px solid black;
    box-shadow: inset 1px 1px 6px 0px rgb(150,150,150,0.45), inset -1px -1px 6px 0px rgb(150,150,150,0.45), 1px 0px rgb(50,50,50,.5), -1px 0px rgb(50,50,50,.5);
}

.random-music-notes .black-key {
    background-color: black;
    border: 1px solid black;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius: 2px;
    position: absolute;
    height: 100%;
    width: calc(var(--white-key-width)*.55);
    margin-left: calc(var(--white-key-width)*.5);
}

.random-music-notes .black-key-group {
    position: absolute;
    top: 0;
    left: calc(var(--white-key-width) * .23);
    z-index: 1;
}

.random-music-notes .active-display {
    background-color: lightskyblue;
}

.random-music-notes .active-midi {
    background-color: #ff5050;
    box-shadow: inset 1px 1px 6px 0px rgba(0, 0, 0, 0.25), inset -1px -1px 6px 0px rgba(0, 0, 0, 0.25), 1px 0px black, -1px 0px black;
}

.random-music-notes .correct-midi {
    background-color: #7dff7d;
}

.random-music-notes .black-key-label {
    padding-bottom: 5px;
    font-size: 15px;
    word-wrap: break-word;
    text-align: center;
    color: white;
    font-weight: bold;
}

.random-music-notes .white-key-label {
    padding-bottom: 8px;
    font-size: 19px;
    text-align: center;
    color: #444;
    font-weight: bold;
}

.random-music-notes .black-key.active-display > .black-key-label,
.random-music-notes .black-key.active-midi > .black-key-label,
.random-music-notes .black-key.correct-midi > .black-key-label {
    color: black;
}

.random-music-notes .correct-effect {
    color: black;
    transform: scale(1.2);
    transition: text-shadow .08s ease-in-out;
    transition: transform .05s ease-in-out;
}

.random-music-notes #status-message {
    display: block;
    text-align: center;
    font-size: 24px;
    color: red;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease-in-out, visibility 2s ease-in-out;
}

.random-music-notes #status-message.show {
    opacity: 1;
    visibility: visible;
}

.random-music-notes .settings {
    display: flex;
    flex-direction: column;
}

.random-music-notes .collapsible {
    cursor: pointer;
    width: clamp(200px, 380px, 85vw);
    padding: 12px;
    background-color: #ffffff;
    border-radius: 5px;
    border: none;
    text-align: left;
    outline: none;
    font-size: 17px;
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    font-family: Raleway, sans-serif;
}

.random-music-notes .active,
.random-music-notes .collapsible:hover {
    background-color: #f2f2f2;
}

.random-music-notes .settings-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.random-music-notes .settings-content.show {
    max-height: 1000px !important;
    transition: max-height 0.5s ease-in;
}

.random-music-notes .arrow {
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.3s;
    color: #ff6600;
}

.random-music-notes .active .arrow {
    transform: rotate(90deg);
}

.random-music-notes .toggle-switch label {
    display: flex;
    align-items: center;
    color: #555;
}

.random-music-notes .toggle-switch input[type="checkbox"] {
    margin-right: 20px;
}

.random-music-notes .difficulty-settings,
.random-music-notes .note-range-slider label,
.random-music-notes .chord-range-slider label,
.random-music-notes .note-selection label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.random-music-notes .difficulty-settings select {
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.random-music-notes .voice-announcement-settings {
    margin-left: 15px;
}

.random-music-notes .midi-settings label {
    color: #555;
}

.random-music-notes .midi-settings select {
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.random-music-notes .midi-advance span {
    font-size: 14px;
    color: #888;
}

.random-music-notes .main-btn-console {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    margin: 10px;
    margin-bottom: 50px;
}

.random-music-notes .piano-checkboxes {
    display: flex;
    margin: 10px 24px;
}

.random-music-notes .piano-checkboxes input[type="checkbox"] {
    margin: 4px 0px !important;
}

.random-music-notes .piano-checkboxes .white-key,
.random-music-notes .piano-checkboxes .black-key {
    position: relative;
}

.random-music-notes .piano-checkboxes .white-key {
    width: 30px;
    height: 100px;
    background-color: #fff;
    border: 1px solid #000;
}

.random-music-notes .piano-checkboxes .black-key {
    width: 25px;
    height: 60px;
    background-color: #000;
    margin-left: -16px;
    margin-right: -16px;
    z-index: 1;
}

.random-music-notes .piano-checkboxes input[type="checkbox"] {
    position: absolute;
}

.random-music-notes .piano-checkboxes label {
    position: absolute;
    bottom: 17px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #000;
    font-weight: bold;
    line-height: 1.2 !important;
}

.random-music-notes .piano-checkboxes .black-key label {
    color: #fff;
}



/* Staff View */


.random-music-notes .view-carousel {
    position: relative;
    min-width: 320px;
    width: 100%;
    max-width: 1024px;
    margin: 30px auto 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .random-music-notes .carousel-container {
    overflow: visible;
    background-color: transparent;
    width: 100%;
    min-height: 100px; /* Reduced from 300px */
    min-width: 420px;
    display: flex;
    align-items: flex-start; /* Changed from center to flex-start */
    justify-content: center;
  }
  
  .random-music-notes .carousel-slide {
    display: none;
    width: 100%;
    transition: transform 0.3s ease-in-out;
  }
  
  .random-music-notes .carousel-slide.active {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .random-music-notes .carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}
  
  .random-music-notes .keyboard-view, 
  .random-music-notes .staff-view {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: none !important;
  }
  
  .random-music-notes .vexbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transform: scale(2.4);
    margin: 60px 0px 90px 0px;
  }
  
  /* Adjust staff view size */
  .random-music-notes .carousel-slide .vexbox {
    width: 100%;
    z-index: -1px;
  }
  
  .random-music-notes .carousel-arrow {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    background-color:lightskyblue;
    font-weight: bold;
    color: black;
    border: none;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0px;
  }

  .random-music-notes .carousel-arrow:hover {
    background-color: #008cff;
    color: white;
  }
  
  .random-music-notes .left-arrow {
    left: -80px;
  }
  
  .random-music-notes .right-arrow {
    right: -80px;
  }
  
  .random-music-notes .carousel-slide {
    display: none;
  }
  
  .random-music-notes .carousel-slide.active {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  

.random-music-notes .note-range-slider,
.random-music-notes .chord-range-slider {
    margin-left: 32px !important;
    width: 80% !important;
}

.random-music-notes .note-selection {
    margin-top: 20px;
    padding-top: 20px;
}

/* .random-music-notes #note-range label,
.random-music-notes #chord-range label,
.random-music-notes {
    padding: 20px !important;
    margin: 50px !important;
} */

.random-music-notes #note-range,
.random-music-notes #chord-range {
    height: 10px !important;
    background: #ddd !important;
    border-radius: 5px !important;
}

.random-music-notes .noUi-connect {
    background: #3498db !important;
}

.random-music-notes .noUi-handle {
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid lightgray !important;
    box-shadow: 0px 1px 1px lightgray !important;
}

.random-music-notes .noUi-handle:before,
.random-music-notes .noUi-handle:after {
    display: none !important;
}

.random-music-notes .range-labels {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    font-weight: bold;
    color: #555;
}

.random-music-notes .noUi-horizontal .noUi-handle {
    width: 24px !important;
    height: 24px !important;
    right: -17px !important;
    top: -7px !important;
}

.random-music-notes .tempo-tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    bottom: 100%;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.random-music-notes .tempo-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.random-music-notes .reset-settings-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
} 

.random-music-notes .reset-settings-btn {
    cursor: pointer;
    padding: 12px;
    background-color: #fff;
    border-radius: 5px;
    border: none;
    text-align: left;
    outline: none;
    font-size: 12px;
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: Raleway, sans-serif;
}

.random-music-notes .reset-settings-btn:hover {
    background-color: #f2f2f2;
}

/* View switcher tabs styling */
.random-music-notes .view-switcher {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 15px;
    background-color: #fff;
    border-radius: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    padding: 4px;
}

.random-music-notes .view-tab {
    padding: 8px 16px;
    background-color: transparent;
    border: none;
    font-size: 17px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 20px;
    position: relative;
    font-family: 'Raleway', sans-serif;
}

.random-music-notes .view-tab:first-child {
    border-radius: 20px 0 0 20px;
}

.random-music-notes .view-tab:last-child {
    border-radius: 0 20px 20px 0;
}

.random-music-notes .view-tab.active {
    background-color: #3192e7;
    color: white;
    box-shadow: 0 2px 4px rgba(49, 146, 231, 0.3);
}

.random-music-notes .view-tab:hover:not(.active) {
    background-color: rgba(49, 146, 231, 0.1);
    color: #3192e7;
}

.random-music-notes .view-tab svg {
    width: 16px;
    height: 16px;
}

.random-music-notes .view-carousel {
    text-align: center;
}



/* TABLET STYLES */
@media only screen and (max-width: 900px) {
    .random-music-notes .piano {
        --white-key-height: 20vw !important;
    }
    .random-music-notes .advanced-font {
        font-size: 12rem;
    }
    .random-music-notes .one-octave {
        --white-key-height: 200px !important;
    }

    .random-music-notes .view-carousel {
        max-width: 764px;
      }

      .random-music-notes .left-arrow {
        left: -50px;
      }
      
      .random-music-notes .right-arrow {
        right: -50px;
      }
    
}


/* MOBILE STYLES */
@media only screen and (max-width: 650px) {
    .random-music-notes {
        margin-top: 40px;
        padding: 0px;
    }

    .random-music-notes .random-note {
        font-size: 12rem;
        height: 120px;
        margin-top: 50px;
    }

    .random-music-notes .advanced-font {
        font-size: 8rem;
    }

    .random-music-notes .single-note {
        font-size: 10rem;
    }

    .random-music-notes #next-note-container {
        margin-bottom: 30px;
        margin-top: 30px;
    }

    .random-music-notes #tempo {
        font-size: 2.7rem;
    }

    .random-music-notes .tempo-settings {
        margin-top: 0px;
    }

    .random-music-notes .tempo-settings .slider-container {
        width: 200px;
    }
    
    .random-music-notes .tempo-settings .slider {
        width: 100%;
    }

    .random-music-notes #next-note-container {
        font-size: 3.6rem;
        height: 45px;
    }

    .random-music-notes .speed-name {
        font-size: 2.6rem;
    }

    .random-music-notes .speed-bpm {
        font-size: .9rem;
        padding-left: 2vw;
    }

    .random-music-notes .speed-box {
        padding: 0px;
    }

    .random-music-notes .piano {
        --white-key-height: 19.5vw !important;
        --white-key-width: calc(var(--white-key-height)/5);
        border: 1px solid black;
    }

    .random-music-notes .one-octave {
        transform: perspective(500px) rotateX(25deg);
        --white-key-height: 190px !important;
        --white-key-width: calc(var(--white-key-height)/5);
        height: var(--white-key-height);
    }

    .random-music-notes .white-key {
        border: 1px solid #aaa;
    }

    .random-music-notes .black-key-label {
        display: none;
    }
    
    .random-music-notes .white-key-label {
        padding-bottom: 6px;
        font-size: 14px;
        text-align: center;
        color: black;
        font-weight: bold;
    }

    .random-music-notes .active-display {
        border: 1px solid black;
        box-shadow: none;
    }
    
    .random-music-notes .active-midi {
        border: 1px solid black;
        box-shadow: none;
    }
    
    .random-music-notes .correct-midi {
        border: 1px solid black;
        box-shadow: none;
    }

    .random-music-notes .segmented-control-btn,
    .random-music-notes .view-tab {
        padding: 6px 12px;
        font-size: 15px;
        min-width: 80px;
    }

    .random-music-notes .left-arrow {
        left: -20px;
     
      }
      
      .random-music-notes .right-arrow {
        right: -20px;
    
      }

      .random-music-notes .carousel-container {
 
        min-width: 320px;

      }
      
      .random-music-notes .vexbox {
 
        transform: scale(1.9);
        margin-top: 10px;
      }

}
/* FOR VIDEO - COMMENT OUT WHEN NOT USING */

/* If night-mode is on the body: */
body.night-mode .random-music-notes {
    color: white;
  }
  
  body.night-mode .random-music-notes .speed-name {
    color: #ff6600;
  }
  
  body.night-mode .random-music-notes #next-note-word {
    color: #76d1ff;
  }
  
  body.night-mode .random-music-notes .random-note {
    color: white;
  }


  body.night-mode .random-music-notes .black-key:not(.active-display) {
    background-color: black;
  }
  
  body.night-mode .random-music-notes #tempo {
    font-size: 2.2rem;
    padding: 0;
    padding-top: 6px;
    color: white;
  }
  
  body.night-mode .random-music-notes #next-note {
    color: white;
    padding-left: 10px;
  }
  
  /* Alternatively, if night-mode-alt is on the body: */
  body.night-mode-alt .random-music-notes,
  body.night-mode-alt .random-music-notes * {
    background: black;
    color: white;
  }
  
  body.night-mode-alt .random-music-notes .speed-name {
    color: lightgreen;
  }
  
  body.night-mode-alt .random-music-notes #next-note-word {
    color: #76d1ff;
  }
  
  body.night-mode-alt .random-music-notes #random-note {
    color: deeppink;
  }
  



  /* If video-mode is on the body: */
  body.video-mode .random-music-notes .active-display {
    background-color: #ff5050;
    box-shadow: inset 1px 1px 6px 0px rgba(0, 0, 0, 0.25),
                inset -1px -1px 6px 0px rgba(0, 0, 0, 0.25),
                1px 0px black,
                -1px 0px black;
  }
  


  /* These are already scoped to body.video-mode, so it’s OK: */
  body.video-mode {
    max-width: 100vw !important;
    border: none !important;
    padding: 0px 5vw;
    margin: 0px;
  }


  
  /* Move .video-mode in front of .random-music-notes so the styles apply when body has .video-mode */

body.video-mode .top-container {
    margin-bottom: 0px;
    padding-bottom: 0px;
}

  body.video-mode .random-music-notes .speed-box {
    padding-left: 0px;
    width: 95%;
  }
  
  body.video-mode .random-music-notes .speed-name {
    font-size: 5rem;
  }
  
  body.video-mode .random-music-notes .random-note {
    margin-bottom: 0px;
    font-size: 24rem;
    height: 260px;
  }
  
  body.video-mode .random-music-notes #next-note-container {
    font-size: 6rem;
    margin-top: 84px;
  }
  
  body.video-mode .random-music-notes #tempo {
    font-size: 3rem;
    padding-top: 6px;
  }
  
  
  
  body.video-mode .random-music-notes .one-octave {
    margin-top: -10px;
    display: flex;
    justify-content: center;
    transform: perspective(900px) rotateX(20deg);
    --white-key-height: 300px !important;
    --white-key-width: calc(var(--white-key-height)/4.5);
    height: var(--white-key-height);
  }

  body.video-mode .random-music-notes .white-key-label {
    font-size: 20px;
    padding-bottom: 14px;
  }

  body.video-mode .random-music-notes .black-key-label {
    font-size: 16px;
    color: #eee;
    padding-bottom: 12px;
  }
  


/* videoNightMode */
body.video-mode.night-mode{
    max-width: 100vw !important;
    border: none !important;
    padding: 0px 5vw;
    margin: 0px;
    background: #090909;
}

body.video-mode.night-mode .random-music-notes .one-octave {
    border: 5px solid black;
}

/* Tempo slider container and tooltip */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
