/* Custom scrollbar for better space efficiency */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Quick Start Guide animations */
.step-indicator {
    transition: all 0.3s ease;
}

.step-text {
    transition: all 0.3s ease;
}

.line-through {
    text-decoration: line-through;
}

/* Checkbox tree styling */
.checkbox-tree {
    overflow-x: hidden;
    background: transparent;
    padding: 12px 0;
}

.checkbox-tree::-webkit-scrollbar {
    width: 4px;
}

.checkbox-tree::-webkit-scrollbar-track {
    background: transparent;
}

.checkbox-tree::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

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

/* Improved checkbox styling */
.checkbox-tree input[type="checkbox"] {
    cursor: pointer;
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
}

.checkbox-tree input[type="checkbox"]:hover {
    transform: scale(1.1);
    transition: transform 0.15s ease;
}

.checkbox-tree input[type="checkbox"]:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* Checkbox labels */
.checkbox-tree label {
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.15s ease;
    user-select: none;
}

.checkbox-tree label:hover {
    color: #1e40af;
}

/* Nested children with better hierarchy */
.nested-children {
    padding-left: 8px;
    margin-left: 12px;
    margin-top: 8px;
}

/* Spacing between checkbox items */
.checkbox-tree > div {
    margin-bottom: 8px;
}

.checkbox-tree > div:last-child {
    margin-bottom: 0;
}

/* Fix the first div in checkbox trees - it has too much margin-bottom */
.checkbox-tree > div:first-child {
    margin-bottom: 1.5px !important;
}

/* Entry input styling */
input[type="text"][id$="-input"] {
    transition: all 0.2s ease;
    border: 1.5px solid #e5e7eb;
    background: white;
    font-size: 0.875rem;
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
}

input[type="text"][id$="-input"]:hover {
    border-color: #9ca3af;
    background: #fafafa;
}

input[type="text"][id$="-input"]:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    background: white;
}

/* Plural instances container - transparent wrapper */
.list-items, .simple-list-items {
    background: transparent;
}

/* Item container improvements - for complex items with multiple fields */
.item-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

/* Add spacing between multiple items */
.item-container + .item-container {
    margin-top: 12px;
}

.item-container:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #94a3b8;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.12);
}

/* Item header styling */
.item-container > div:first-child {
    padding: 0 12px 8px 12px;
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
}

/* When item is collapsed (fields are hidden), remove bottom spacing */
.item-container:has(.item-fields.hidden) {
    margin-bottom: 0 !important;
    padding-bottom: 0;
}

.item-container:has(.item-fields.hidden) > div:first-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Simple item container - for string list values */
.simple-item-container {
    background: transparent;
    margin-bottom: 8px;
}

.simple-item-container input[type="text"] {
    transition: all 0.2s ease;
}

/* Create new button styling */
.create-new-btn {
    transition: all 0.2s;
    text-decoration: none;
    padding: 6px 12px;
    background: white;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.create-new-btn:hover {
    transform: translateX(2px);
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 1px 3px 0 rgba(59, 130, 246, 0.1);
}

.create-new-btn svg {
    transition: transform 0.2s ease;
}

.create-new-btn:hover svg {
    transform: rotate(90deg);
}

/* Delete item button improvements */
.delete-item-btn, .delete-simple-item-btn {
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.delete-item-btn:hover, .delete-simple-item-btn:hover {
    transform: scale(1.1);
    background: #fee2e2;
}

.toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    user-select: none;
}

.item-toggle {
    cursor: pointer;
}

.item-toggle:hover .toggle-arrow {
    color: #374151;
}

/* Device name editing styles */
.device-name-display {
    transition: color 0.2s ease;
}

.device-name-input {
    min-width: 180px;
}

/* Device URL editing styles */
.device-url-display {
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-url-input {
    min-width: 200px;
}

/* Remove device button */
.remove-device svg {
    transition: all 0.2s ease;
}

.remove-device:hover svg {
    transform: rotate(90deg);
}

/* Toggle device config button */
.toggle-device-config svg {
    transition: transform 0.3s ease;
}

.toggle-device-config svg.rotate-180 {
    transform: rotate(-180deg);
}

.device-config-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.device-config-content.hidden {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
}

/* Device card improvements */
.bg-white.rounded-lg {
    transition: box-shadow 0.2s ease;
}

.bg-white.rounded-lg:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Reduce padding when devices container is empty */
#devices-container {
    display: none;
    margin-top: 1.25rem; /* 20px - equivalent to mt-5 */
}

#devices-container:not(:empty) {
    display: block;
}
