body {
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-attachment: fixed;
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    margin: 20px;
    color: #000;
    margin-bottom: 40px;
}

.window {
    background-color: #dfdfdf;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    padding: 2px;
    max-width: 1000px;
    margin: 0 auto;
}

.title-bar {
    background: #000080;
    padding: 3px 2px 3px 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-text {
    color: white;
    font-weight: bold;
    letter-spacing: 0;
    margin-right: 24px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    border: 1px solid #fff;
    background: silver;
    position: relative;
    display: block;
    padding: 0;
}

.title-bar-controls button:active {
    padding: 0;
    box-shadow: none;
}

.title-bar-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

.content {
    padding: 10px;
    background-color: #ffffff;
    border: 1px solid #808080;
    box-sizing: border-box;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
    border: 1px solid #808080;
}

th, td {
    border: 1px solid #808080;
    padding: 4px 8px;
    text-align: left;
    font-size: 12px;
}

th {
    background-color: #dfdfdf;
    font-weight: bold;
}

button {
    background-color: #dfdfdf;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 4px 10px;
    margin: 2px;
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    font-size: 11px;
    cursor: pointer;
}

button:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.file-input {
    margin: 10px 0;
}

/* SQL Editor Styles */
.query-editor {
    position: relative;
    margin-bottom: 10px;
}

#queryInput {
    width: 100% !important;
    height: 150px;
    box-sizing: border-box;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    background-color: #ffffff !important;
    color: #000000 !important;
    resize: vertical;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Remove ALL syntax highlighting related styles */
.query-editor pre {
    display: none;
}

/* Customize Prism.js theme */
/* .token.comment { color: #008000 !important; }
.token.keyword { color: #000080 !important; }
.token.string { color: #800000 !important; }
.token.number { color: #0000ff !important; }
.token.operator { color: #666666 !important; }
.token.function { color: #800080 !important; }
.token.punctuation { color: #000000 !important; } */

/* Ensure the textarea and highlighting are perfectly aligned */
/* .query-editor pre,
#queryInput {
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
    tab-size: 4;
    -moz-tab-size: 4;
} */

/* Ensure proper height for the container */
.query-editor {
    height: 150px;
}

/* Hide Prism.js line numbers */
.line-numbers .line-numbers-rows {
    display: none;
}

/* Line numbers */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #808080;
    padding: 0 5px;
}

#tables {
    background: silver;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 8px;
    margin: 8px 0;
}

#tables h4 {
    margin: 0 0 8px 0;
    padding: 2px 4px;
    background: #dfdfdf;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    color: #000;
    font-size: 11px;
    font-weight: bold;
}

#tables button {
    min-width: 100px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-item {
    border-right: 1px solid #808080;
    padding: 0 8px;
}

.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Add hover effects */
button:not(:disabled):hover {
    background-color: #e8e8e8;
}

.title-bar-button:hover {
    background-color: #e8e8e8;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #dfdfdf;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

::-webkit-scrollbar-corner {
    background: #dfdfdf;
}

.toolbar {
    background: #dfdfdf;
    border-bottom: 1px solid #808080;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.toolbar button {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-icon {
    width: 16px;
    height: 16px;
}

.query-tabs {
    display: flex;
    gap: 0;
    padding: 4px 4px 0 4px;
    background: silver;
    border-bottom: 1px solid #000;
}

.query-tab {
    padding: 3px 6px;
    border: 1px solid #000;
    border-bottom: none;
    background: silver;
    cursor: pointer;
    margin-right: 2px;
    position: relative;
    top: 1px;
}

.query-tab.active {
    background: #e9e9e9;
    border-bottom: 1px solid #c0c0c0;
    z-index: 1;
}

.query-tab:not(.active):hover {
    background: #dfdfdf;
}

.results-grid {
    border: 1px solid #808080;
    height: 300px;
    overflow: auto;
    margin-top: 10px;
}

.tab-content {
    padding: 10px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.generator-form {
    background: #ffffff;
    padding: 10px;
    border: 1px solid #808080;
}

.form-group {
    margin-bottom: 10px;
}

.column-group {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    align-items: center;
}

.column-group input[type="text"] {
    padding: 2px 4px;
    border: 1px solid #808080;
}

.column-group select {
    padding: 1px;
    border: 1px solid #808080;
}

.remove-column {
    padding: 0 6px;
    font-size: 14px;
}

.helper-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.helper-section {
    background: #ffffff;
    padding: 10px;
    border: 1px solid #808080;
}

.helper-btn {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 5px;
    text-align: left;
}

.helper-btn:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 4px 8px;
    background: #ffffc8;
    border: 1px solid #000000;
    color: #000000;
    font-size: 11px;
    white-space: pre-wrap;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.version {
    color: #808080;
    margin-top: 20px;
    font-size: 11px;
}

label {
    font-size: 11px;
}

input[type="text"], select {
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

/* Add these styles */
.separator {
    border: none;
    border-top: 1px solid #808080;
    margin: 15px 0;
}

.generator-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.population-templates {
    margin: 10px 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.population-options {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.data-template-btn {
    padding: 2px 8px;
    font-size: 11px;
}

input[type="number"] {
    width: 80px;
    padding: 2px 4px;
    border: 1px solid #808080;
}

/* Add Clippy styles */
.clippy-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.clippy-icon {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.clippy-icon:hover {
    transform: scale(1.1);
}

.clippy-bubble {
    position: absolute;
    bottom: 110px;
    right: 0;
    background: #ffffc8;
    border: 1px solid #000000;
    padding: 10px;
    border-radius: 8px;
    width: 250px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: bubble-pop 0.3s ease-out;
}

.clippy-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #ffffc8 transparent;
}

.clippy-bubble::before {
    content: '';
    position: absolute;
    bottom: -11px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #000000 transparent;
}

.clippy-text {
    margin: 0 0 10px 0;
    font-size: 12px;
    line-height: 1.4;
}

.clippy-next, .clippy-close {
    padding: 2px 8px;
    font-size: 11px;
    float: right;
    margin-left: 5px;
}

.hidden {
    display: none;
}

/* Info Panel Styles */
.info-panel {
    background: #f0f0f0;
    border: 1px solid #808080;
    padding: 8px;
    margin-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
}

.info-label {
    font-weight: bold;
    color: #000080;
}

/* Query Section Enhancements */
.query-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

#queryHistory {
    flex-grow: 1;
}

/* Results Section Enhancements */
.results-container {
    border: 1px solid #808080;
    margin-top: 10px;
    overflow-x: auto;
}

.results-header {
    background: #dfdfdf;
    padding: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #808080;
}

.results-stats {
    display: flex;
    gap: 15px;
    font-size: 11px;
}

.results-actions {
    display: flex;
    gap: 5px;
}

/* Table Details Styles */
#table-details {
    background: silver;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 8px;
    margin-top: 8px;
}

#table-details h4 {
    margin: 0 0 8px 0;
    padding: 2px 4px;
    background: #000080;
    color: white;
    font-size: 11px;
    font-weight: normal;
}

.table-info {
    background: white;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 4px;
    margin-bottom: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px;
    font-size: 11px;
}

.info-item:not(:last-child) {
    border-bottom: 1px solid #dfdfdf;
}

.info-label {
    color: #000080;
    font-weight: bold;
}

#column-list {
    background: white;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 4px;
}

.column-info {
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    margin-bottom: 2px;
}

.column-constraints {
    color: #666666;
    font-style: italic;
}

/* Add to your existing Clippy styles */
@keyframes clippy-wave {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

.clippy-attention {
    animation: clippy-wave 0.5s ease-in-out 2;
}

@keyframes bubble-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Taskbar styles */
.taskbar {
    height: 28px;
    background: silver;
    border-top: 1px solid #fff;
    display: flex;
    align-items: center;
    padding: 2px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

.start-button {
    display: flex;
    align-items: center;
    padding: 2px 6px;
    margin-right: 2px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff;
}

.start-button:active {
    box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a;
}

.taskbar-divider {
    width: 1px;
    height: 20px;
    background: #888;
    margin: 0 4px;
    box-shadow: 1px 0 #fff;
}

.quick-launch {
    display: flex;
    gap: 2px;
}

.taskbar-item {
    padding: 2px 6px;
    display: flex;
    align-items: center;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff;
    min-width: 150px;
}

.taskbar-item:active {
    box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a;
}

.system-tray {
    margin-left: auto;
    padding: 0 8px;
    border-left: 1px solid #888;
    box-shadow: -1px 0 #fff;
}

.taskbar-time {
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    font-size: 11px;
    padding: 2px 4px;
}

/* About page styles */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.about-header {
    text-align: center;
    margin-bottom: 30px;
}

.about-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.about-header h1 {
    margin: 10px 0 5px 0;
    color: #000080;
    font-size: 24px;
}

.tagline {
    color: #666;
    margin: 0 0 5px 0;
    font-size: 14px;
}

.about-section {
    margin: 25px 0;
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid #dfdfdf;
}

.about-section h2 {
    color: #000080;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #dfdfdf;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-item {
    background: #fff;
    padding: 10px;
    border: 1px solid #dfdfdf;
}

.feature-item h3 {
    color: #000080;
    font-size: 14px;
    margin: 0 0 10px 0;
}

.feature-item ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
}

.feature-item li {
    margin: 5px 0;
    color: #444;
}

.tech-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    font-size: 12px;
}

.tech-info p {
    margin: 0;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #dfdfdf;
}

.about-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #dfdfdf;
    text-align: center;
    font-size: 11px;
    color: #666;
}

.about-links {
    margin-top: 10px;
}

.about-links a {
    color: #000080;
    text-decoration: none;
    padding: 0 10px;
}

.about-links a:hover {
    text-decoration: underline;
}

/* Donation Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: #c0c0c0;
    border: 2px solid #dfdfdf;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 2px;
    width: 90%;
    max-width: 500px;
}

.popup-header {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-weight: normal;
    font-size: 12px;
}

.popup-close {
    background: #c0c0c0;
    border: 1px solid #dfdfdf;
    border-right-color: #808080;
    border-bottom-color: #808080;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
}

.popup-body {
    padding: 15px;
    background: #c0c0c0;
}

.donation-options {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.donation-option {
    text-align: center;
}

.qr-code {
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
    border: 1px solid #808080;
}

.donation-option span {
    display: block;
    font-size: 12px;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
}

.cookie-content {
    background: #c0c0c0;
    border: 2px solid #dfdfdf;
    border-right-color: #808080;
    border-bottom-color: #808080;
    width: 300px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

/* Add a semi-transparent overlay */
.cookie-banner::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.cookie-header {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.cookie-icon {
    width: 16px;
    height: 16px;
}

.cookie-body {
    padding: 10px;
    font-size: 11px;
}

.cookie-body p {
    margin: 0 0 10px 0;
}

.cookie-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.cookie-buttons button {
    min-width: 60px;
}

/* Mobile-first responsive styles */
@media screen and (max-width: 768px) {
    body {
        margin: 0;
        padding: 0;
    }

    .window {
        max-width: 100%;
        margin: 0;
        border: none;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* Toolbar adjustments */
    .toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 4px;
        position: sticky;
        top: 0;
        background: #dfdfdf;
        z-index: 100;
    }

    .toolbar button {
        width: 100%;
        white-space: nowrap;
        padding: 8px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .toolbar-icon {
        margin-right: 4px;
    }

    /* Improve content spacing */
    .content {
        padding: 8px;
        height: calc(100vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Make query editor more mobile-friendly */
    .query-editor {
        height: auto;
        min-height: 100px;
        max-height: 200px;
    }

    #queryInput, 
    .query-editor pre {
        font-size: 16px; /* Better for mobile readability */
        line-height: 1.4;
        padding: 8px;
    }

    /* Improve table scrolling */
    .results-grid {
        max-width: 100vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        margin: 0 -8px; /* Compensate for parent padding */
        padding: 0 8px;
    }

    /* Make tables more readable on mobile */
    table {
        font-size: 14px;
        white-space: nowrap;
    }

    th, td {
        padding: 8px;
        min-width: 100px; /* Prevent too narrow columns */
    }

    /* Improve tab navigation */
    .query-tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -8px;
        padding: 0 8px;
    }

    .query-tab {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Donation popup */
    .popup-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }

    .donation-options {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Cookie banner */
    .cookie-banner .cookie-content {
        width: 90%;
        margin: 10px;
    }

    /* Status bar */
    .status-bar {
        font-size: 10px;
    }

    /* Taskbar */
    .taskbar {
        display: none; /* Hide on mobile */
    }

    /* Tabs */
    .query-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .query-tab {
        padding: 3px 6px;
        font-size: 10px;
    }
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
    button {
        min-height: 36px; /* Better touch targets */
        min-width: 36px;
    }

    select {
        height: 36px;
    }

    .title-bar-button {
        width: 24px;
        height: 24px;
    }
}

/* Prevent zoom on inputs in iOS */
@media screen and (max-width: 768px) {
    input[type="text"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

.visual-query-builder {
    display: flex;
    gap: 10px;
    height: calc(100vh - 150px);
    padding: 10px;
    background: #dfdfdf;
    border: 1px solid #808080;
}

.schema-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #808080;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.schema-panel h3 {
    margin: 0;
    padding: 4px 8px;
    background: #dfdfdf;
    border-bottom: 1px solid #808080;
    font-size: 11px;
    font-weight: bold;
}

#available-tables {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.table-item {
    background: #fff;
    border: 1px solid #808080;
    margin-bottom: 8px;
    cursor: move;
}

.table-item-header {
    background: #dfdfdf;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
}

.table-item-columns {
    padding: 4px 8px;
    font-size: 11px;
}

.table-item-column {
    padding: 2px 0;
    color: #000;
}

.flow-canvas {
    flex: 1;
    background: #fff;
    border: 1px solid #808080;
    position: relative;
    overflow: auto;
    min-width: 0;
}

.properties-panel {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #808080;
    display: flex;
    flex-direction: column;
}

.properties-panel h3 {
    margin: 0;
    padding: 4px 8px;
    background: #dfdfdf;
    border-bottom: 1px solid #808080;
    font-size: 11px;
    font-weight: bold;
}

#node-properties {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.generated-sql {
    border-top: 1px solid #808080;
    padding: 10px;
    background: #fff;
    flex-shrink: 0;
}

.generated-sql h4 {
    margin: 0 0 10px 0;
    font-size: 11px;
}

#generatedQuery {
    background: #fff;
    border: 1px solid #808080;
    padding: 10px;
    margin: 0 0 10px 0;
    white-space: pre-wrap;
    font-family: monospace;
    max-height: 150px;
    overflow-y: auto;
    font-size: 11px;
}

.table-node {
    position: absolute;
    background: #fff;
    border: 1px solid #808080;
    min-width: 160px;
    cursor: move;
    user-select: none;
    z-index: 1;
}

.table-node.selected {
    border-color: #000080;
    box-shadow: 0 0 0 1px #000080;
    z-index: 2;
}

.table-node-header {
    background: #dfdfdf;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px solid #808080;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-node-columns {
    padding: 4px 8px;
}

.column-item {
    padding: 2px 0;
    font-size: 11px;
}

.connection {
    position: absolute;
    height: 1px;
    background: #808080;
    transform-origin: 0 0;
    pointer-events: none;
    z-index: 0;
}

.temporary-connection {
    position: absolute;
    height: 1px;
    background: #000080;
    transform-origin: 0 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.node-connector {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid #808080;
    background: #fff;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.connector-left {
    left: -5px;
}

.connector-right {
    right: -5px;
}

.canvas-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #808080;
    font-size: 11px;
    pointer-events: none;
}

/* Improve section styling */
.columns-section, .filter-section, .sort-section, .group-section, .limit-section {
    background: #f0f0f0;
    border: 1px solid #808080;
    border-radius: 2px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: inset 1px 1px 0 #ffffff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #c0c0c0;
}

.section-header h5 {
    margin: 0;
    font-size: 11px;
    color: #000080;
}

.aggregate-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.aggregate-item .remove-aggregate {
    padding: 2px 6px;
    font-size: 14px;
    line-height: 1;
}

.limit-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.limit-controls label {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.limit-controls input {
    width: 60px;
    padding: 2px 4px;
}

.filter-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.filter-item .remove-filter {
    padding: 2px 6px;
    font-size: 14px;
    line-height: 1;
}

.remove-table {
    padding: 0 4px;
    font-size: 14px;
    line-height: 1;
    color: #000;
    background: #dfdfdf;
    border: 1px solid #808080;
    cursor: pointer;
}

.remove-table:hover {
    background: #fff;
}

.remove-table:active {
    border-color: #808080 #fff #fff #808080;
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #dfdfdf;
    border: 1px solid #808080;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #ffffd9;
    color: #000;
    text-align: center;
    padding: 4px 8px;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 11px;
    white-space: normal;
    
    /* Position the tooltip */
    position: fixed;
    z-index: 9999;
    transform: translateX(-50%);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Add positioning logic */
.tooltip:hover .tooltiptext {
    visibility: visible;
    /* Position will be set by JavaScript */
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    background: #fff;
    padding: 2px 6px;
    border: 1px solid #808080;
    border-radius: 2px;
}

.toggle-switch input[type="checkbox"] {
    margin: 0;
}

.toggle-label {
    color: #000080;
}

/* Improve checkbox styling */
.win98-checkbox {
    width: 13px;
    height: 13px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.section-content.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Add a subtle transition */
.section-content {
    transition: opacity 0.2s ease-out;
}

/* Touch-friendly styles for query builder */
@media (pointer: coarse) {
    .table-item,
    .table-node {
        touch-action: none; /* Prevent browser handling of touch events */
    }

    .table-node-header {
        min-height: 36px; /* Larger touch target */
        padding: 8px 12px;
    }

    .column-item {
        min-height: 36px;
        padding: 8px 12px;
    }

    .node-connector {
        width: 24px;
        height: 24px;
        border-width: 3px;
    }

    .connector-left { left: -12px; }
    .connector-right { right: -12px; }

    /* Prevent text selection during drag */
    .table-item *,
    .table-node * {
        user-select: none;
        -webkit-user-select: none;
    }

    /* Visual feedback for touch */
    .table-item:active,
    .table-node:active {
        opacity: 0.7;
        transform: scale(1.05);
    }

    /* Improve scrolling in panels */
    .schema-panel,
    .properties-panel {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }

    /* Make the canvas easier to interact with */
    .flow-canvas {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
        touch-action: pan-x pan-y;
    }
}

/* Prevent unwanted touch behaviors */
.visual-query-builder {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Add visual feedback for dragging state */
.table-node.dragging,
.table-item.dragging {
    opacity: 0.7;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* AdSense styles */
.ad-section {
    margin: 30px 0;
    padding: 20px 0;
    text-align: center;
    background: transparent;
    border-top: 1px solid #dfdfdf;
    border-bottom: 1px solid #dfdfdf;
}

.ad-section ins.adsbygoogle {
    display: block;
    margin: 0 auto;
    background: transparent;
}

@media (max-width: 768px) {
    .ad-section {
        margin: 20px -10px;
        padding: 15px 0;
    }
}

/* Product Recommendations */
.product-recommendations {
    padding: 20px 0;
    background: #f8f8f8;
    border-radius: 4px;
}

.product-recommendations h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #000080;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 20px;
}

.product-card {
    background: white;
    border: 1px solid #dfdfdf;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    width: 150px;
    height: 200px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card h3 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: #000080;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.affiliate-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin: 20px 0 0 0;
    font-style: italic;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-card {
        padding: 10px;
    }

    .product-image {
        width: 120px;
        height: 160px;
    }
}

#tables-list {
    background: white;
    border: 1px solid #808080;
    padding: 4px;
    margin: 4px 0;
}

#tables-list button {
    width: 100%;
    text-align: left;
    margin: 2px 0;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#tables-list button::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIyIiB5PSIyIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzgwODA4MCIvPjxsaW5lIHgxPSIyIiB5MT0iNSIgeDI9IjE0IiB5Mj0iNSIgc3Ryb2tlPSIjODA4MDgwIi8+PC9zdmc+');
    flex-shrink: 0;
}

#tables-list .disabled {
    color: #808080;
    font-style: italic;
    padding: 4px 8px;
}

/* Style for when there are no tables */
#tables-list p.disabled {
    margin: 4px 0;
    padding: 8px;
    text-align: center;
    background: #f0f0f0;
    border: 1px solid #dfdfdf;
    color: #808080;
}

/* Database Info Section */
#database-info {
    background: silver;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 8px;
    margin-bottom: 8px;
}

#database-info h3 {
    margin: 0 0 8px 0;
    padding: 2px 4px;
    background: #dfdfdf;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    color: #000;
    font-size: 11px;
    font-weight: bold;
}

.info-grid {
    background: white;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 4px;
}

/* Interpreter Tab Styles */
.interpreter-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(100vh - 250px);
    background: #c0c0c0;
    padding: 8px;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

.interpreter-toolbar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #c0c0c0;
}

.interpreter-toolbar button {
    min-width: 80px;
}

#exampleQueries {
    margin-left: auto;
    min-width: 150px;
}

.interpreter-editor {
    flex: 2;
    display: flex;
    flex-direction: column;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #fff;
}

.editor-label {
    padding: 4px 8px;
    background: #000080;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}

#interpreterInput {
    flex: 1;
    border: none;
    margin: 0;
    padding: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: none;
    white-space: pre;
    tab-size: 4;
    background: #fff;
    color: #000;
    line-height: 1.4;
    overflow: auto;
}

.interpreter-results {
    flex: 1;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.results-panel {
    flex: 1;
    overflow: auto;
    padding: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    background: #fff;
}

.interpreter-status {
    padding: 2px 8px;
    background: #c0c0c0;
    border-top: 1px solid #808080;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
}

/* Success/Error messages */
.success {
    color: #008000;
    padding: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.error {
    color: #ff0000;
    padding: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
}

/* Result table styles */
.interpreter-results table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
    font-size: 12px;
}

.interpreter-results th {
    background: #dfdfdf;
    border: 1px solid #808080;
    padding: 4px 8px;
    text-align: left;
    font-weight: bold;
}

.interpreter-results td {
    border: 1px solid #808080;
    padding: 4px 8px;
    background: #fff;
}

/* Add hover effect to table rows */
.interpreter-results tr:hover td {
    background: #e8e8e8;
}

/* Add scrollbar styles */
#interpreterInput::-webkit-scrollbar,
.results-panel::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

#interpreterInput::-webkit-scrollbar-track,
.results-panel::-webkit-scrollbar-track {
    background: #dfdfdf;
}

#interpreterInput::-webkit-scrollbar-thumb,
.results-panel::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

/* Graph Builder Styles */
.graph-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(100vh - 250px);
    background: #c0c0c0;
    padding: 8px;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

.graph-toolbar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #c0c0c0;
}

.graph-toolbar select, 
.graph-toolbar button {
    min-width: 120px;
}

.graph-preview {
    flex: 1;
    background: #fff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 8px;
    overflow: auto;
    position: relative;
}

#graphCanvas {
    width: 100%;
    height: 100%;
    background: #fff;
}

.graph-options {
    background: #c0c0c0;
    padding: 8px;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.option-group label {
    min-width: 100px;
}

.option-group input,
.option-group select {
    flex: 1;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #808080;
    margin: 0 8px;
}

.graph-toolbar button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.graph-toolbar button img {
    width: 16px;
    height: 16px;
}

/* Add hover effect for export buttons */
.graph-toolbar button:hover {
    background-color: #dfdfdf;
}

.graph-toolbar button:active {
    background-color: #c0c0c0;
    border-color: #808080 #ffffff #ffffff #808080;
}

.export-section {
    background: #c0c0c0;
    padding: 8px;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    margin-top: 8px;
}

.section-label {
    padding: 4px 8px;
    background: #000080;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 8px;
}

.export-buttons {
    display: flex;
    gap: 8px;
    padding: 4px;
}

.export-buttons button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    min-width: 150px;
}

.export-buttons button img {
    width: 16px;
    height: 16px;
}

#makeMainDB {
    background-color: #e8e8e8;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    color: #000080;
    font-weight: bold;
}

#makeMainDB:hover {
    background-color: #dfdfdf;
}

#makeMainDB:active {
    background-color: #c0c0c0;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
} 