/* ==================== MIDI KEYBOARD CRASH COURSE STYLES ==================== */

/* Course Section */
.course-section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--dark-border);
}

.course-section:last-child {
    border-bottom: none;
}

.section-header {
    margin-bottom: 3rem;
}

.section-number {
    display: inline-block;
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 0.75rem;
}

.section-description {
    font-size: 1.0625rem;
    color: var(--muted);
    max-width: 36rem;
    line-height: 1.6;
}

/* Lesson Styles */
.lesson {
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lesson:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.lesson-header {
    margin-bottom: 2rem;
}

.lesson-number {
    display: inline-block;
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.lesson-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
}

.lesson-objective {
    color: var(--muted);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Prose Content */
.prose-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--muted);
}

.prose-content p {
    margin-bottom: 1.25rem;
}

.prose-content h4 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--light);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose-content strong {
    color: var(--light);
    font-weight: 600;
}

.prose-content ul,
.prose-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose-content li {
    margin-bottom: 0.5rem;
}

.prose-content ul li {
    list-style-type: disc;
}

.prose-content ol li {
    list-style-type: decimal;
}

/* Interactive Container */
.interactive-container {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.interactive-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.interactive-title::before {
    content: '\26A1';
}

/* Quick Win Box */
.quick-win {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.quick-win-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-win-title::before {
    content: '\1F3AF';
}

.quick-win p {
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.quick-win p:last-child {
    margin-bottom: 0;
}

.quick-win ol {
    padding-left: 1.25rem;
    margin: 1rem 0;
}

.quick-win li {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* Troubleshooting */
.troubleshoot {
    margin: 1.5rem 0;
}

.troubleshoot-toggle {
    width: 100%;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--light);
    font-size: 0.9375rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.troubleshoot-toggle:hover {
    border-color: var(--accent);
}

.troubleshoot-content {
    display: none;
    padding: 1.5rem;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.troubleshoot-content.open {
    display: block;
}

.troubleshoot-content h4 {
    color: var(--light);
    margin-top: 0;
    margin-bottom: 1rem;
}

.troubleshoot-content p {
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.troubleshoot-content p strong {
    color: var(--light);
}

/* Piano Keyboard */
.keyboard {
    display: flex;
    position: relative;
    height: 120px;
    user-select: none;
    justify-content: center;
}

.key {
    position: relative;
    cursor: pointer;
    transition: all 0.1s;
}

.key-white {
    width: 40px;
    height: 120px;
    background: linear-gradient(to bottom, #f5f5f5 0%, #e0e0e0 100%);
    border: 1px solid #999;
    border-radius: 0 0 4px 4px;
    z-index: 1;
}

.key-white:hover {
    background: linear-gradient(to bottom, #fff 0%, #f0f0f0 100%);
}

.key-white.active {
    background: var(--accent);
}

.key-black {
    width: 24px;
    height: 75px;
    background: linear-gradient(to bottom, #333 0%, #000 100%);
    border-radius: 0 0 3px 3px;
    position: absolute;
    z-index: 2;
    margin-left: -12px;
}

.key-black:hover {
    background: linear-gradient(to bottom, #444 0%, #111 100%);
}

.key-black.active {
    background: #7c5fc4;
}

.key-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
    pointer-events: none;
}

/* Wheel Controls */
.wheel-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 1rem 0;
}

.wheel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.wheel-track {
    width: 40px;
    height: 150px;
    background: #222;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
}

.wheel-thumb {
    width: 36px;
    height: 30px;
    background: linear-gradient(to bottom, #666 0%, #444 50%, #666 100%);
    border-radius: 4px;
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.wheel-thumb:active {
    cursor: grabbing;
}

.wheel-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.wheel-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

/* Signal Flow */
.signal-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem;
}

.signal-node {
    background: var(--dark-surface);
    border: 2px solid var(--dark-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    min-width: 100px;
    transition: all 0.3s;
}

.signal-node.active {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

.signal-node-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.signal-node-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.signal-arrow {
    color: var(--dark-border);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.signal-arrow.active {
    color: var(--accent);
}

/* Info Display */
.info-display {
    background: rgba(0,0,0,0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: monospace;
    margin: 1rem 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: var(--muted);
}

.info-value {
    color: var(--accent);
    font-weight: 600;
}

/* Velocity Meter */
.velocity-meter {
    width: 100%;
    height: 20px;
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.velocity-fill {
    height: 100%;
    background: linear-gradient(to right, #22c55e, #eab308, #ef4444);
    border-radius: 10px;
    transition: width 0.1s;
    width: 0%;
}

/* Buttons */
.btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #000;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Chord Display */
.chord-display {
    text-align: center;
    padding: 1rem;
}

.chord-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.chord-notes {
    font-size: 1.1rem;
    color: var(--muted);
}

/* Chord Selector */
.chord-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
}

.chord-btn {
    padding: 0.5rem 1rem;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 0.375rem;
    color: var(--light);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.chord-btn:hover {
    border-color: var(--accent);
}

.chord-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Root Selector */
.root-selector {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
}

.root-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 0.25rem;
    color: var(--light);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.root-btn:hover {
    border-color: var(--accent);
}

.root-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Piano Roll */
.piano-roll {
    background: #111;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.piano-roll canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Slider */
.slider-container {
    margin: 1rem 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 4px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Progress Tracker */
.progress-tracker {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.progress-step {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    transition: background 0.3s;
}

.progress-step.complete {
    background: #22c55e;
}

.progress-step.current {
    background: var(--accent);
}

/* Comparison Buttons */
.comparison-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

/* Feedback Messages */
.feedback {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: none;
}

.feedback.show {
    display: block;
}

.feedback.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.feedback.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.feedback.info {
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* Course Completion */
.course-complete {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 1rem;
    padding: 2.5rem;
    text-align: center;
    margin-top: 3rem;
}

.course-complete h3 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

.course-complete p {
    color: var(--muted);
    font-size: 1.0625rem;
    max-width: 32rem;
    margin: 0 auto 1rem;
}

/* Lesson Navigation */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--dark-border);
}

/* Responsive */
@media (max-width: 640px) {
    .keyboard {
        transform: scale(0.8);
        transform-origin: center;
    }

    .signal-flow {
        flex-direction: column;
    }

    .signal-arrow {
        transform: rotate(90deg);
    }

    .wheel-container {
        gap: 1rem;
    }

    .comparison-container {
        flex-direction: column;
    }
}
