/* Traffic Light Styles */
.traffic-light {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #e9ecef;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.traffic-light.active {
    background-color: #f39c12;
    border-color: #e67e22;
    box-shadow: 0 0 12px rgba(243, 156, 18, 0.8);
    transform: scale(1.1);
}

.light-label {
    color: #7f8c8d;
    font-weight: bold;
    font-size: 1.1rem;
}

.traffic-light.active .light-label {
    color: #fff;
}

/* Section Card Styles */
.section-card {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Tempo Badge Compact */
.tempo-badge-compact {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    padding: 0.15rem 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
}

/* Note Display Compact */
.note-display-compact {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.note-name-compact {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.note-info-compact {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.15rem;
}

/* Pattern & Button Styles */
.pattern-section {
    margin-top: 0.5rem;
}

.pattern-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #495057;
    /* Darker for contrast */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.scale-grid {
    grid-template-columns: repeat(3, 1fr);
}

.synth-btn {
    width: 100%;
    padding: 0.4rem 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-width: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.synth-btn.span-full {
    grid-column: 1 / -1;
}

/* Note Count Badge */
.note-count-badge {
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.75;
    margin-left: 1px;
    vertical-align: super;
}

/* Pattern Type Color Coding */
/* Chords (simultaneous) - Blue */
.synth-btn[data-pattern-type="chord"]:not(.active) {
    border-color: #007bff;
    color: #007bff;
}

.synth-btn[data-pattern-type="chord"]:not(.active):hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Arpeggios (sequential) - Purple */
.synth-btn[data-pattern-type="arp"]:not(.active) {
    border-color: #9333ea;
    color: #9333ea;
}

.synth-btn[data-pattern-type="arp"]:not(.active):hover {
    background-color: rgba(147, 51, 234, 0.1);
}

/* Sequences - Indigo */
.synth-btn[data-pattern-type="sequence"]:not(.active) {
    border-color: #6366f1;
    color: #6366f1;
}

.synth-btn[data-pattern-type="sequence"]:not(.active):hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Scales - Teal/Cyan */
.synth-btn[data-pattern-type="scale"]:not(.active) {
    border-color: #17a2b8;
    color: #17a2b8;
}

.synth-btn[data-pattern-type="scale"]:not(.active):hover {
    background-color: rgba(23, 162, 184, 0.1);
}

/* Single note - Primary Blue */
.synth-btn[data-pattern-type="single"]:not(.active) {
    border-color: #007bff;
    color: #007bff;
}

/* Unified Active State */
.synth-btn.active,
.sub-btn.active,
.waveform-btn.active {
    background-color: #4f46e5 !important;
    /* Indigo */
    border-color: #4f46e5 !important;
    color: white !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

.synth-btn:hover:not(.active),
.sub-btn:hover:not(.active),
.waveform-btn:hover:not(.active) {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Andalusian Special Style */
.andalusian-btn {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.andalusian-btn:not(.active) {
    border-color: #ffc107;
    color: #d97706;
}

.andalusian-btn.active {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    /* Amber/Gold */
    border-color: #d97706 !important;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4) !important;
}

/* Waveform Display */
.waveform-display-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#waveformCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Waveform Buttons */
.waveform-btn {
    padding: 0.4rem 0.2rem;
    transition: all 0.2s ease;
}

.waveform-btn i {
    font-size: 1.2rem;
    display: block;
}

.waveform-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.waveform-btn:hover:not(.active) {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

/* Slider Wrapper with Notches */
.slider-wrapper {
    position: relative;
    margin-bottom: 0.25rem;
}

.form-range {
    cursor: pointer;
    height: 32px;
    padding: 0;
    position: relative;
    z-index: 2;
    background: transparent;
}

/* Slider Notches */
.slider-notches {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 1;
    padding: 0 14px;
}

.slider-notches::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    height: 100%;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent calc((100% / (var(--notches) - 1)) - 2px),
            #6c757d calc((100% / (var(--notches) - 1)) - 2px),
            #6c757d calc(100% / (var(--notches) - 1)));
}

.slider-notches[data-notches="8"]::before {
    --notches: 8;
}

.slider-notches[data-notches="11"]::before {
    --notches: 11;
}

/* Webkit/Chrome slider thumb */
.form-range::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    background-color: #007bff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.form-range::-webkit-slider-thumb:hover {
    background-color: #0056b3;
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.form-range::-webkit-slider-thumb:active {
    transform: scale(1.25);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.5);
}

/* Firefox slider thumb */
.form-range::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background-color: #007bff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.form-range::-moz-range-thumb:hover {
    background-color: #0056b3;
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.form-range::-moz-range-thumb:active {
    transform: scale(1.25);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.5);
}

/* Track styling for better clickability */
.form-range::-webkit-slider-runnable-track {
    height: 8px;
    background: #dee2e6;
    border-radius: 4px;
}

.form-range::-moz-range-track {
    height: 8px;
    background: #dee2e6;
    border-radius: 4px;
}

/* Button Styles */
.btn {
    min-width: 100px;
    transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
}

/* Beat Indicator Container */
.beat-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem;
    border-radius: 8px;
    color: white;
}

/* Circle Visualizer */
.circle-viz-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
}

#circleCanvas {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}