/* Custom styles for Category Tree Builder */

/* Panel Cards */
.panel-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
    padding: 1.5rem;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 44px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: #64748b;
}

.search-input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.search-clear {
    position: absolute;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
    border: none;
}

.search-clear:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.5);
}

.search-clear.hidden {
    display: none;
}

/* Search highlight */
.search-hidden {
    display: none !important;
}

.search-match .category-name,
.search-match .item-name {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.3), rgba(20, 184, 166, 0.1));
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
}

/* Attribute Button */
.attr-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-right: 4px;
}

.attr-btn:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.attr-btn.has-attributes {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.6);
}

.attr-btn.has-attributes::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #a855f7;
    border-radius: 50%;
}

/* Attribute Panel */
.attribute-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    border-left: 1px solid rgba(51, 65, 85, 0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.attribute-panel.visible {
    transform: translateX(0);
}

.attribute-panel.hidden {
    transform: translateX(100%);
}

.attribute-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    background: rgba(15, 23, 42, 0.5);
}

.attribute-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Attributes List */
.attributes-list {
    margin-bottom: 24px;
}

.attribute-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.attribute-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.attribute-name {
    font-weight: 600;
    color: #a855f7;
    font-size: 14px;
}

.attribute-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.attribute-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.attribute-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attribute-value-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: #c4b5fd;
}

.attribute-value-tag button {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #a855f7;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.attribute-value-tag button:hover {
    background: rgba(168, 85, 247, 0.3);
    color: white;
}

/* Add Attribute Section */
.add-attribute-section {
    background: rgba(168, 85, 247, 0.05);
    border: 1px dashed rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 16px;
}

.attribute-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
}

.attribute-input::placeholder {
    color: #64748b;
}

.attribute-input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.btn-add-attribute {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 10px;
    color: #a855f7;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-attribute:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.2));
    border-color: rgba(168, 85, 247, 0.6);
}

/* Overlay */
.attribute-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.attribute-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.attribute-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Empty attributes state */
.no-attributes {
    text-align: center;
    padding: 30px 20px;
    color: #64748b;
}

.no-attributes svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

/* Add value inline form */
.add-value-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.add-value-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
}

.add-value-input:focus {
    outline: none;
    border-color: #a855f7;
}

.add-value-btn {
    padding: 8px 12px;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    color: #a855f7;
    cursor: pointer;
    transition: all 0.2s;
}

.add-value-btn:hover {
    background: rgba(168, 85, 247, 0.3);
}

/* Assign Items Panel */
.assign-items-section {
    background: rgba(20, 184, 166, 0.05);
    border: 1px dashed rgba(20, 184, 166, 0.3);
    border-radius: 12px;
    padding: 16px;
}

.assigned-items-list {
    min-height: 60px;
}

.assigned-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.05));
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.assigned-item:hover {
    border-color: rgba(20, 184, 166, 0.5);
}

.assigned-item-name {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 14px;
}

.assigned-item-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.assigned-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.available-items-list {
    max-height: 300px;
    overflow-y: auto;
}

.available-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.available-item:has(.item-checkbox:checked) {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.5);
}

.available-item:hover {
    border-color: rgba(20, 184, 166, 0.5);
    background: rgba(20, 184, 166, 0.1);
}

.available-item.already-assigned {
    opacity: 0.5;
    pointer-events: none;
}

.available-item-name {
    flex: 1;
    color: #e2e8f0;
    font-size: 14px;
}

/* Checkbox styles */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-right: 10px;
    z-index: 1;
}

.item-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid #94a3b8;
    border-radius: 4px;
    background: #1e293b;
    transition: all 0.2s;
    position: relative;
    display: block;
    flex-shrink: 0;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.item-checkbox:checked + .checkbox-custom {
    background: rgba(20, 184, 166, 0.3);
    border-color: #14b8a6;
}

.item-checkbox:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid #14b8a6;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.item-checkbox:disabled + .checkbox-custom {
    opacity: 0.3;
    cursor: not-allowed;
}

.checkbox-label:hover .checkbox-custom {
    border-color: rgba(20, 184, 166, 0.7);
}

/* Selected category display */
.selected-category-display {
    padding: 10px 14px;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Bulk move button */
.btn-bulk-move {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.1));
    border: 1px solid rgba(20, 184, 166, 0.4);
    border-radius: 10px;
    color: #14b8a6;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-bulk-move:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(20, 184, 166, 0.2));
    border-color: rgba(20, 184, 166, 0.6);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.2);
}

.btn-bulk-move:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Selectable category in tree */
.tree-item.selectable-category {
    cursor: pointer;
}

.tree-item.selectable-category > .tree-item-content {
    transition: all 0.2s;
}

.tree-item.selectable-category:hover > .tree-item-content {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.3);
    transform: translateX(4px);
}

.tree-item.selected-for-bulk-move > .tree-item-content {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.3), rgba(20, 184, 166, 0.15));
    border-color: #14b8a6;
    box-shadow: 0 0 25px rgba(20, 184, 166, 0.4);
}

.tree-item.selected-for-source-bulk-move > .tree-item-content {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.3), rgba(249, 115, 22, 0.15));
    border-color: #f97316;
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.4);
}

.available-item-add {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.2);
    border: 1px solid rgba(20, 184, 166, 0.4);
    color: #14b8a6;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.available-item-add:hover {
    background: rgba(20, 184, 166, 0.3);
    border-color: rgba(20, 184, 166, 0.6);
}

.no-assigned-items {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 14px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
    border: 1px dashed rgba(51, 65, 85, 0.5);
}

/* Assign button on tree items */
.assign-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #14b8a6;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-right: 4px;
    position: relative;
}

.assign-btn:hover {
    background: rgba(20, 184, 166, 0.25);
    border-color: rgba(20, 184, 166, 0.5);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.2);
}

.assign-btn .assign-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #14b8a6;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    padding: 0 5px;
}

.assign-btn .assign-count:empty {
    display: none;
}

/* Category Items */
.category-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    @apply bg-midnight/60 rounded-xl border border-slate-medium/50 
           cursor-grab transition-all duration-200 group mb-2;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}

.category-item:has(.item-checkbox:checked) {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.5);
}

.category-item:hover {
    @apply border-coral/50 bg-midnight/80;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.1);
}

.category-item.sortable-ghost {
    @apply opacity-40;
}

.category-item.sortable-chosen {
    @apply border-coral bg-midnight shadow-lg;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.2);
}

.category-item.sortable-drag {
    @apply opacity-100;
}

.category-item .drag-handle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    @apply text-gray-500 group-hover:text-coral transition-colors cursor-grab;
}

.category-item .category-name {
    flex: 1;
    padding: 12px 8px;
    @apply font-medium text-gray-200;
}

.category-item .delete-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    @apply text-gray-500 hover:text-red-400 transition-all hover:bg-red-500/10 rounded-lg;
}

/* Tree Items */
.tree-item {
    @apply mb-2;
}

.tree-item-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    @apply rounded-xl border cursor-grab transition-all duration-200 group;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.1), transparent);
    border-color: rgba(20, 184, 166, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}

.tree-item-content:hover {
    box-shadow: 0 0 25px rgba(20, 184, 166, 0.15);
    transform: translateX(2px);
}

.tree-item[data-depth="0"] > .tree-item-content:hover {
    border-color: rgba(20, 184, 166, 0.6);
}

.tree-item[data-depth="1"] > .tree-item-content:hover {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.15);
}

.tree-item[data-depth="2"] > .tree-item-content:hover {
    border-color: rgba(249, 115, 22, 0.6);
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.15);
}

.tree-item[data-depth="3"] > .tree-item-content:hover {
    border-color: rgba(236, 72, 153, 0.6);
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.15);
}

.tree-item-content.sortable-ghost {
    @apply opacity-40;
}

.tree-item-content.sortable-chosen {
    @apply border-teal shadow-lg;
    box-shadow: 0 10px 30px rgba(20, 184, 166, 0.2);
}

.tree-item .drag-handle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    @apply text-teal/60 group-hover:text-teal transition-colors cursor-grab;
}

.tree-item .item-number {
    @apply font-mono font-bold text-sm px-2.5 py-1 rounded-lg min-w-[2.5rem] text-center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.1));
    color: #2dd4bf;
    border: 1px solid rgba(20, 184, 166, 0.3);
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Different colors for different depths */
.tree-item[data-depth="1"] .item-number {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.tree-item[data-depth="2"] .item-number {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.1));
    color: #fb923c;
    border-color: rgba(249, 115, 22, 0.3);
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.tree-item[data-depth="3"] .item-number {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.1));
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.3);
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.tree-item .item-name {
    padding: 12px 8px;
    @apply font-medium text-gray-200;
    white-space: nowrap;
}

.tree-item .item-attrs {
    flex: 1;
    padding: 12px 8px 12px 0;
    font-size: 13px;
    color: #a855f7;
    font-style: italic;
    opacity: 0.8;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Spacer to push actions to the right when no attrs */
.tree-item .item-spacer {
    flex: 1;
}

/* Custom category badge */
.custom-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3), rgba(249, 115, 22, 0.15));
    border: 1px solid rgba(249, 115, 22, 0.5);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fb923c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Custom category styling */
.tree-item.is-custom > .tree-item-content {
    border-left: 3px solid #f97316;
}

/* Original category indicator (subtle) */
.tree-item.is-original > .tree-item-content {
    border-left: 3px solid transparent;
}

.tree-item .item-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tree-item .action-btn {
    @apply transition-all;
}

.tree-item .remove-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    @apply text-gray-500 hover:text-coral hover:bg-coral/10 rounded-lg;
}

/* Nested list styling */
.nested-list {
    @apply mt-2 min-h-[8px];
    margin-left: 2rem;
    border-left: 3px solid rgba(20, 184, 166, 0.3);
    position: relative;
}

.nested-list::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, rgba(20, 184, 166, 0.5), rgba(20, 184, 166, 0.1));
}

.nested-list:empty {
    @apply min-h-[50px] rounded-r-lg;
    border-left-style: dashed;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.08), transparent);
}

.nested-list.sortable-ghost {
    @apply bg-teal/10;
}

/* Deeper nesting levels */
.nested-list .nested-list {
    border-left-color: rgba(168, 85, 247, 0.3);
}

.nested-list .nested-list::before {
    background: linear-gradient(to bottom, rgba(168, 85, 247, 0.5), rgba(168, 85, 247, 0.1));
}

.nested-list .nested-list .nested-list {
    border-left-color: rgba(249, 115, 22, 0.3);
}

.nested-list .nested-list .nested-list::before {
    background: linear-gradient(to bottom, rgba(249, 115, 22, 0.5), rgba(249, 115, 22, 0.1));
}

/* Category List */
.category-list {
    @apply space-y-0;
}

/* Tree Container */
.tree-container {
    @apply relative;
}

/* Empty State */
.empty-state {
    @apply flex flex-col items-center justify-center py-16 text-center;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #f97316, #fb923c);
    color: white;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.25);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    font-weight: 500;
    border-radius: 0.75rem;
    border: 1px solid rgba(51, 65, 85, 1);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 1);
}

.btn-secondary:active {
    transform: scale(0.95);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-weight: 500;
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-danger:active {
    transform: scale(0.95);
}

.btn-reset {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    font-weight: 500;
    border-radius: 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-reset:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-reset:active {
    transform: scale(0.95);
}

/* Add to Tree Button */
.add-to-tree-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.05));
    border: 2px dashed rgba(20, 184, 166, 0.4);
    border-radius: 12px;
    color: #14b8a6;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-to-tree-btn:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.1));
    border-color: rgba(20, 184, 166, 0.6);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.15);
}

.add-to-tree-btn:active {
    transform: scale(0.98);
}

.add-to-tree-btn.hidden {
    display: none;
}

.btn-success {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(20, 184, 166, 0.2);
    color: #14b8a6;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 184, 166, 0.3);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-success:hover {
    background: rgba(20, 184, 166, 0.3);
}

.btn-success:active {
    transform: scale(0.95);
}

.btn-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(51, 65, 85, 0.5);
    color: #9ca3af;
    border-radius: 0.75rem;
    border: 1px solid rgba(51, 65, 85, 1);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-cancel:hover {
    background: rgba(51, 65, 85, 1);
    color: #e5e7eb;
}

.btn-cancel:active {
    transform: scale(0.95);
}

/* Modal */
.modal {
    @apply fixed inset-0 z-50 flex items-center justify-center p-4;
}

.modal.hidden {
    @apply hidden;
}

.modal-backdrop {
    @apply absolute inset-0 bg-midnight/80 backdrop-blur-sm;
}

.modal-content {
    @apply relative bg-slate-dark rounded-2xl border border-slate-medium/50 
           shadow-2xl w-full max-w-lg overflow-hidden;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    @apply flex items-center justify-between p-6 border-b border-slate-medium/50;
}

.modal-body {
    @apply p-6;
}

.modal-footer {
    @apply p-6 pt-0;
}

/* Toast */
.toast {
    @apply fixed bottom-6 right-6 px-6 py-3 bg-teal text-white font-medium 
           rounded-xl shadow-2xl shadow-teal/30 z-50;
    animation: toastIn 0.3s ease-out;
}

.toast.hidden {
    @apply hidden;
}

/* Save Indicator */
.save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9));
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.save-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator svg {
    width: 16px;
    height: 16px;
}

/* Save to File Button */
.save-file-btn,
.load-file-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.save-file-btn:hover,
.load-file-btn:hover {
    background: rgba(71, 85, 105, 0.8);
    color: #e2e8f0;
    border-color: rgba(100, 116, 139, 0.5);
}

.save-file-btn.has-changes {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.1));
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
    animation: pulse-save 2s infinite;
}

.save-file-btn.has-changes:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(22, 163, 74, 0.2));
}

.load-file-btn {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
    color: #2dd4bf;
}

.load-file-btn:hover {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.5);
    color: #5eead4;
}

@keyframes pulse-save {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    @apply bg-transparent;
}

::-webkit-scrollbar-thumb {
    @apply bg-slate-medium rounded-full;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-slate-medium/80;
}

/* Drop zone highlight */
.sortable-fallback {
    @apply opacity-100 !important;
}

/* Prevent text selection during drag */
.category-list,
.tree-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Active dragging state */
.category-item:active,
.tree-item-content:active {
    cursor: grabbing;
}

/* Ensure drag handle visual stays */
.category-item .drag-handle,
.tree-item .drag-handle {
    cursor: grab;
    flex-shrink: 0;
}

.category-item:active .drag-handle,
.tree-item-content:active .drag-handle {
    cursor: grabbing;
}

/* Nested indicator animation */
.nested-list.drag-over {
    @apply bg-teal/10 border-teal/50;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Tree depth indicators */
.tree-item[data-depth="0"] > .tree-item-content {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.02));
    border-color: rgba(20, 184, 166, 0.4);
}

.tree-item[data-depth="1"] > .tree-item-content {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.02));
    border-color: rgba(168, 85, 247, 0.35);
}

.tree-item[data-depth="2"] > .tree-item-content {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.12), rgba(249, 115, 22, 0.02));
    border-color: rgba(249, 115, 22, 0.35);
}

.tree-item[data-depth="3"] > .tree-item-content {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.12), rgba(236, 72, 153, 0.02));
    border-color: rgba(236, 72, 153, 0.35);
}

/* Collapse/Expand button */
.collapse-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
    @apply rounded-lg bg-slate-medium/50 hover:bg-slate-medium transition-all text-gray-400 hover:text-white;
}

.collapse-btn.collapsed svg {
    transform: rotate(-90deg);
}

.collapse-btn svg {
    @apply transition-transform duration-200;
}

/* Scroll to top button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.9), rgba(20, 184, 166, 0.7));
    border: 1px solid rgba(20, 184, 166, 0.5);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.3);
}

.scroll-to-top-btn:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 1), rgba(20, 184, 166, 0.9));
    border-color: rgba(20, 184, 166, 0.8);
    box-shadow: 0 6px 30px rgba(20, 184, 166, 0.4);
    transform: translateY(-2px);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

.scroll-to-top-btn.hidden {
    display: none;
}

