/* Datasource Designer Page Styles */

/* Main Container */
.udm-datasource-designer {
    height: 100%;
    overflow: hidden;
}

.designer-toolbar {
    height: 50px;
    background: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

/* Settings Sidebar */
.udm-datasource-settings-sidebar {
    background: #f8f9fa;
    border-left: 1px solid var(--bs-border-color);
    height: 100%;
    overflow: auto;
}

/* Bottom Panel */
.designer-bottom-panel {
    border-top: 2px solid var(--bs-primary);
    background: white;
    transition: height 0.3s ease;
}

.bottom-panel-header {
    height: 40px;
    background: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    cursor: pointer;
    user-select: none;
}

.bottom-panel-header:hover {
    background: var(--bs-primary-dark);
}

/* Main Tabs */
.designer-main-tabs {
    display: flex;
    flex-direction: column;
}

.tab-content {
    overflow: auto;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

/* Diagram Styles */
.diagram-container {
    position: relative;
    background: #f8f9fa;
    overflow-y: auto;
}

.datasource-structure {
    max-width: 1200px;
}

.diagram-node {
    border: 2px solid;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.diagram-node:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.diagram-node.base-node {
    border-color: #28a745;
}

.diagram-node.join-node {
    border-color: #ffc107;
}

.diagram-node .node-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1rem;
}

.diagram-node.base-node .node-header {
    background: rgba(40, 167, 69, 0.1);
}

.diagram-node.join-node .node-header {
    background: rgba(255, 193, 7, 0.1);
}

.diagram-node .node-body {
    padding: 0.75rem;
}

.columns-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.column-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.25rem;
    border-radius: 4px;
}

.column-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.column-name {
    font-weight: 500;
}

.column-type {
    font-size: 0.75rem;
}

/* Entity Sidebar */
.entity-sidebar {
    background: white;
}

.entity-list-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.entity-list {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.entity-item {
    transition: all 0.2s;
}

.entity-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    border-color: #007bff !important;
}

.entity-count {
    font-style: italic;
}

.joins-section {
    border-top: 2px solid var(--bs-border-color);
    padding-top: 1rem;
}

/* Grouped List with Sticky Headers */
.items-list-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.items-list-grouped {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sticky Subsystem Header */
.subsystem-header-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subsystem-header-sticky .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Item Cards */
.item-card {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
}

.item-card:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.item-card .fw-bold {
    font-size: 0.875rem;
    color: #212529;
}

.item-card small {
    font-size: 0.75rem;
    color: #6c757d;
}

.item-card i.fa-plus {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.item-card:hover i.fa-plus {
    opacity: 1;
}
