/* Theme Variables */
.theme-dark {
    --bg-primary: #2c3034;
    --bg-secondary: #252526;
    --bg-tertiary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #404040;
    --nav-bg: #1e1e1e;
    --nav-text: #ffffff;
    --tab-active-bg: #2c3034;
    --tab-active-text: #ffffff;
    --tab-hover-bg: #252526;
    --node-bg: #3c3c3c;
    --node-header: #4a4a4a;
    --node-border: #555555;
    --socket-bg: #666666;
    --socket-hover: #888888;
    --border-color-rgb: 64, 64, 64;
    --socket-border: #777777;
}

.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #dee2e6;
    --nav-bg: #ffffff;
    --nav-text: #000000;
    --tab-active-bg: #ffffff;
    --tab-active-text: #000000;
    --tab-hover-bg: #e9ecef;
    --node-bg: #f8f9fa;
    --node-header: #e9ecef;
    --node-border: #dee2e6;
    --socket-bg: #adb5bd;
    --socket-hover: #6c757d;
    --border-color-rgb: 222, 226, 230;
    --socket-border: #6c757d;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.content-wrapper {
    display: flex;
    height: 100vh;
    padding-top: 56px; /* Height of navbar */
}

/* Navbar */
.navbar {
    background-color: var(--nav-bg);
}

.navbar-brand, .nav-link {
    color: var(--nav-text) !important;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    flex-shrink: 0;
}

.sidebar-content {
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.sidebar-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sidebar-item:hover {
    background-color: var(--bg-tertiary);
}

.sidebar-item i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Node Palette */
.node-palette {
    display: flex;
    flex-direction: column;
}

.node-palette-header {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.node-palette-header i {
    margin-right: 0.75rem;
}

.node-categories {
    padding: 0.5rem;
}

.node-category {
    margin-bottom: 1rem;
}

.node-category-title {
    font-weight: 500;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.node-category-items {
    padding: 0 0.5rem;
}

.node-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: grab;
    transition: all 0.2s ease;
}

.node-item:hover {
    background-color: var(--bg-tertiary);
    transform: translateX(4px);
}

/* Node Editor */
.node-editor {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--bg-primary);
    background-image: 
        linear-gradient(to right, rgba(var(--border-color-rgb), 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(var(--border-color-rgb), 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
    cursor: default;
    flex: 1;
    display: flex;
}

.node-editor.drag-over {
    outline: 2px dashed var(--border-color);
    outline-offset: -2px;
}

.node-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
}

/* Node Styling */
.node {
    position: absolute;
    min-width: 200px;
    background-color: var(--node-bg);
    border: 2px solid var(--node-border);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    user-select: none;
    z-index: 1;
    transition: border-color 0.2s ease;
    overflow: visible;
}

.node.selected {
    outline: 2px solid #fff;
    outline-offset: 10px;
    z-index: 3;
}

.node-header {
    padding: 0.75rem 1rem;
    background-color: var(--node-header);
    border-bottom: 1px solid var(--node-border);
    border-radius: 8px 8px 0 0;
    cursor: move;
}

.node-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.node-content {
    padding: 0.5rem;
}

.node-sockets {
    display: flex;
    flex-direction: column;
    padding-top: 0.5rem;
    gap: 0.5rem;
}

/* Socket Styling */
.socket {
    display: flex;
    align-items: center;
    padding: 0.25rem;
    position: relative;
}

.socket.input {
    padding-left: 1rem;
}

.socket.output {
    padding-right: 1rem;
    justify-content: flex-end;
}

.socket-dot {
    width: 12px;
    height: 12px;
    background-color: var(--socket-color);
    border: 2px solid var(--socket-color);
    border-radius: 50%;
    cursor: crosshair;
    position: absolute;
    transition: all 0.2s ease;
}

.socket.input .socket-dot {
    left: -6px;
}

.socket.output .socket-dot {
    right: -6px;
}

.socket-dot:hover, .socket-dot.connecting {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.socket-label {
    font-size: 0.9rem;
    margin: 0 0.5rem;
    color: var(--text-primary);
}

.socket-input {
    width: 60px;
    padding: 0.2rem 0.4rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Connection Lines */
.connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.connection {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.connection.permanent {
    z-index: 0;
}

.connection path {
    fill: none;
    stroke: var(--socket-color, #4CAF50);
    stroke-width: 2px;
    pointer-events: none;
}

.connection-path {
    fill: none;
    stroke: var(--socket-color, #4CAF50);
    stroke-width: 2px;
    transition: stroke 0.2s ease;
    pointer-events: none;
}

.connection.active path {
    stroke: var(--socket-hover);
    stroke-width: 3px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.nav-tabs {
    padding: 0.5rem 1rem 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    margin-right: 4px;
}

.nav-tabs .nav-link:hover {
    background-color: var(--tab-hover-bg);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background-color: var(--tab-active-bg);
    color: var(--tab-active-text);
    border-color: var(--border-color);
    border-bottom-color: transparent;
}

.tab-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.tab-pane {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Status in navbar */
#status {
    margin: 0;
    font-size: 0.9rem;
}

#status.connected {
    background-color: #198754;
    color: white;
}

#status.disconnected {
    background-color: #dc3545;
    color: white;
}

/* Dropdown menus */
.dropdown-menu {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

/* Modal styling */
.modal-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.form-select, .form-control {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.form-select:focus, .form-control:focus {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Flow Connection Styling */
.flow-connections {
    position: relative;
    left: 0;
    right: 0;
    height: 32px;
    display: flex;
    justify-content: stretch;
    align-items: center;
    margin: 4px 0;
    border-bottom: 1px solid var(--node-border);
    overflow: visible;
}

.flow-dot {
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: crosshair;
    transition: all 0.2s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-70%);
}

.flow-dot:hover, .flow-dot.connecting {
    transform: translateY(-70%) scale(1.2);
    filter: brightness(1.2);
}

.flow-dot.input {
    left: -18px;
}

.flow-dot.output {
    right: -18px;
}

/* Make flow connections visually distinct */
.connection.flow path {
    stroke: #ffffff;
    stroke-width: 3px;
}

.connection-path.flow {
    stroke: #ffffff !important;
    stroke-width: 3px !important;
    pointer-events: none;
}

.connection-path.flow.active {
    stroke: #ffffff !important;
    stroke-width: 4px !important;
    pointer-events: none;
} 