/* ===== STYLES FOR GUITAR SITE-SPECIFIC FEATURES (NOTATION, FRETBOARD) ===== */

/* ===== NOTATION PAGE STYLES ===== */
/* Notation Page CSS Variables - Light/Dark Mode Support */
:root {
    /* Base light mode colors */
    --notation-bg-color: var(--bg-color);
    --notation-text-color: var(--text-color);
    --notation-border-color: var(--light-border);
    --notation-highlight-color: var(--focus-color);
    --notation-highlight-bg: rgba(0, 123, 255, 0.1);

    /* Position indicator */
    --notation-position-bg: rgba(127, 127, 127, 0.5);
    --notation-position-width: var(--spacing-sm);

    /* Chord thumbnails */
    --notation-chord-thumb-bg: var(--bg-color);
    --notation-chord-thumb-border: var(--light-border);
    --notation-chord-thumb-text: var(--text-color);
    --notation-chord-thumb-highlight-border: var(--text-color);
    --notation-chord-thumb-highlight-text: var(--focus-color);

    /* Hotspots */
    --notation-hotspot-bg: var(--color-danger);
    --notation-hotspot-border: var(--color-danger);
    --notation-hotspot-shadow: rgba(0, 0, 0, 0.6);

    /* Transitions */
    --notation-transition-time: var(--transition-speed);
}

/* Dark mode colors */
[data-theme="dark"] [data-page-type="notation-page"] {
    --notation-bg-color: var(--bg-color);
    --notation-text-color: var(--text-color);
    --notation-border-color: var(--light-border);
    --notation-highlight-color: var(--focus-color);
    --notation-highlight-bg: rgba(77, 171, 255, 0.2);

    /* Position indicator */
    --notation-position-bg: rgba(127, 127, 127, 0.75);

    /* Chord thumbnails */
    --notation-chord-thumb-bg: #333333;
    --notation-chord-thumb-border: #555555;
    --notation-chord-thumb-text: var(--text-color);
    --notation-chord-thumb-highlight-border: var(--text-color);
    --notation-chord-thumb-highlight-text: var(--focus-color);

    /* Hotspots */
    --notation-hotspot-bg: #ff4d4d;
    --notation-hotspot-border: #ff4d4d;
    --notation-hotspot-shadow: rgba(0, 0, 0, 0.8);
}

/* Basic container styling */
[data-page-type="notation-page"] {
    color: var(--notation-text-color);
    background-color: var(--notation-bg-color);
    transition: color var(--notation-transition-time) ease,
        background-color var(--notation-transition-time) ease;
}

/* Main containers */
[data-page-type="notation-page"] #main-container {
    color: var(--notation-text-color);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==============================================
 * Metronome and Chord Thumbnails Layout
 * ==============================================
 */

/* Metro and chord thumbnails container - ensure bottom alignment */
[data-page-type="notation-page"] #metroAndThumbContainer {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin: var(--spacing-xs) 0;
    min-height: clamp(45px, 8vw, 60px);
    width: 100%;
    overflow-x: auto;
}

/* Metronome container */
[data-page-type="notation-page"] #metronome-container {
    flex: 0 0 auto;
    margin-right: 0;
}

/* Chord thumbnails container - always stay at bottom of metronome */
[data-page-type="notation-page"] #chord-thumbs {
    display: flex;
    flex-direction: column;
    margin: 0 0 0 var(--spacing-sm);
    padding: 0;
    align-self: flex-end;
    flex: 1;
    min-height: 0;
}

/* Chord rows - ensure left alignment */
[data-page-type="notation-page"] .chord-thumb-row {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    margin-bottom: 4px;
    min-height: clamp(30px, 6vw, 40px);
}

/* Individual chord thumbnails - ensure left text alignment */
[data-page-type="notation-page"] #chord-thumbs>div {
    position: relative;
    min-width: clamp(25px, 5vw, 35px);
    margin-right: 2px;
    display: inline-block;
    text-align: left;
    background-color: transparent;
    transition: background-color var(--notation-transition-time) ease,
        color var(--notation-transition-time) ease;
}

/* Make scroll indicator more visible */
[data-page-type="notation-page"] #chord-thumbs::-webkit-scrollbar,
[data-page-type="notation-page"] .chord-thumb-row::-webkit-scrollbar {
    height: 4px;
}

[data-page-type="notation-page"] #chord-thumbs::-webkit-scrollbar-thumb,
[data-page-type="notation-page"] .chord-thumb-row::-webkit-scrollbar-thumb {
    background-color: var(--notation-border-color);
    border-radius: var(--border-radius-sm);
}

/* ==============================================
 * Notation display - enhanced for all modes
 * ==============================================
 */

/* Common settings for notation display in all modes */
[data-page-type="notation-page"] #notationDiv {
    position: relative;
    margin: var(--spacing-sm) 0;
    max-width: 100%;
    overflow-x: auto;
    background-color: var(--notation-bg-color);
    opacity: 1;
    image-rendering: auto;
}

/* Measure slots container for small displays */
[data-page-type="notation-page"] #measureSlotsDiv {
    background-color: var(--notation-bg-color);
    opacity: 1;
    max-width: 100%;
    position: relative;
}

/* Individual measure containers */
[data-page-type="notation-page"] [id^="measure-container-"] {
    background-color: var(--notation-bg-color);
    opacity: 1;
    position: relative;
}

/* Individual measure slots */
[data-page-type="notation-page"] #measureSlotsDiv>div>div {
    position: relative;
    opacity: 1;
    image-rendering: auto;
}

/* Properly handle images in dark mode with consistent visibility */
[data-theme="dark"] [data-page-type="notation-page"] #notationDiv img:not([data-native-dark="true"]) {
    filter: invert(0.9) hue-rotate(180deg) brightness(0.9) contrast(1.2);
    background-color: white;
    opacity: 1;
}

/* Force background color for measure slots in dark mode */
[data-theme="dark"] [data-page-type="notation-page"] #measureSlotsDiv {
    background-color: var(--notation-bg-color);
}

[data-theme="dark"] [data-page-type="notation-page"] #measureSlotsDiv [id^="measure-container-"] {
    background-color: var(--notation-bg-color);
}

/* Need white background for background images that will be inverted */
[data-theme="dark"] [data-page-type="notation-page"] [style*="background-image"] {
    background-color: white;
    opacity: 1;
}

/* Special dark mode handling for notation images and backgrounds */
[data-theme="dark"] [data-page-type="notation-page"] {
    background-color: var(--notation-bg-color);
}

/* Images and areas with notation need white backgrounds for proper inversion */
[data-theme="dark"] [data-page-type="notation-page"] img:not([data-native-dark="true"]),
[data-theme="dark"] [data-page-type="notation-page"] [style*="background-image"] {
    background-color: white;
    filter: invert(0.9) hue-rotate(180deg) brightness(0.9) contrast(1.2);
}

/* Notation image wrapper should maintain dark background */
[data-theme="dark"] [data-page-type="notation-page"] #notationDiv {
    background-color: var(--notation-bg-color);
}

/* But ensure slots with background images have white backgrounds */
[data-theme="dark"] [data-page-type="notation-page"] [style*="background-image"] {
    background-color: white;
}

/* Measure slots container should maintain proper dark background */
[data-theme="dark"] [data-page-type="notation-page"] #measureSlotsDiv {
    background-color: var(--notation-bg-color);
}

/* But inner slots with background images need white */
[data-theme="dark"] [data-page-type="notation-page"] #measureSlotsDiv [style*="background-image"] {
    background-color: white;
}

/* Force proper colors for containers */
[data-theme="dark"] [data-page-type="notation-page"] #metroAndThumbContainer {
    background-color: var(--notation-bg-color);
}

[data-page-type="notation-page"] #notationPositionDiv {
    position: absolute;
    width: var(--notation-position-width);
    background-color: var(--notation-position-bg);
    z-index: var(--z-overlay);
    opacity: 1;
    transition: left 0.1s ease, top 0.1s ease, height 0.1s ease;
    border-radius: var(--border-radius-sm);
    pointer-events: none;
    display: block;
}

/* Keyboard focus styles */
[data-page-type="notation-page"] button:focus-visible,
[data-page-type="notation-page"] #chord-thumbs>span:focus-visible {
    outline: 2px solid var(--notation-highlight-color);
    outline-offset: 2px;
}

/* Notation error styles */
.notation-error {
    padding: var(--spacing-md);
    margin: var(--spacing-md);
    background-color: var(--color-danger-light);
    border: 1px solid var(--color-danger);
    border-radius: var(--border-radius-sm);
    color: var(--color-danger);
}

.notation-error h3 {
    margin-top: 0;
    color: var(--color-danger);
}

/* Fix for very small screens */
@media (max-width: 400px) {

    [data-page-type="notation-page"] #notationDiv,
    [data-page-type="notation-page"] #measureSlotsDiv,
    [data-page-type="notation-page"] [id^="measure-container-"] {
        margin: 0;
        padding: 0;
    }

    [data-page-type="notation-page"] #metroAndThumbContainer {
        min-height: 40px;
    }

    [data-page-type="notation-page"] .chord-thumb-row {
        min-height: 25px;
    }
}

/* GAME BUTTON COMPONENT STYLES - GRID-BASED LAYOUT */
/* CSS custom properties for grid-based button positioning */
:root {
    /* Grid system variables */
    --grid-total-positions: 18;
    --grid-offset: 2;
    --button-grid-width: 2;
    /* Each button spans 2 grid units */

    /* Button sizing */
    --button-height: clamp(50px, 4vw, 80px);
    --button-font-size: clamp(14px, 2.5vw, 16px);

    /* Container sizing */
    --container-max-width: 800px;
    --container-padding: clamp(20px, 4vw, 30px);
}

/* ENHANCED: Game button styling leveraging .btn base patterns from mystyle.css */
.game-button {
    /* Base button styling inherited from .btn patterns via shared CSS variables */
    position: absolute;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--light-border);
    border-radius: var(--border-radius-lg);
    font-size: var(--button-font-size);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    min-height: 44px;
    /* iOS touch target minimum - consistent with .btn */
    height: var(--button-height);
    overflow: hidden;
    /* Prevent text overflow */
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 2px 4px;
    /* Game-specific compact padding */
}

/* ENHANCED: Hover and interaction states consistent with .btn patterns */
.game-button:hover {
    background-color: var(--light-bg);
    border-color: var(--focus-color);
    transform: translateY(-1px);
    /* Game-specific transform preserved */
}

.game-button:active {
    background-color: var(--light-bg);
    transform: translateY(0);
    /* Game-specific transform preserved */
}

.game-button:disabled {
    background: var(--button-disabled);
    /* Consistent with .btn:disabled */
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ENHANCED: Game button feedback states using semantic color system from mystyle.css */
.game-button--correct {
    background-color: var(--color-success) !important;
    /* Semantic success color */
    color: white !important;
    animation: game-button-pulse-correct 0.3s ease;
}

.game-button--incorrect {
    background-color: var(--color-danger) !important;
    /* Semantic danger color */
    color: white !important;
    animation: game-button-pulse-incorrect 0.3s ease;
}

.game-button--disabled {
    opacity: 0.7 !important;
    pointer-events: none;
}

/* ENHANCED: Game button variants - modular extensions of base .game-button */
/* Note button specific styling - for musical note games */
.note-button {
    font-family: monospace;
    /* Clear note display */
    letter-spacing: 0.5px;
}

/* Number button specific styling - for numerical games */
.number-button {
    font-weight: 600;
    /* Emphasize numbers */
}

/* Labeled button specific styling - for text-based games */
.labeled-button {
    font-size: calc(var(--button-font-size) * 0.9);
    /* Slightly smaller for readability */
    text-align: center;
}

/* Game button container layout */
.game-button-container {
    background-color: var(--bg-color);
    padding: var(--container-padding);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: var(--container-max-width);
    width: 100%;
    margin: var(--spacing-lg) auto;
}

/* Note button container - Two-row piano layout */
.note-buttons-container {
    background-color: var(--bg-color);
    padding: var(--container-padding);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: var(--container-max-width);
    width: auto;
    /* Changed from 100% to auto to allow natural expansion */
    margin: var(--spacing-lg) auto;
    min-width: 400px;
    /* Ensure minimum width for grid positioning */
    min-height: 120px;
}

.note-keys {
    width: 100%;
    min-width: 400px;
    /* Ensure the grid has space to work */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center the rows horizontally */
    margin-top: -1.5rem;
    /* Adjust vertical positioning */
}

.note-buttons-accidental-row {
    position: relative;
    height: var(--button-height);
    margin-bottom: var(--spacing-md);
    width: 100%;
    min-width: 400px;
    max-width: var(--container-max-width);
    /* Constrain to max width for proper centering */
}

.note-buttons-natural-row {
    position: relative;
    height: var(--button-height);
    width: 100%;
    min-width: 400px;
    max-width: var(--container-max-width);
    /* Constrain to max width for proper centering */
}

/* Number button container - Single row layout */
.number-buttons-container {
    background-color: var(--bg-color);
    padding: var(--container-padding);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: var(--container-max-width);
    width: auto;
    margin: var(--spacing-lg) auto;
    min-width: 400px;
}

.number-buttons-row {
    position: relative;
    height: var(--button-height);
    width: 100%;
    min-width: 400px;
}

/* Labeled button container - Multi-row layout */
.labeled-buttons-container {
    background-color: var(--bg-color);
    padding: var(--container-padding);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: var(--container-max-width);
    width: auto;
    margin: var(--spacing-lg) auto;
    min-width: 400px;
}

.labeled-buttons-top-row,
.labeled-buttons-bottom-row {
    position: relative;
    height: var(--button-height);
    margin-bottom: var(--spacing-sm);
    width: 100%;
    min-width: 400px;
}

.labeled-buttons-bottom-row {
    margin-bottom: 0;
}

/* Responsive adjustments removed - letting JavaScript handle natural responsive behavior */

/* Responsive adjustments for mobile displays */
@media (max-width: 600px) {
    :root {
        --container-padding: 20px;
        --button-font-size: 14px;
        --button-height: clamp(40px, 3.5vw, 60px);
    }

    /* Reduce button container minimum width for mobile */
    .note-buttons-container,
    .note-keys,
    .note-buttons-accidental-row,
    .note-buttons-natural-row {
        min-width: 320px;
        /* Smaller minimum for mobile */
    }

    .note-keys {
        margin-top: -0.5rem;
        /* Adjust vertical positioning */
    }
}

@media (max-width: 400px) {
    :root {
        --button-font-size: 12px;
        --button-height: clamp(35px, 3vw, 50px);
        --container-padding: 15px;
    }
}

@media (max-width: 320px) {

    /* Reduce button container minimum width for mobile */
    .note-buttons-container,
    .note-keys,
    .note-buttons-accidental-row,
    .note-buttons-natural-row {
        min-width: 100px;
        /* Smaller minimum for mobile */
    }
}


/* Fretboard-specific game styling - moved from JavaScript injection */
/* Fretboard CSS Variables - Light/Dark Mode Support */

:root {
    /* Fretboard light mode colors */
    --fretboard-bg-color: #f8f4e3;
    /* Light wood color */
    --fretboard-fretboard-color: #4a3728;
    /* Dark wood color */
    --fretboard-fret-color: #C0C0C0;
    /* Silver color */
    --fretboard-string-color: #d4d4d4;
    /* String color */
    --fretboard-marker-color: #e6e6e6;
    /* Fret marker color */
    --fretboard-text-color: #333333;
    /* Text color */

    /* Fretboard dot colors */
    --fretboard-dot-normal-color: #2CDB57;
    /* Green */
    --fretboard-dot-highlight-color: #3737FF;
    /* Blue */
    --fretboard-dot-border-color: #000000;
    /* Black */

    /* Fretboard game UI colors */
    --fretboard-correct-color: #28a745;
    /* Success green */
    --fretboard-incorrect-color: #dc3545;
    /* Error red */
    --fretboard-button-bg: white;
    --fretboard-button-border: #ccc;
    --fretboard-button-text: #333;
    --fretboard-button-hover-bg: #f0f0f0;

    /* Fretboard game control elements */
    --game-control-height: 40px;
    --game-control-margin: 10px;
    --game-control-padding: 5px;
    --game-score-font-weight: bold;
    --game-message-min-height: 20px;
}

/* Fretboard dark mode colors */
[data-theme="dark"] {
    --fretboard-bg-color: #2c2c2c;
    /* Dark background */
    --fretboard-fretboard-color: #1a1a1a;
    /* Darker wood color */
    --fretboard-fret-color: #888888;
    /* Darker silver color */
    --fretboard-string-color: #aaaaaa;
    /* Slightly lighter string color */
    --fretboard-marker-color: #555555;
    /* Darker fret marker color */
    --fretboard-text-color: #e0e0e0;
    /* Light text color */

    /* Fretboard dark mode dot colors */
    --fretboard-dot-normal-color: #28a745;
    /* Slightly darker green */
    --fretboard-dot-highlight-color: #4d4dff;
    /* Slightly darker blue */
    --fretboard-dot-border-color: #ffffff;
    /* White border for contrast */

    /* Fretboard dark mode game UI colors */
    --fretboard-correct-color: #2ecc71;
    /* Brighter green for dark mode */
    --fretboard-incorrect-color: #e74c3c;
    /* Brighter red for dark mode */
    --fretboard-button-bg: #333333;
    --fretboard-button-border: #555555;
    --fretboard-button-text: #e0e0e0;
    --fretboard-button-hover-bg: #444444;
}

/* Fretboard page basic styling */
[data-page-type="fretboard-page"] {
    color: var(--fretboard-text-color);
    transition: color 0.3s ease;
}

.fretboard-svg {
    background-color: var(--fretboard-bg-color);
    transition: background-color 0.3s ease;
}

/* Fretboard game control elements */
#gameControlDiv {
    position: relative;
    margin-top: var(--game-control-margin);
    height: var(--game-control-height);
}

#remainingDiv {
    position: absolute;
    left: 10px;
    top: 0px;
}

#replayDiv {
    position: absolute;
    left: 150px;
    top: 5px;
    font-weight: var(--game-score-font-weight);
    color: var(--fretboard-incorrect-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#scoreDiv {
    position: absolute;
    left: 35px;
    top: 20px;
    font-weight: var(--game-score-font-weight);
}

#scoreMessageDiv {
    position: relative;
    left: 10px;
    top: 0px;
    min-height: var(--game-message-min-height);
    transition: color 0.3s ease;
}

@media (min-width: 800px) {
    #scoreMessageDiv {
        width: 60%;
    }
}

@media (max-width: 799px) {
    #scoreMessageDiv {
        width: 90%;
    }
}

/* Fretboard-specific button styling - extends base game button styles */
[data-page-type="fretboard-page"] .note-button,
[data-page-type="fretboard-page"] .labeled-button,
[data-page-type="fretboard-page"] .number-button {
    border: 1px solid var(--fretboard-button-border, #ccc);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--fretboard-button-bg, white);
    color: var(--fretboard-button-text, #333);
}

[data-page-type="fretboard-page"] .note-button:hover,
[data-page-type="fretboard-page"] .labeled-button:hover,
[data-page-type="fretboard-page"] .number-button:hover {
    background-color: var(--fretboard-button-hover-bg);
}

[data-page-type="fretboard-page"] .note-button:active,
[data-page-type="fretboard-page"] .labeled-button:active,
[data-page-type="fretboard-page"] .number-button:active {
    transform: scale(0.95);
}

/* Fretboard-specific container styling - minimal overrides to let JavaScript handle sizing */
[data-page-type="fretboard-page"] .note-buttons-container,
[data-page-type="fretboard-page"] .number-buttons-container,
[data-page-type="fretboard-page"] .labeled-buttons-container {
    border-radius: 3px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    background-color: var(--fretboard-bg-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;

    /* Let JavaScript positioning system handle all sizing naturally */
}

/* Fretboard-specific responsive styling removed - JavaScript positioning handles responsiveness naturally */

/* Feedback animations */
@keyframes game-button-pulse-correct {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.4);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes game-button-pulse-incorrect {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.02) rotate(-1deg);
    }

    75% {
        transform: scale(1.02) rotate(1deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Responsive design */
@media (max-width: 400px) {

    .number-buttons-row,
    .labeled-buttons-top-row,
    .labeled-buttons-bottom-row {
        /*   flex-wrap: wrap; */
    }

    .game-button {
        flex: 1 0 auto;
        /*   min-width: calc((100% - var(--spacing-xs) * 2) / 3);*/
    }
}

/* ===== NOTATION ADMIN STYLES ===== */
/* CSS classes replacing inline styles for improved separation of concerns */

.notation-admin-container {
    margin: 10px 0px 10px 0px; /* Any left or right margin is added to notationImageOrigWidth */
    max-width: 100%;
    width: auto;
    position: relative; /* Explicitly set so notationPositionDiv is relative to that corner */
}

.notation-admin-image {
    max-width: 100%;
    width: auto;
    height: auto;
}

/* Notation UI Module - CSS classes replacing inline styles */
.notation-flex-container {
    display: flex;
    justify-content: left;
    width: 100%;
    position: relative;
    margin: 0 auto;
}

.notation-hotspot-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through to image */
}

.notation-container-positioned {
    position: relative;
}

.notation-image-responsive {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    opacity: 1;
    image-rendering: auto;
}

/* Additional notation admin components */
.notation-admin-position-div {
    position: absolute;
    width: 12px;
    background-color: #7f7f7f; /* Light gray */
    opacity: 0.4;
}

.notation-admin-position-bar {
    position: absolute;
    width: 12px;
    background-color: #7f7f7f; /* Light gray */
    opacity: 0.4;
}

.notation-admin-highlighted-cell {
    position: absolute;
    background-color: lightgreen;
}

/* ================================
   SECTION - METRONOME COMPONENT STYLES
   ================================ */

.metronome {
    --metronome-text-color: var(--notation-text-color, var(--text-color));
    --metronome-highlight-color: var(--notation-highlight-color, var(--focus-color));
    --metronome-bg-color: var(--notation-bg-color, var(--bg-color));
    --metronome-border-color: var(--notation-border-color, var(--light-border));
    --metronome-spacing: var(--spacing-sm);
    --metronome-transition: var(--transition-speed) ease;
    
    position: relative;
    font-family: system-ui, sans-serif;
    color: var(--metronome-text-color);
    background-color: var(--metronome-bg-color);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--metronome-border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: auto;
    cursor: pointer;
    transition: background-color var(--metronome-transition),
                color var(--metronome-transition),
                border-color var(--metronome-transition),
                box-shadow var(--metronome-transition);
}

.metronome-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
    padding: var(--metronome-spacing);
    transition: transform var(--metronome-transition);
    width: clamp(70px, 15vw, 90px);
    min-width: 70px;
    max-width: 90px;
}

.metronome-container:hover {
    transform: scale(1.02);
}

.metronome-shoe-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    position: relative;
}

.metronome-shoe {
    width: auto;
    height: 100%;
    max-height: 40px;
    object-fit: contain;
    transition: opacity var(--metronome-transition);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
}

.metronome-shoe[data-state="hidden"] {
    opacity: 0;
    pointer-events: none;
}

.metronome-text {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--metronome-transition);
}

.metronome-beat {
    font-size: var(--font-size-md);
    font-weight: bold;
}

.metronome-measure {
    font-size: var(--font-size-sm);
}

.metronome-tempo {
    font-size: var(--font-size-xs);
    color: var(--metronome-highlight-color);
    margin-top: var(--spacing-xs);
}

.metronome-beat,
.metronome-measure {
    font-family: 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.metronome-loop {
    font-size: var(--font-size-xs);
    opacity: 0.9;
}

/* Small screen adjustments */
.metronome-small .metronome-container {
    width: clamp(60px, 12vw, 70px);
    min-width: 60px;
    max-width: 70px;
    padding: var(--spacing-xs);
}

.metronome-small .metronome-shoe-container {
    height: clamp(25px, 6vw, 30px);
}

.metronome-small .metronome-shoe {
    max-height: clamp(25px, 6vw, 30px);
}

.metronome-small .metronome-beat {
    font-size: var(--font-size-sm);
}

.metronome-small .metronome-measure {
    font-size: var(--font-size-xs);
}

.metronome-small .metronome-loop {
    font-size: var(--font-size-xs);
}

.metronome-small .metronome-tempo {
    font-size: var(--font-size-xs);
}

/* Keyboard accessibility */
.metronome:focus-visible {
    outline: 2px solid var(--metronome-highlight-color);
    outline-offset: 2px;
}

/* Explicitly remove any animation when playing */
.metronome[data-playing="true"] .metronome-beat {
    animation: none !important;
}

/* ===== FRETBOARD QUIZ GAME STYLES ===== */

/* Fretboard game container - leverages existing patterns */
.fretboard-game-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Breadcrumb styles for fretboard games */
.fretboard-game-breadcrumb {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--light-bg);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--color-neutral);
}

.fretboard-game-breadcrumb a {
    color: var(--focus-color);
    text-decoration: none;
}

.fretboard-game-breadcrumb a:hover {
    text-decoration: underline;
}

/* Header section for fretboard games */
.fretboard-game-header {
    margin-bottom: 1rem;
}

.fretboard-game-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

/* Dark mode support for fretboard games */
[data-theme="dark"] .fretboard-game-container {
    --text-color: #e0e0e0;
    --bg-color: #222222;
    --light-bg: #333333;
    --color-neutral: #aaaaaa;
    --focus-color: #5D9FFF;
}

/* Media queries for responsive fretboard game layout */
@media (max-width: 768px) {            
    .fretboard-game-navigation-buttons {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .fretboard-game-title {
        font-size: 1.1rem;
    }
}

/* ===== HOTSPOT PAGE STYLES ===== */
/* Hotspot Page CSS Variables - Light/Dark Mode Support */

:root {
    /* Base light mode colors for hotspot pages */
    --hotspot-bg-color: var(--bg-color);
    --hotspot-text-color: var(--text-color);
    --hotspot-heading-color: #222222;
    --hotspot-border-color: var(--light-border);
    --hotspot-link-color: var(--focus-color);
    --hotspot-link-hover-color: #0056b3;
    
    /* Images */
    --hotspot-image-bg: var(--bg-color);
    --hotspot-image-border: var(--light-border);
    
    /* Container */
    --hotspot-container-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --hotspot-transition-time: var(--transition-speed);
}

/* Dark mode colors for hotspot pages */
[data-theme="dark"] [data-page-type="hotspot-page"] {
    --hotspot-bg-color: var(--bg-color);
    --hotspot-text-color: var(--text-color);
    --hotspot-heading-color: #ffffff;
    --hotspot-border-color: var(--light-border);
    --hotspot-link-color: #4dabff;
    --hotspot-link-hover-color: #6dc0ff;
    
    /* Images */
    --hotspot-image-bg: #ffffff; /* Keep white bg for images in dark mode */
    --hotspot-image-border: #444444;
    
    /* Container */
    --hotspot-container-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Base container styling */
[data-page-type="hotspot-page"] {
    color: var(--hotspot-text-color);
    background-color: var(--hotspot-bg-color);
    transition: color var(--hotspot-transition-time) ease,
                background-color var(--hotspot-transition-time) ease;
}

/* Main container */
.hotspot-page-container {
    margin: var(--spacing-lg) auto;
    max-width: 800px;
    padding: var(--spacing-lg);
    background-color: var(--hotspot-bg-color);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--hotspot-border-color);
    box-shadow: var(--hotspot-container-shadow);
    transition: background-color var(--hotspot-transition-time) ease,
                color var(--hotspot-transition-time) ease,
                border-color var(--hotspot-transition-time) ease,
                box-shadow var(--hotspot-transition-time) ease;
}

/* Title */
.hotspot-page-title {
    color: var(--hotspot-heading-color);
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--hotspot-border-color);
    transition: color var(--hotspot-transition-time) ease,
                border-color var(--hotspot-transition-time) ease;
    font-size: var(--font-size-lg);
}

/* Content area */
.hotspot-page-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Images */
.hotspot-page-images {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.hotspot-page-image-wrapper {
    background-color: var(--hotspot-image-bg);
    border: 1px solid var(--hotspot-image-border);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    max-width: 100%;
    transition: border-color var(--hotspot-transition-time) ease;
}

.hotspot-page-image {
    max-width: 100%;
    height: auto;
    display: block;
    filter: none !important; /* Prevent dark mode inversion */
}

/* Ensure images are not inverted in dark mode */
[data-theme="dark"] img[data-no-invert="true"] {
    filter: none !important;
}

/* Failed image message */
.image-error-message {
    padding: var(--spacing-lg);
    color: var(--color-danger);
    text-align: center;
}

/* Text content */
.hotspot-page-text {
    color: var(--hotspot-text-color);
    line-height: 1.6;
    transition: color var(--hotspot-transition-time) ease;
}

/* List styling */
.hotspot-page-text ul,
.hotspot-page-text ol {
    padding-left: 25px;
    margin-bottom: var(--spacing-lg);
}

.hotspot-page-text li {
    margin-bottom: var(--spacing-xs);
}

/* Link styling */
.hotspot-page-text a {
    color: var(--hotspot-link-color);
    text-decoration: none;
    transition: color var(--hotspot-transition-time) ease;
}

.hotspot-page-text a:hover {
    text-decoration: underline;
    color: var(--hotspot-link-hover-color);
}

/* Error message */
.hotspot-page-error {
    background-color: #ffeeee;
    color: var(--color-danger);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-md);
    border: 1px solid #ffcccc;
    margin: var(--spacing-lg) auto;
    max-width: 800px;
}

/* Dark mode error styling */
[data-theme="dark"] .hotspot-page-error {
    background-color: #442222;
    color: #ff8888;
    border-color: #883333;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .hotspot-page-container {
        padding: var(--spacing-md);
        margin: var(--spacing-sm);
    }
    
    .hotspot-page-images {
        flex-direction: column;
        align-items: center;
    }
}