/**
 * SoundBlock Studio - Custom Toolbox & Block Styling
 * Professional horizontal toolbox for block-based music composition
 */

/* ═══ TOOLBOX BAR ═══ */
.scratchCategoryMenuHorizontal {
    width: 100% !important;
    height: 90px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 6px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

/* Category rows */
.scratchCategoryMenuHorizontal .scratchCategoryMenuRow {
    float: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Category items - block buttons */
.scratchCategoryMenuHorizontal .scratchCategoryMenuItem {
    padding: 0 !important;
    margin: 0 2px !important;
    cursor: grab !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
}

.scratchCategoryMenuHorizontal .scratchCategoryMenuItem:hover {
    transform: translateY(-4px) scale(1.05) !important;
}

.scratchCategoryMenuHorizontal .scratchCategoryMenuItem:active {
    cursor: grabbing !important;
    transform: scale(0.92) !important;
}

.scratchCategoryMenuHorizontal .scratchCategoryMenuItem.categorySelected {
    background: transparent !important;
}

/* Block bubbles in toolbox */
.scratchCategoryMenuHorizontal .scratchCategoryItemBubble {
    width: 52px !important;
    height: 50px !important;
    border-radius: 14px !important;
    margin: 0 !important;
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.12), 0 2px 4px -2px rgba(0, 0, 0, 0.06) !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Top notch */
.scratchCategoryMenuHorizontal .scratchCategoryItemBubble::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 6px;
    background: inherit;
    filter: brightness(0.85);
    border-radius: 0 0 4px 4px;
}

/* Bottom notch */
.scratchCategoryMenuHorizontal .scratchCategoryItemBubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 6px;
    background: inherit;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Event blocks - hat shape (no top notch) */
.scratchCategoryMenuHorizontal .scratchCategoryMenuItem[data-category="event"] .scratchCategoryItemBubble {
    border-radius: 14px 14px 14px 4px !important;
}

.scratchCategoryMenuHorizontal .scratchCategoryMenuItem[data-category="event"] .scratchCategoryItemBubble::before {
    display: none !important;
}

/* Icon inside bubble */
.scratchCategoryMenuHorizontal .scratchCategoryItemIcon {
    width: auto !important;
    height: auto !important;
    font-size: 20px !important;
    color: white !important;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)) !important;
    margin: 0 !important;
}

/* Label below bubble */
.scratchCategoryMenuHorizontal .scratchCategoryMenuItemLabel {
    font-family: 'Baloo 2', 'Inter', sans-serif !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #475569 !important;
    white-space: nowrap !important;
    text-align: center !important;
    max-width: 60px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: 0.3px !important;
}

/* Hover glow on bubble */
.scratchCategoryMenuHorizontal .scratchCategoryMenuItem:hover .scratchCategoryItemBubble {
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.2), 0 4px 8px -4px rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Section separators */
.scratchCategoryMenuHorizontal .scratchCategorySeparator {
    width: 2px !important;
    height: 50px !important;
    background: linear-gradient(180deg, transparent, #cbd5e1, transparent) !important;
    margin: 0 8px !important;
    flex-shrink: 0 !important;
    border-radius: 1px !important;
}

/* ═══ WORKSPACE ═══ */
.blocklyFlyout {
    background: #f8fafc !important;
}

.blocklyMainBackground {
    fill: #f8fafc !important;
}

/* ═══ BLOCK TEXT ═══ */
.blocklyText {
    font-family: 'Baloo 2', 'Inter', sans-serif !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    fill: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Dropdown text on blocks */
.blocklyDropdownText {
    fill: #fff !important;
    font-family: 'Baloo 2', 'Inter', sans-serif !important;
    font-weight: 700 !important;
    font-size: 12px !important;
}

/* Dropdown arrow */
.blocklyDropdownArrow {
    fill: rgba(255, 255, 255, 0.7) !important;
}

/* ═══ DROPDOWN MENU (FieldDropdown popup) ═══ */
.blocklyDropdownMenu {
    font-family: 'Baloo 2', 'Inter', sans-serif !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    padding: 4px !important;
    border: 2px solid rgba(0, 0, 0, 0.06) !important;
}

.blocklyDropdownMenu .goog-menuitem {
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    transition: background 0.15s !important;
}

.blocklyDropdownMenu .goog-menuitem:hover,
.blocklyDropdownMenu .goog-menuitem-highlight {
    background: rgba(139, 92, 246, 0.1) !important;
}

.blocklyDropdownMenu .goog-menuitem-content {
    font-family: 'Baloo 2', 'Inter', sans-serif !important;
}

/* ═══ ICON MENU DROPDOWN (for built-in Scratch blocks) ═══ */
.blocklyDropDownButton {
    border-radius: 12px !important;
    border-width: 2px !important;
    cursor: pointer !important;
    margin: 4px !important;
    outline: none !important;
    padding: 4px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.blocklyDropDownButton:hover,
.blocklyDropDownButton.blocklyDropDownButtonHover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.blocklyDropDownButton img {
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
}

.blocklyIconMenu image {
    opacity: 0.9 !important;
}

/* ═══ SCROLLBAR ═══ */
.scratchCategoryMenuHorizontal::-webkit-scrollbar {
    height: 5px;
}

.scratchCategoryMenuHorizontal::-webkit-scrollbar-track {
    background: transparent;
}

.scratchCategoryMenuHorizontal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.scratchCategoryMenuHorizontal::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ═══ TRASHCAN ═══ */
.blocklyTrash {
    opacity: 0.35 !important;
    transition: opacity 0.2s !important;
}

.blocklyTrash:hover {
    opacity: 0.85 !important;
}

/* ═══ BLOCK SHAPES ═══ */
/* Make blocks slightly rounded and polished */
.blocklyPath {
    stroke-width: 1.5px !important;
}

/* Connection highlights */
.blocklyHighlightedConnectionPath {
    stroke: #fbbf24 !important;
    stroke-width: 4px !important;
}
