/**
 * Harmonic Wheel Stylesheet
 * Dark Instagram-style aesthetic with glowing elements
 */

/* ===== CSS Custom Properties (Variables) ===== */
:root {
    /* Colors - Dark Mode */
    --bg-primary: #0a0a0a;
    --bg-secondary: rgba(20, 20, 20, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;

    /* Chord Colors */
    --color-major: #FF1744;      /* Pink/Red */
    --color-minor: #00E5FF;      /* Cyan */
    --color-dominant: #FFD700;   /* Gold */
    --color-diminished: #E040FB; /* Violet */

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 16px;
    --font-size-large: 24px;
    --font-size-small: 14px;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    /* Shadows & Effects */
    --glow-major: 0 0 20px rgba(255, 23, 68, 0.5);
    --glow-minor: 0 0 20px rgba(0, 229, 255, 0.5);
    --glow-dominant: 0 0 20px rgba(255, 215, 0, 0.5);
    --glow-diminished: 0 0 20px rgba(224, 64, 251, 0.5);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;

    /* Vignette effect */
    background: radial-gradient(
        ellipse at center,
        var(--bg-primary) 0%,
        #000000 100%
    );
}

/* ===== Layout ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: var(--spacing-md) 0 var(--spacing-lg);
}

header h1 {
    font-family: 'Poppins', var(--font-primary);
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--color-major), var(--color-minor), var(--color-dominant));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 400;
}

/* ===== Main Content ===== */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== Info Panel (Instructions & Legend) ===== */
.info-panel {
    max-width: 900px;
    margin: 0 auto var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions {
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.instructions strong {
    color: var(--text-primary);
}

.legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-small);
    color: var(--text-secondary);
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.color-major {
    background-color: var(--color-major);
    color: var(--color-major);
}

.color-minor {
    background-color: var(--color-minor);
    color: var(--color-minor);
}

.color-dominant {
    background-color: var(--color-dominant);
    color: var(--color-dominant);
}

.color-diminished {
    background-color: var(--color-diminished);
    color: var(--color-diminished);
}

/* ===== SVG Wheel Container ===== */
#wheel-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md);
    position: relative;
}

/* Subtle background glow */
#wheel-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

#harmonic-wheel {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

/* ===== Chord Nodes ===== */
.chord-node {
    cursor: pointer;
    transition: filter 0.2s ease, stroke 0.2s ease;
}

.chord-node-group {
    cursor: pointer;
    transition: filter 0.2s ease;
    transform-box: fill-box;
    transform-origin: center center;
}

/* Hover effect - subtle brightness increase only, no scaling to prevent jitter */
.chord-node-group.node-hover .chord-node,
.chord-node-group:hover .chord-node {
    filter: brightness(1.3);
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 3;
}

.chord-node-group.node-hover .chord-label,
.chord-node-group:hover .chord-label {
    font-weight: 600;
    filter: brightness(1.2);
}

/* Glow effects for each chord type */
.chord-major {
    filter: drop-shadow(var(--glow-major))
            drop-shadow(0 0 10px rgba(255, 23, 68, 0.3));
}

.chord-major:hover {
    filter: drop-shadow(0 0 25px rgba(255, 23, 68, 0.8))
            drop-shadow(0 0 15px rgba(255, 23, 68, 0.6))
            brightness(1.3);
}

.chord-minor {
    filter: drop-shadow(var(--glow-minor))
            drop-shadow(0 0 10px rgba(0, 229, 255, 0.3));
}

.chord-minor:hover {
    filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.8))
            drop-shadow(0 0 15px rgba(0, 229, 255, 0.6))
            brightness(1.3);
}

.chord-dominant {
    filter: drop-shadow(var(--glow-dominant))
            drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.chord-dominant:hover {
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8))
            drop-shadow(0 0 15px rgba(255, 215, 0, 0.6))
            brightness(1.3);
}

.chord-diminished {
    filter: drop-shadow(var(--glow-diminished))
            drop-shadow(0 0 10px rgba(224, 64, 251, 0.3));
}

.chord-diminished:hover {
    filter: drop-shadow(0 0 25px rgba(224, 64, 251, 0.8))
            drop-shadow(0 0 15px rgba(224, 64, 251, 0.6))
            brightness(1.3);
}

/* Node interaction states (Phase 3) */
.node-selected circle {
    animation: nodePulse 1.5s ease-in-out infinite;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 4;
}

.node-selected {
    transform: none !important; /* Prevent any scaling */
}

.node-valid-next circle {
    opacity: 1;
    animation: nodeGlow 2s ease-in-out infinite;
}

.node-dimmed {
    opacity: 0.3;
}

/* Pulse animation for selected nodes */
.pulse-animation {
    animation: selectionPulse 1s ease-out;
}

/* Subtle pulse for valid next nodes */
.pulse-subtle {
    animation: subtlePulse 2s ease-in-out infinite;
}

/* Arrow flow animation */
.arrow-flow-animation {
    animation: arrowFlowDash 1s ease-out forwards;
}

/* Node animations */
@keyframes nodePulse {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 15px currentColor);
    }
    50% {
        filter: brightness(1.5) drop-shadow(0 0 30px currentColor);
    }
}

@keyframes nodeGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5) drop-shadow(0 0 20px currentColor);
    }
}

@keyframes selectionPulse {
    0% {
        filter: brightness(1) drop-shadow(0 0 10px currentColor);
    }
    50% {
        filter: brightness(1.8) drop-shadow(0 0 35px currentColor);
    }
    100% {
        filter: brightness(1) drop-shadow(0 0 10px currentColor);
    }
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes arrowFlowDash {
    0% {
        stroke-dashoffset: var(--path-length, 100);
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ===== Chord Labels ===== */
.chord-label {
    font-family: var(--font-primary);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8),
                 0 0 15px rgba(0, 0, 0, 0.5);
    user-select: none;
}

/* ===== Arrow Styles (Phase 2) ===== */
.arrow {
    transition: opacity 0.3s ease,
                stroke-width 0.3s ease,
                filter 0.3s ease;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    pointer-events: none; /* Don't block interactions */
}

/* Base arrow glow effects */
.arrow-strong {
    filter: drop-shadow(0 0 4px currentColor);
}

.arrow-medium {
    filter: drop-shadow(0 0 3px currentColor);
}

.arrow-weak {
    filter: drop-shadow(0 0 2px currentColor);
}

/* Arrow hover state */
.arrow:hover {
    opacity: 1 !important;
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 8px currentColor) brightness(1.3);
}

/* Arrow highlight states */
.arrow-highlighted {
    opacity: 0.8 !important;
    animation: arrowPulse 2s ease-in-out infinite;
    pointer-events: auto !important;
}

.arrow-dimmed {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Arrow preview on hover - subtle */
.arrow-preview {
    opacity: 0.4 !important;
    pointer-events: auto !important;
    transition: opacity 0.2s ease;
}

/* Show arrows connected to selected/hovered chord */
.arrow-visible {
    opacity: 0.6 !important;
    pointer-events: auto !important;
}

/* Arrow flow animation */
@keyframes arrowFlow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -20;
    }
}

/* Arrow pulse animation */
@keyframes arrowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 8px currentColor) brightness(1.2);
    }
}

/* ===== Control Panel (Phase 4) ===== */
.control-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.control-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.control-panel-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toggle-panel-btn {
    display: none; /* Hidden on desktop, shown on mobile */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.toggle-panel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.control-panel-content {
    padding: var(--spacing-md);
}

.control-section {
    margin-bottom: var(--spacing-lg);
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Checkbox Styles */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: var(--font-size-small);
    transition: color 0.2s ease;
    user-select: none;
}

.filter-checkbox:hover {
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

/* Radio Button Styles */
.filter-radio {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: var(--font-size-small);
    transition: color 0.2s ease;
    user-select: none;
}

.filter-radio:hover {
    color: var(--text-primary);
}

.filter-radio input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-radio input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--text-primary);
}

.filter-radio input[type="radio"]:checked + .radio-custom {
    border-color: var(--text-primary);
}

/* Toggle Switch Styles */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: var(--color-dominant);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-small);
    color: var(--text-secondary);
}

.dark-label {
    color: var(--text-primary);
}

.light-label {
    color: var(--text-secondary);
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-label .dark-label {
    color: var(--text-secondary);
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-label .light-label {
    color: var(--text-primary);
}

/* Slider Styles */
.slider-control {
    margin-top: var(--spacing-sm);
}

.slider-control label {
    display: block;
    font-size: var(--font-size-small);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.slider-control .slider-value {
    float: right;
    color: var(--text-primary);
    font-weight: 500;
}

.slider {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

/* Reset Button */
.reset-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-small);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.reset-btn:active {
    transform: scale(0.98);
}

/* Light Mode Theme Overrides */
body.light-mode {
    --bg-primary: #f5f5f5;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a1a;
    --text-secondary: #555555;

    /* Adjusted chord colors for light background */
    --color-major: #D50000;
    --color-minor: #00B8D4;
    --color-dominant: #F57F17;
    --color-diminished: #AA00FF;

    /* Adjusted glow effects */
    --glow-major: 0 0 15px rgba(213, 0, 0, 0.4);
    --glow-minor: 0 0 15px rgba(0, 184, 212, 0.4);
    --glow-dominant: 0 0 15px rgba(245, 127, 23, 0.4);
    --glow-diminished: 0 0 15px rgba(170, 0, 255, 0.4);

    background: radial-gradient(
        ellipse at center,
        var(--bg-primary) 0%,
        #e0e0e0 100%
    );
}

body.light-mode .control-panel,
body.light-mode .info-panel,
body.light-mode #progression-timeline {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.light-mode .slider {
    background: rgba(0, 0, 0, 0.1);
}

body.light-mode .toggle-slider {
    background: rgba(0, 0, 0, 0.2);
}

body.light-mode .radio-custom {
    border-color: rgba(0, 0, 0, 0.4);
}

/* ===== Progression Timeline (Phase 3) ===== */
#progression-timeline {
    max-width: 900px;
    margin: var(--spacing-lg) auto 0;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progression-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.progression-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.progression-counter {
    font-size: var(--font-size-small);
    color: var(--text-secondary);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

.progression-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    min-height: 60px;
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
}

.progression-list:empty::before {
    content: 'Click chords to build a progression...';
    color: var(--text-secondary);
    font-size: var(--font-size-small);
    opacity: 0.6;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.progression-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: var(--font-size-small);
    font-weight: 500;
    border: 2px solid;
    transition: all 0.2s ease;
    cursor: default;
    white-space: nowrap;
}

.progression-item.chord-major {
    background: rgba(255, 23, 68, 0.2);
    border-color: var(--color-major);
    color: var(--color-major);
}

.progression-item.chord-minor {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--color-minor);
    color: var(--color-minor);
}

.progression-item.chord-dominant {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--color-dominant);
    color: var(--color-dominant);
}

.progression-item.chord-diminished {
    background: rgba(224, 64, 251, 0.2);
    border-color: var(--color-diminished);
    color: var(--color-diminished);
}

.chord-badge {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.remove-chord-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: inherit;
    font-size: 1.2rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.remove-chord-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.progression-controls {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-small);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

.control-btn span {
    font-size: 1.1em;
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: var(--font-size-small);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: var(--spacing-md) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-small);
}

/* ===== Error Messages ===== */
.error-message {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
    padding: var(--spacing-md);
    border-radius: 8px;
    margin: var(--spacing-md) 0;
    text-align: center;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    :root {
        --font-size-base: 14px;
        --spacing-lg: 24px;
        --spacing-xl: 32px;
    }

    .container {
        padding: var(--spacing-sm);
    }

    header h1 {
        font-size: 2rem;
    }

    .info-panel {
        padding: var(--spacing-sm);
    }

    .legend {
        gap: var(--spacing-sm);
    }

    #wheel-container {
        max-width: 100%;
        padding: var(--spacing-sm);
    }

    /* Adjust node sizes for touch targets on mobile */
    .chord-node {
        stroke-width: 3;
    }

    /* Control Panel Mobile */
    .control-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(calc(100% - 60px));
    }

    .control-panel.expanded {
        transform: translateY(0);
    }

    .toggle-panel-btn {
        display: flex;
    }

    .control-panel-header {
        cursor: pointer;
    }

    /* Progression timeline responsive */
    #progression-timeline {
        padding: var(--spacing-sm);
        margin-bottom: 80px; /* Space for control panel */
    }

    .progression-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .progression-controls {
        gap: var(--spacing-xs);
    }

    .control-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: var(--spacing-sm) 0;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: var(--font-size-small);
    }

    .info-panel {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .legend {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    #wheel-container {
        padding: var(--spacing-xs);
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
        color: black;
    }

    header, footer {
        display: none;
    }

    #control-panel, #progression-timeline {
        display: none;
    }
}
