﻿/* ==========================================================================
SQL STUDIO IDE (ALIGNED WITH HTML STUDIO CMS-TOOLBAR)
========================================================================== */
.sql-view-panel {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Table Cards */
.sql-table-card-preview {
    background: #121215;
    border: 1px solid #27272a;
    border-radius: 8px;
    padding: 14px 18px;
    width: 270px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .sql-table-card-preview:hover {
        border-color: #00f3ff;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 243, 255, 0.08);
    }


/* Column Grid */
.sql-column-grid-header {
    display: grid;
    grid-template-columns: 36px 1.4fr 1.6fr 1.2fr 1.2fr 40px;
    gap: 12px;
    padding: 10px 16px;
    background: #09090b;
    border-bottom: 1px solid #27272a;
    color: #71717a;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sql-column-grid-row {
    display: grid;
    grid-template-columns: 36px 1.4fr 1.6fr 1.2fr 1.2fr 40px;
    gap: 12px;
    padding: 8px 16px;
    background: #141417;
    border: 1px solid #27272a;
    border-radius: 6px;
    align-items: center;
}

    .sql-column-grid-row:hover {
        border-color: #3f3f46;
    }


/* Interactive ER Diagram Canvas */
#er-diagram-container {
    width: 100%;
    height: 100%;
    background-color: #09090b;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

    #er-diagram-container:active {
        cursor: grabbing;
    }


.er-node-group {
    cursor: move;
    transition: filter 0.15s;
}

    .er-node-group:hover {
        filter: drop-shadow(0 0 8px rgba(0, 255, 148, 0.3));
    }

    .er-node-group.er-selected .er-box-border {
        stroke: #00ff94 !important;
        stroke-width: 2.2px !important;
    }


.er-col-row {
    cursor: pointer;
}

    .er-col-row:hover rect {
        fill: rgba(59, 130, 246, 0.18) !important;
    }


.er-relation-path {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2px;
}

    .er-relation-path:hover {
        stroke: #00ff94;
        stroke-width: 3px;
        cursor: pointer;
    }


/* SQL Code Viewer & Syntax Highlighting */
.sql-code-viewer {
    background: #0d1117;
    border: 1px solid #27272a;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: #c9d1d9;
    overflow: auto;
    position: relative;
}

.sql-code-line {
    display: flex;
    padding: 0 12px 0 0;
    min-height: 20px;
}

    .sql-code-line:hover {
        background: rgba(255, 255, 255, 0.03);
    }


.sql-line-num {
    width: 44px;
    min-width: 44px;
    text-align: right;
    padding-right: 12px;
    color: #484f58;
    user-select: none;
    border-right: 1px solid #21262d;
    margin-right: 14px;
}

.sql-line-content {
    white-space: pre;
}

.sql-tok-kw {
    color: #ff7b72;
    font-weight: 600;
}

.sql-tok-type {
    color: #79c0ff;
}

.sql-tok-ident {
    color: #d2a8ff;
}

.sql-tok-str {
    color: #a5d6ff;
}

.sql-tok-num {
    color: #f2cc60;
}

.sql-tok-comment {
    color: #8b949e;
    font-style: italic;
}

.sql-tok-fn {
    color: #ffa657;
}

.sql-editor-overlay {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    z-index: 150;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
CUSTOM MODAL DIALOG (SQL IMPORT & PROMPTS)
========================================================================== */
.cn-custom-modal-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cn-custom-modal-dialog {
    background: #121215;
    border: 1px solid #27272a;
    border-radius: 10px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 243, 255, 0.15);
    overflow: hidden;
}
