body {
    background: #f5f5f5;
}

.drag {
    background-color: lightblue;
}

#header {
    background: #A0CFFF;
    color: #3474A8;
}

#dropzone {
    height: 450px;
    cursor: pointer;
}

#output-box {
    display: none;
}

.ace_hidden-cursors {
    opacity: 0;
}

.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
    background-color: #F5F5E7;
}

#data {
    margin-bottom: 0;
}

#data th span {
    cursor: help;
}

#data th, #data td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Query History Sidebar - Custom styles only for what Bootstrap doesn't provide */

/* Sidebar width and collapse animation */
.query-sidebar {
    width: 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: margin-left 0.3s ease;
}

.query-sidebar.collapsed {
    margin-left: -280px;
}

/* Query item cursor and hover effects */
.query-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.query-item:hover {
    background-color: #e7f3ff !important;
    border-color: #0d6efd !important;
}

.query-item:active {
    transform: scale(0.98);
}

/* Query text truncation (Bootstrap doesn't have 2-line clamp) */
.query-sql {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.query-sql code {
    background: none;
    padding: 0;
}

/* Tooltip positioning and behavior */
.query-tooltip {
    display: none;
    left: 300px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1060;
    max-width: 500px;
    max-height: 400px;
    overflow: auto;
}

.query-item:hover .query-tooltip {
    display: block;
}

.query-tooltip pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.query-tooltip code {
    background: none;
    padding: 0;
}

/* Toggle button positioning */
.sidebar-toggle {
    left: 280px;
    top: 20px;
    width: 36px;
    height: 48px;
    border-left: none;
    border-radius: 0 0.375rem 0.375rem 0;
    z-index: 1040;
    transition: left 0.3s ease;
    color: #3474A8;
}

.query-sidebar.collapsed ~ .sidebar-toggle {
    left: 0;
}

.sidebar-toggle:hover {
    background-color: #e7f3ff;
    border-color: #0d6efd;
}

.sidebar-toggle .icon-expand,
.sidebar-toggle .icon-collapse {
    display: none;
}

/* Responsive breakpoints */
@media (max-width: 991px) {
    .query-sidebar {
        width: 240px;
    }

    .query-sidebar.collapsed {
        margin-left: -240px;
    }

    .sidebar-toggle {
        left: 240px;
    }

    .query-sidebar.collapsed ~ .sidebar-toggle {
        left: 0;
    }

    .query-tooltip {
        left: 260px;
    }
}

@media (max-width: 767px) {
    .query-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        transform: translateX(-100%);
        margin-left: 0;
    }

    .query-sidebar.collapsed {
        transform: translateX(-100%);
    }

    .query-sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar-toggle {
        left: 0 !important;
    }

    .query-sidebar:not(.collapsed) ~ .sidebar-toggle {
        left: 280px !important;
    }

    /* Mobile overlay backdrop */
    .query-sidebar:not(.collapsed)::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        /* background: rgba(0, 0, 0, 0.5); */
        z-index: -1;
    }

    /* Center tooltip on mobile */
    .query-tooltip {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
    }
}
