/* This css is for Sketch tool section style */

.header-box {
    flex-shrink: 0;
}

/* basic layout for tool can be found from parameter-lab css */

.lab__section{
    padding: 0 !important;
}

button{
    /* Reset all default button styles */
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    outline: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: inherit;
    transform-style: none;
}


.sketch__section-title-box ul{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

.sketch__section {
    overflow: visible !important;
}

.sketch__section-title-box{
    margin: var(--spacing-xs) 0 0;
    overflow: visible !important;
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--color-border);
}

.sketch__section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-m);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.sketch__section-title-wrapper.all-selected {
    background: #E1ED50;
}

.sketch__section-title-wrapper.all-selected .sketch__section-title {
    color: #191919;
}

.sketch__section-title-wrapper.all-selected #add-element img {
    content: url('/assets/icons/icon-plus-solid=light.svg');
}

.sketch__section-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.sketch__selection-indicator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 300;
}

.icon_plus-solid {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Elements list container */
.sketch__elements-list {
    margin: var(--spacing-s)  0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 300px;
    padding: 0 var(--spacing-m);
    overflow-x: visible !important;
    padding-right: var(--spacing-xs);
}

/* Auto-hide scrollbar - show only when hovering or scrolling */
.sketch__elements-list::-webkit-scrollbar {
    width: 6px;
}

.sketch__elements-list::-webkit-scrollbar-track {
    background: transparent;
}

.sketch__elements-list::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.2s;
}

.sketch__elements-list:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.sketch__elements-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar styling */
.sketch__elements-list {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sketch__elements-list:hover {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Individual element item wrapper */
.sketch__element-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    overflow: visible !important;
}

/* Individual element item */
.sketch__element-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-s);
    border-radius: 8px;
    color: var(--color-1);
    font-family: 'DM Mono', monospace;
    font-size: var(--font-size-xs);
    cursor: pointer !important;
    overflow: visible !important;
    user-select: none;
    background: transparent;
    transition: background-color 0.15s ease;
    pointer-events: auto !important;
}

.sketch__element-item * {
    cursor: pointer !important;
    user-select: none;
}

.sketch__element-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.sketch__element-item:active,
:focus, 
:
 {
    background: #E1ED50 !important;
    color: #191919 !important;
}


.sketch__element-item.selected {
    background: #E1ED50 !important;
    color: #191919 !important;
}

.sketch__element-item.all-selected-child {
    background: rgba(225, 237, 80, 0.3);
    color: #191919 !important;
}

.sketch__element-item.all-selected-child .sketch__element-name,
.sketch__element-item.all-selected-child .sketch__element-dropdown,
.sketch__element-item.all-selected-child .sketch__element-type-icon {
    color: #191919 !important;
    opacity: 1 !important;
}

.sketch__element-item.selected .sketch__element-name,
.sketch__element-item.selected .sketch__element-dropdown,
.sketch__element-item.selected .sketch__element-type-icon {
    color: #191919 !important;
    opacity: 1 !important;
}

.sketch__element-item.selected .sketch__element-dropdown img,
.sketch__element-item.selected .sketch__element-type-icon img,
.sketch__element-item.all-selected-child .sketch__element-dropdown img,
.sketch__element-item.all-selected-child .sketch__element-type-icon img {
    filter: brightness(0) saturate(100%);
}

/* Element info (left side) */
.sketch__element-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-s);
    overflow: visible !important;
}

.sketch__element-item.selected .sketch__element-info * {
    color: #191919 !important;
    overflow: visible !important;
}

/* Dropdown arrow */
.sketch__element-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: transform 0.2s, opacity 0.2s;
}

.sketch__element-dropdown.collapsed {
    transform: rotate(-90deg);
}

.sketch__element-item:hover .sketch__element-dropdown {
    opacity: 1;
}

/* Element type icon */
.sketch__element-type-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.sketch__element-type-icon img {
    width: 100%;
    height: 100%;
}

.sketch__element-name {
    color: var(--color-1);
}

/* Plus button for adding sub-elements */
.icon_plus-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
    width: 16px;
    height: 16px;
}

.icon_plus-sub:hover {
    opacity: 1;
}

/* Selected item plus icon - use light version */
.sketch__element-item.selected .icon_plus-sub img {
    content: url('/assets/icons/icon-plus-solid=light.svg');
}

/* Sub-elements container */
.sketch__sub-elements {
    margin-left: var(--spacing-l);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding-left: var(--spacing-s);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible !important;
}

.sketch__sub-elements.collapsed {
    display: none;
}

/* Sub-element item */
.sketch__sub-element-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-s);
    border-radius: 6px;
    color: var(--color-1);
    font-family: 'DM Mono', monospace;
    font-size: var(--font-size-xs);
    background: rgba(255, 255, 255, 0.02);
    overflow: visible !important;
    cursor: pointer !important;
    user-select: none;
    transition: background-color 0.15s ease;
    pointer-events: auto !important;
}

.sketch__sub-element-item * {
    cursor: pointer !important;
    user-select: none;
}

.sketch__sub-element-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.sketch__sub-element-item.selected {
    background: #E1ED50 !important;
    color: #191919 !important;
}

.sketch__sub-element-item.all-selected-child {
    background: rgba(225, 237, 80, 0.3);
    color: #191919 !important;
}

.sketch__sub-element-item.selected .sketch__element-name {
    color: #191919 !important;
}

/* Type selection popup */
.sketch__type-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #191919;
    border: 1px solid #484848;
    border-radius: 10px;
    padding: var(--spacing-m);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 200px;
}

.sketch__type-popup h6 {
    margin: 0 0 var(--spacing-s) 0;
    color: var(--color-1);
    font-size: var(--font-size-s);
}

.sketch__type-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.sketch__type-option {
    padding: var(--spacing-s);
    background: var(--color-4);
    border: 1px solid #484848;
    border-radius: 6px;
    color: var(--color-1);
    font-family: 'DM Mono', monospace;
    font-size: var(--font-size-xs);
    text-align: left;
    transition: all 0.2s;
}

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

/* Popup overlay */
.sketch__popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Context menu for deletion */
.sketch__context-menu {
    position: fixed;
    background: #191919;
    border: 1px solid #484848;
    border-radius: 6px;
    padding: var(--spacing-xs);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    min-width: 120px;
}

.sketch__context-menu-item {
    padding: var(--spacing-xs) var(--spacing-s);
    color: var(--color-1);
    font-family: 'DM Mono', monospace;
    font-size: var(--font-size-xs);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    width: 100%;
}

.sketch__context-menu-item:hover {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
}

.sketch__context-menu-item.delete {
    color: #ff6b6b;
}

/* Hide the parameter lab test button on sketch tool page */
#test-button {
    display: none !important;
}

/* Sketch buttons preview */
.sketch__preview-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-m);
    margin-top: 0;
    justify-content: center;
    align-items: flex-start;
}

/* Individual preview button */
.sketch__preview-button {
    width: 120px;
    height: 120px;
    background: #efefec;
    border: 1px solid #484848;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-s);
}

.sketch__preview-button:hover {
    background: #e0e0dd;
    transform: scale(1.02);
}

.sketch__preview-button:active {
    transform: scale(0.98);
}

/* Button options inside preview button */
.sketch__button-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.sketch__button-option {
    background: none;
    border: none;
    color: #666;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s;
}

.sketch__button-option:hover {
    color: #000;
}

/* States section */
.sketch__states-list {
    margin: var(--spacing-s) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 200px;
    overflow-y: auto !important;
    overflow-x: visible !important;
    padding: 0 var(--spacing-m);
}

/* States list scrollbar */
.sketch__states-list::-webkit-scrollbar {
    width: 6px;
}

.sketch__states-list::-webkit-scrollbar-track {
    background: transparent;
}

.sketch__states-list::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.2s;
}

.sketch__states-list:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.sketch__states-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* State item */
.sketch__state-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-s);
    border-radius: 6px;
    color: var(--color-1);
    font-family: 'DM Mono', monospace;
    font-size: var(--font-size-xs);
    background: rgba(255, 255, 255, 0.02);
    overflow: visible !important;
}

.sketch__state-item.placeholder {
    color: rgba(255, 255, 255, 0.3);
    justify-content: center;
    cursor: default;
    user-select: none;
    background: transparent;
    pointer-events: none;
}

.sketch__state-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* State dropdown selector */
.sketch__state-selector {
    position: absolute;
    background: #191919;
    border: 1px solid #484848;
    border-radius: 6px;
    padding: var(--spacing-xs);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sketch__state-option {
    padding: var(--spacing-xs) var(--spacing-s);
    color: var(--color-1);
    font-family: 'DM Mono', monospace;
    font-size: var(--font-size-xs);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    background: none;
    border: none;
    width: 100%;
}

.sketch__state-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sketch__state-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sketch__state-option.disabled:hover {
    background: none;
}