/* Native system fonts for optimal performance and native feel */
* {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Variable Display', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

body {
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* Improve heading typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

/* Improve button typography */
button {
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Improve input typography */
input,
textarea,
select {
    font-weight: 400;
    letter-spacing: -0.005em;
}

.node-port {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    position: absolute;
    cursor: pointer;
    z-index: 10;
}

.node-port:hover {
    background: #94a3b8;
}

.node-input-port {
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
}

.node-output-port {
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
}

.tab-button {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    color: #6B7280;
}

.tab-button.active {
    border-bottom-color: #3B82F6;
    color: #1F2937;
}

.tab-pane {
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
}

.close-modal {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.delete-node {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

/* Adding spinner for loading states */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Prevent text selection while dragging */
body.dragging-connection {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Node context menu styles */
.node-context-menu {
    position: fixed;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    min-width: 160px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top left;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    display: none;
}

.node-context-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    display: block;
}

.node-context-menu-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.node-context-menu-item:hover {
    background-color: #f5f8ff;
}

.node-context-menu-item.danger {
    color: #e11d48;
}

.node-context-menu-item.danger:hover {
    background-color: #fff1f2;
}

.node-context-menu-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 6px 0;
}

/* Make ports unselectable */
.node-port {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Updated styles for click-to-connect */
.node-port {
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.node-port::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.node-port.connecting {
    background-color: #60a5fa !important;
}

.node-port.connecting::after {
    border-color: #60a5fa;
    animation: pulse-border 1.5s infinite;
}

.node-port.potential-target {
    background-color: #93c5fd;
}

.node-port.potential-target::after {
    border-color: #93c5fd;
}

.node-port.potential-target:hover {
    background-color: #60a5fa;
}

@keyframes pulse-border {
    0% {
        border-color: #60a5fa;
    }

    50% {
        border-color: transparent;
    }

    100% {
        border-color: #60a5fa;
    }
}

body.connecting {
    cursor: crosshair;
}

.node-port.proximity-target {
    background-color: rgb(68, 146, 104) !important;
    box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.5),
        0 0 0 12px rgba(96, 165, 250, 0.3),
        0 0 30px rgba(96, 165, 250, 0.8);
    position: relative;
    z-index: 1000;
}

.node-port.proximity-target::before {
    content: '';
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(96, 165, 250, 0.6) 0%,
            rgba(96, 165, 250, 0.3) 50%,
            transparent 70%);
    opacity: 1;
}

.node-port.proximity-target::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(96, 165, 250, 0.8);
    animation: expand-ring 1.5s ease-out infinite;
    transform-origin: center;
}

@keyframes expand-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Add smooth transition for workflow name highlight */
#currentWorkflowName {
    transition: background-color 0.3s ease;
}

/* Ensure modals are always on top */
.modal-overlay {
    z-index: 50;
}

/* Ensure leader lines are below everything else on canvas */
.leader-line {
    z-index: 1;
    pointer-events: none;
    /* Prevent interference with port clicks */
}

/* Target SVG elements created by LeaderLine */
svg[id^="leader-line"] {
    z-index: 1 !important;
    pointer-events: none !important;
    /* Prevent interference with port clicks */
}

/* Ensure all LeaderLine related elements are behind nodes */
svg[id*="leader-line"] {
    z-index: 1 !important;
    pointer-events: none !important;
    /* Prevent interference with port clicks */
}

/* Target any other elements that might be created by LeaderLine */
[id^="leader-line"] {
    z-index: 1 !important;
    pointer-events: none !important;
    /* Prevent interference with port clicks */
}

/* Temporarily raise z-index during connection creation */
body.connecting .leader-line {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

body.connecting svg[id^="leader-line"] {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

body.connecting svg[id*="leader-line"] {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

body.connecting [id^="leader-line"] {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

/* Also raise z-index during drag-based connection creation */
body.dragging-connection .leader-line {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

body.dragging-connection svg[id^="leader-line"] {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

body.dragging-connection svg[id*="leader-line"] {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

body.dragging-connection [id^="leader-line"] {
    z-index: 15 !important;
    pointer-events: auto !important;
    /* Re-enable pointer events during connection */
}

/* Add styles for fixed workflow tabs */
.workflow-tabs-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    /* Add subtle shadow for depth */
    z-index: 40;
    padding: 0.75rem 1rem;
}

/* Add padding to canvas container to account for larger tabs */
.canvas-container {
    padding-bottom: 80px;
}

/* Style the workflow tabs */
#workflow-tabs {
    display: flex;
    gap: 0.75rem;
    /* Increased gap for better separation */
    align-items: center;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    padding-top: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#workflow-tabs::-webkit-scrollbar {
    height: 6px;
}

#workflow-tabs::-webkit-scrollbar-track {
    background: transparent;
}

#workflow-tabs::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

#workflow-tabs button[data-workflow-id],
#workflow-tabs #newWorkflowBtn {
    border: 1px solid #e5e7eb;
    /* Add border to all buttons */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for depth */
    transition: all 0.2s ease;
    border-radius: 6px;
    /* Rounded corners for all buttons */
}

#workflow-tabs button[data-workflow-id] {
    border-bottom-width: 2px;
    /* Thicker bottom border */
}

#workflow-tabs button[data-workflow-id]:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Active workflow button styling */
#workflow-tabs button[data-workflow-id][aria-current="page"] {
    border: 1px solid #3b82f6;
    border-bottom: 2px solid #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

/* New workflow button styling */
#workflow-tabs #newWorkflowBtn {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

#workflow-tabs #newWorkflowBtn:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Tool Panel Styles - Clean and Simple */
#toolbar-tabs-container {
    background: #f3f4f6;
}

.tool-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    scrollbar-width: thin;
    background: #f3f4f6;
}

.tool-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    margin-right: 2px;
    letter-spacing: -0.01em;
    line-height: 1;
}

.tool-tab svg {
    flex-shrink: 0;
    display: block;
}

.tool-tab:hover {
    color: #4b5563;
    background-color: #f3f4f6;
}

.tool-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background-color: #ffffff;
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.tool-tab .tool-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.25rem;
}

/* Tool panels container - clean and integrated */
.tool-panels {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Tool panels - simple and clean */
.tool-panel {
    padding: 0.5rem;
    display: none;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    min-height: 50px;
    overflow-y: hidden;
    position: relative;
}

.tool-panel.active {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Style for the active tool selection */
.active-tool {
    outline: 2px solid #3B82F6;
    /* Blue outline */
    outline-offset: 1px;
    border-radius: 0.25rem;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    /* Subtle glow effect */
    position: relative;
    z-index: 5;
}

.tool-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid #e5e7eb;
    margin: 0 0.1rem;
    background: #f9fafb;
    font-size: 0.875rem;
    letter-spacing: -0.005em;
}

.tool-item:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-item.active-tool {
    background-color: #eff6ff;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.tool-item[draggable=true] {
    cursor: grab;
}

.tool-item[draggable=true]:active {
    cursor: grabbing;
}

.tool-item svg,
.tool-item img {
    width: 1rem;
    height: 1rem;
    margin-right: 0.525rem;
}

.tool-item span {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.005em;
}

/* Tool search styles */
.tool-search {
    position: relative;
    width: 240px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.tool-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid rgb(192, 194, 199);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.tool-search input:focus {
    outline: none;
    background-color: #f9fafb;
}

.tool-search svg {
    position: absolute;
    margin-left: 0.5rem;
    left: 1rem;
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    pointer-events: none;
}

/* Tool search highlight */
.tool-item.highlight {
    background-color: #ebf5ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Hide tools when filtered */
.tool-item.hidden {
    display: none;
}

/* Style for no results message */
.no-results-message {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 10;
    color: #6b7280;
    font-size: 0.875rem;
    border-radius: 0 0 8px 8px;
}

/* Canvas Styling Improvements */
#canvas {
    background-color: #ffffff;
    background-size: 20px 20px;
    background-position: -1px -1px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

/* Canvas drag hover effects - category colors */
#canvas.border-orange-500 {
    border: solid 4px #f97316 !important;
}

#canvas.bg-orange-50 {
    background-color: rgba(255, 247, 237, 0.3) !important;
}

#canvas.border-blue-500 {
    border: solid 4px #3b82f6 !important;
}

#canvas.bg-blue-50 {
    background-color: rgba(239, 246, 255, 0.3) !important;
}

#canvas.border-red-500 {
    border: solid 4px #ef4444 !important;
}

#canvas.bg-red-50 {
    background-color: rgba(254, 242, 242, 0.3) !important;
}

#canvas.border-purple-500 {
    border: solid 4px #a855f7 !important;
}

#canvas.bg-purple-50 {
    background-color: rgba(250, 245, 255, 0.3) !important;
}

#canvas.border-teal-500 {
    border: solid 4px #14b8a6 !important;
}

#canvas.bg-teal-50 {
    background-color: rgba(240, 253, 250, 0.3) !important;
}

#canvas.border-indigo-500 {
    border: solid 4px #6366f1 !important;
}

#canvas.bg-indigo-50 {
    background-color: rgba(238, 242, 255, 0.3) !important;
}

#canvas.border-yellow-500 {
    border: solid 4px #eab308 !important;
}

#canvas.bg-yellow-50 {
    background-color: rgba(254, 252, 232, 0.3) !important;
}

#canvas.border-green-500 {
    border: solid 4px #22c55e !important;
}

#canvas.bg-green-50 {
    background-color: rgba(240, 253, 244, 0.3) !important;
}

/* Initial welcome message styling */
.canvas-welcome {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Node styling improvements */
.node {
    position: absolute;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    width: 55px;
    min-height: 55px;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    z-index: 10;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    overflow: visible;
}

.node.selected {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
}

.node:hover {
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.connection-trash-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 50;
    color: #ef4444;
    transition: transform 0.2s;
}

.connection-trash-icon:hover {
    transform: scale(1.1);
    color: #dc2626;
}

.node-disabled {
    filter: grayscale(1);
    cursor: not-allowed !important;
    /* Ensure cursor indicates disabled state */
}

/* Add style for disabled context menu items */
.node-context-menu-item-disabled {
    color: #9ca3af;
    /* Gray color for text */
    cursor: not-allowed;
    /* Indicate non-interactive */
    background-color: transparent !important;
    /* Remove hover effect */
}

.node-context-menu-item-disabled:hover {
    background-color: transparent !important;
    /* Ensure no hover effect */
    color: #9ca3af !important;
    /* Keep text gray on hover */
}

.node-context-menu-item-disabled svg {
    stroke: #9ca3af !important;
    /* Gray icon */
}

/* Improved Select Dropdown Styling - Auto-size with close dropdown arrow */
select {
    /* Override fixed width classes to auto-size to content */
    width: auto !important;
    min-width: 150px;
    /* Minimum reasonable width */
    max-width: 350px;
    /* Prevent extremely wide dropdowns */

    /* Add padding to accommodate dropdown arrow without excessive width */
    padding-right: 2.5rem !important;
    /* Space for dropdown arrow */
    padding-left: 0.75rem !important;
    /* Consistent left padding */

    /* Ensure proper text truncation for very long options */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;

    /* Custom dropdown arrow styling */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;

    /* Remove browser default appearance to use our custom arrow */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Specific override for form-select class used in phone format and other components */
.form-select {
    width: auto !important;
    min-width: 200px;
    /* Slightly larger minimum for form-select */
    max-width: 400px;
}

.file-upload-container {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
}

/* Custom Tooltip Styles */
.custom-tooltip {
    position: fixed;
    background-color: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.25rem;
    max-width: 310px;
    min-width: 200px;
    z-index: 10001;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: normal;
    word-wrap: break-word;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: none;
}

.custom-tooltip.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hide default browser tooltips for tool items */
.tool-item[title] {
    position: relative;
}

.tool-item[title]:hover::after {
    content: none;
}

/* Crowded Canvas Modal Styles */
.crowded-canvas-modal {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
    /* Allow clicks to pass through to canvas */
}

.crowded-canvas-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
    pointer-events: auto;
    /* Re-enable pointer events for the content */
    border: 2px solid #e5e7eb;
}

.crowded-canvas-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.crowded-canvas-content p {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 14px;
}

.crowded-canvas-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.crowded-canvas-options button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.crowded-canvas-options button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.crowded-canvas-options button.btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.crowded-canvas-options button.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.crowded-canvas-options button.btn-secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.crowded-canvas-options button.btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.crowded-canvas-tips {
    padding: 12px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.crowded-canvas-tips small {
    color: #1e40af;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Placement Guide Styles */
.placement-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    z-index: 100;
    pointer-events: none;
}

.placement-guide-content {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    max-width: 200px;
}

.guide-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.available {
    background: #10b981;
}

.legend-color.crowded {
    background: #ef4444;
}

.available-spot-indicator {
    position: absolute;
    border: 2px solid #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    pointer-events: none;
    animation: pulseAvailable 2s infinite;
}

.occupied-spot-indicator {
    position: absolute;
    border: 2px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    pointer-events: none;
    animation: pulseOccupied 2s infinite;
}

@keyframes pulseAvailable {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes pulseOccupied {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.01);
    }
}

@keyframes pulseClickable {

    0%,
    100% {
        opacity: 0.3;
        border-color: #3b82f6;
    }

    50% {
        opacity: 0.6;
        border-color: #1d4ed8;
    }
}

/* Manual Placement Instruction Styles */
.manual-placement-instruction {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
    pointer-events: none;
    /* Don't interfere with canvas clicks */
}

.instruction-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.instruction-content small {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 8px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Prose styles for markdown content */
.prose {
    color: #374151;
    max-width: 65ch;
}

.prose h1 {
    color: #111827;
    font-weight: 800;
    font-size: 2.25rem;
    margin-top: 0;
    margin-bottom: 2rem;
    line-height: 1.111;
}

.prose h2 {
    color: #111827;
    font-weight: 700;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.333;
}

.prose h3 {
    color: #111827;
    font-weight: 600;
    font-size: 1.25rem;
    margin-top: 1.6rem;
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.prose p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose strong {
    color: #111827;
    font-weight: 600;
}

.prose ul {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose ol {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875rem;
}

.prose pre {
    color: #374151;
    background-color: #f3f4f6;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.714;
    margin-top: 1.714rem;
    margin-bottom: 1.714rem;
    border-radius: 0.375rem;
    padding: 0.857rem 1.143rem;
}

.prose pre code {
    background-color: transparent;
    border-width: 0;
    border-radius: 0;
    padding: 0;
    font-weight: 400;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

/* Apply scaling to the entire configuration content */
.etl-modal #configure-content {
    transform: scale(0.8);
    transform-origin: top left;
    width: 120%;
    height: 120%;
    overflow: auto;
}

/* Ensure the configuration panel container can handle the scaled content */
.etl-modal .w-1\/2 {
    overflow: hidden;
}

/* Node loading progression bar */
.node-loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: transparent;
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    z-index: 25;
    pointer-events: none;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.node-loading-bar.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

.node-loading-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    width: 0%;
    background: linear-gradient(90deg,
            #1d4ed8 0%,
            #2563eb 15%,
            #3b82f6 30%,
            #60a5fa 45%,
            #93c5fd 50%,
            #60a5fa 55%,
            #3b82f6 70%,
            #2563eb 85%,
            #1d4ed8 100%);
    background-size: 200% 100%;
    animation: loadingBarFlow 1.8s ease-in-out infinite;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 0 14px rgba(59, 130, 246, 1),
        0 0 24px rgba(59, 130, 246, 0.7),
        0 0 32px rgba(59, 130, 246, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    backface-visibility: hidden;
    position: relative;
    overflow: hidden;
}

/* Elegant shine effect */
.node-loading-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.6) 50%,
            transparent 100%);
    animation: loadingBarShine 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Prominent pulse on the leading edge */
.node-loading-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.7) 100%);
    filter: blur(6px);
    opacity: 1;
}

@keyframes loadingBarFlow {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes loadingBarShine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

/* Loading state indicator - subtle border pulse */
.node.loading-data {
    animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {

    0%,
    100% {
        box-shadow:
            0 2px 5px rgba(0, 0, 0, 0.1),
            0 1px 2px rgba(0, 0, 0, 0.06),
            0 0 0 0 rgba(59, 130, 246, 0);
    }

    50% {
        box-shadow:
            0 2px 5px rgba(0, 0, 0, 0.1),
            0 1px 2px rgba(0, 0, 0, 0.06),
            0 0 0 3px rgba(59, 130, 246, 0.2);
    }
}

/* Canvas node creation feedback styles */
.node.creation-feedback {
    position: relative;
    z-index: 15;
    /* Temporarily disable grayscale filter during creation feedback */
    filter: none !important;
}

.node.creation-feedback::before {
    content: '';
    position: absolute;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    border: 4px solid #3b82f6 !important;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1) !important;
    animation: nodeCreationPulse 1.1s ease-out;
    pointer-events: none;
    z-index: -1;
}

/* Ensure creation feedback overrides disabled node styling */
.node.node-disabled.creation-feedback {
    /* Override the grayscale filter temporarily */
    filter: none !important;
}

.node.node-disabled.creation-feedback::before {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

@keyframes nodeCreationPulse {
    0% {
        border-width: 0px;
        opacity: 0;
        transform: scale(0.8);
    }

    20% {
        border-width: 4px;
        opacity: 1;
        transform: scale(1.05);
    }

    80% {
        border-width: 4px;
        opacity: 0.8;
        transform: scale(1);
    }

    100% {
        border-width: 4px;
        opacity: 0;
        transform: scale(1);
    }
}

/* Login Modal Styles */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.login-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.login-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1rem;
    background: rgba(30, 58, 138, 0.1);
    backdrop-filter: blur(10px);
}

@media (min-width: 640px) {
    .header {
        padding: 1rem 2rem;
    }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

@media (min-width: 640px) {
    .logo {
        font-size: 1.4rem;
    }
}