@keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .animate-fade-in {
        animation: fadeIn 0.3s ease-in-out;
    }

    /* --- Common Styles for Musical Tools --- */

    /* Form Elements */
    .form-select {
        background: rgba(45, 55, 72, 0.8);
        border: 2px solid rgba(255, 255, 255, 0.1);
        border-radius: 0.75rem;
        color: white;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        transition: all 0.3s ease;
        width: 100%;
    }

    .form-select:focus {
        outline: none;
        border-color: #3182ce;
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
        background: rgba(45, 55, 72, 1);
    }

    .form-select option {
        background: rgba(45, 55, 72, 1);
        color: white;
    }

    .form-label {
        color: #e2e8f0;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
        font-size: 0.9rem;
    }

    .form-select.compact {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Buttons */
    .action-button {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        border-radius: 0.75rem;
        font-weight: 500;
        transition: all 0.3s ease;
        cursor: pointer;
        border: none;
        text-decoration: none;
    }

    .action-button.primary {
        background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
    }

    .action-button.primary:hover {
        background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(49, 130, 206, 0.4);
    }

    .action-button.compact {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Results Display */
    .results-display {
        background: rgba(26, 32, 44, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 1rem;
        padding: 1rem;
        margin-top: 1rem;
    }

    /* Guitar Fretboard (Horizontal) */
    .horizontal-fretboard-container {
        position: relative;
        width: 100%;
        height: 280px;
        background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
        border-radius: 1rem;
        overflow: visible;
        margin: 1rem 0;
        padding: 15px;
        border: 2px solid rgba(139, 69, 19, 0.3);
    }

    .horizontal-fret-numbers {
        position: absolute;
        top: 0;
        left: 20px;
        right: 20px;
        height: 30px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .horizontal-fret-number {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    .horizontal-guitar-strings {
        position: absolute;
        top: 40px;
        left: 20px;
        right: 20px;
        bottom: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }

    .horizontal-string-row {
        position: relative;
        height: 40px;
        display: flex;
        align-items: center;
    }

    .horizontal-guitar-string {
        position: absolute;
        left: 20px;
        right: 0;
        top: 50%;
        height: 2px;
        background: linear-gradient(90deg, #C0C0C0 0%, #808080 100%);
        transform: translateY(-50%);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        z-index: 1;
    }

    .horizontal-string-row:nth-child(1) .horizontal-guitar-string {
        height: 1.5px;
    }

    .horizontal-string-row:nth-child(2) .horizontal-guitar-string {
        height: 2px;
    }

    .horizontal-string-row:nth-child(3) .horizontal-guitar-string {
        height: 2.5px;
    }

    .horizontal-string-row:nth-child(4) .horizontal-guitar-string {
        height: 3px;
    }

    .horizontal-string-row:nth-child(5) .horizontal-guitar-string {
        height: 3.5px;
    }

    .horizontal-string-row:nth-child(6) .horizontal-guitar-string {
        height: 4px;
    }

    .horizontal-frets-for-string {
        position: absolute;
        left: 20px;
        right: 0;
        top: 0;
        bottom: 0;
        display: flex;
        z-index: 2;
    }

    .horizontal-fret-space {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .horizontal-fret-line {
        position: absolute;
        left: 0;
        top: -10px;
        bottom: -10px;
        width: 3px;
        background: linear-gradient(180deg, #FFD700 0%, #DAA520 100%);
        box-shadow: 1px 0 3px rgba(0, 0, 0, 0.4);
        border-radius: 1px;
    }

    .horizontal-note-marker {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 10px;
        color: white;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
        transition: all 0.3s ease;
        border: 2px solid rgba(255, 255, 255, 0.3);
        cursor: pointer;
        position: relative;
        z-index: 3;
    }

    .horizontal-note-marker.open-string {
        border: 3px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3);
        animation: openStringGlow 2s infinite alternate;
    }

    .horizontal-note-marker.fretted-note {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    @keyframes openStringGlow {
        0% {
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.4), inset 0 0 5px rgba(255, 255, 255, 0.2);
        }

        100% {
            box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.4);
        }
    }

    .horizontal-note-marker:hover {
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6) !important;
    }

    .horizontal-fret-inlays {
        position: absolute;
        top: 40px;
        left: 20px;
        right: 20px;
        bottom: 20px;
        pointer-events: none;
        z-index: 1;
    }

    .horizontal-single-inlay {
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .horizontal-double-inlay {
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
    }

    .inlay-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* Piano Styles */
    .large-piano-container {
        position: relative;
        width: 100%;
        height: 300px;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-radius: 1rem;
        overflow: visible;
        margin: 1rem 0;
        padding: 20px;
        border: 2px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .piano-visual {
        position: relative;
        width: 490px;
        height: 220px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .large-piano-key {
        transition: all 0.3s ease;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .large-piano-key:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    }

    @keyframes pianoMarkerGlow {
        0% {
            box-shadow: 0 0 10px currentColor;
        }

        100% {
            box-shadow: 0 0 20px currentColor;
        }
    }

    /* Legend Styles */
    .chord-degrees-legend {
        margin-top: 1rem;
        padding: 1rem;
        background: rgba(45, 55, 72, 0.8);
        border-radius: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .legend-title {
        color: white;
        font-size: 1rem;
        font-weight: bold;
        margin-bottom: 0.8rem;
        text-align: center;
    }

    .legend-items {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.6rem;
        justify-content: center;
    }

    .legend-item {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.3rem 0.6rem;
        background: rgba(55, 65, 81, 0.6);
        border-radius: 0.5rem;
        border: 1px solid rgba(75, 85, 99, 0.4);
    }

    .legend-dot {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.3);
        flex-shrink: 0;
    }

    .legend-text {
        color: white;
        font-size: 0.8rem;
        font-weight: 500;
    }

    /* Responsive Adjustments */
    @media (max-width: 768px) {
        .large-piano-container {
            height: 250px;
            padding: 15px;
        }

        .piano-visual {
            width: 350px;
            height: 180px;
            padding: 8px;
        }

        .large-piano-key.white-key {
            width: 45px !important;
            height: 160px !important;
            font-size: 14px !important;
        }

        .large-piano-key.black-key {
            width: 28px !important;
            height: 105px !important;
            font-size: 11px !important;
        }

        .horizontal-fretboard-container {
            height: 240px;
            padding: 10px;
        }
    }

    @media (max-width: 480px) {
        .large-piano-container {
            height: 200px;
            padding: 10px;
        }

        .piano-visual {
            width: 280px;
            height: 140px;
            padding: 5px;
        }

        .large-piano-key.white-key {
            width: 35px !important;
            height: 120px !important;
            font-size: 12px !important;
        }

        .large-piano-key.black-key {
            width: 22px !important;
            height: 80px !important;
            font-size: 9px !important;
        }
    }
