/* Editor Styles */
.CodeMirror {
    height: 600px;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
}

/* Ad Placeholder Styles */
.ad-placeholder {
    background-color: rgba(var(--bs-secondary-rgb), 0.1);
    border-color: var(--bs-secondary) !important;
    color: var(--bs-secondary);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Output Styles */
#outputContainer {
    min-height: 400px;
    max-height: 800px;
    overflow-y: auto;
}

#markdownOutput {
    padding: 1rem;
    display: none;
}

/* Diagram Container Styles */
#diagramOutput {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    display: none;
}

.diagram-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.svg-container {

/* Query Results container */
#queryResults {
    border: 1px solid var(--bs-white);
    border-radius: 4px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

#queryResults .table-responsive {
    margin-bottom: 0;
}

    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-container svg {
    width: 100%;
    height: 100%;
    cursor: move;
    transform-origin: center;
    transition: transform 0.1s ease-out;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bs-dark);
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.zoom-controls button {
    margin: 0 5px;
}

/* Data Output Styles */
.data-controls {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

#fakeDataOutput {
    background-color: var(--bs-dark);
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--bs-border-color);
    max-height: 600px;
    overflow-y: auto;
    display: none;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin-top: -1rem;
    margin-left: -1rem;
    border: 4px solid var(--bs-border-color);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

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

/* Additional loading states for buttons */
button.loading {
    position: relative;
    padding-right: 2.5rem;
}

button.loading::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid var(--bs-border-color);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

/* Table Styles */
#markdownOutput table {
    width: 100%;
    margin-bottom: 1rem;
}

#markdownOutput th,
#markdownOutput td {
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color);
}
/* Ensure footer stays at bottom */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container-fluid {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* CodeMirror editor customization */
.CodeMirror {
    height: 600px !important;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #444;
    border-radius: 4px;
}

/* Other styling for the application */
.diagram-container {
    overflow: auto;
    max-width: 100%;
}

#diagramOutput svg {
    max-width: 100%;
}

#fakeDataOutput {
    max-height: 600px;
    overflow: auto;
    white-space: pre-wrap;
    background-color: #272822;
    color: #f8f8f2;
    padding: 10px;
    border-radius: 4px;
}
