:root {
    /* Primary colors */
    --color-primary: #4a90e2;
    --color-primary-hover: #357abd;
    --color-primary-light: #f0f7ff;

    /* Neutral colors */
    --color-white: white;
    --color-black: black;
    --color-text-dark: #333;
    --color-text-medium: #555;

    /* Background colors */
    --color-bg-gray-light: #f0f0f0;
    --color-bg-gray-medium: #e0e0e0;

    /* Border colors */
    --color-border: #ddd;

    /* Shadow colors */
    --color-shadow-light: rgba(0, 0, 0, 0.15);
    --color-shadow-medium: rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--color-white);
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.controls-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    margin: 0 0 20px 0;
    color: var(--color-text-dark);
    font-size: 24px;
    font-weight: 600;
}

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

label {
    display: block;
    margin-bottom: 5px;
    color: var(--color-text-medium);
    font-weight: 500;
    font-size: 14px;
}

input[type="file"] {
    display: none;
}

.file-button {
    background: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.file-button:hover {
    background: var(--color-primary-hover);
}

.file-button.file-loaded {
    background: var(--color-bg-gray-light);
    color: var(--color-text-dark);
}

.file-button.file-loaded:hover {
    background: var(--color-bg-gray-medium);
}

#queryInput {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border);
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 14px;
    resize: vertical;
    display: none;
    /* Hide until CodeMirror takes over */
}

#queryInput:focus {
    outline: none;
    border-color: var(--color-primary);
}

.CodeMirror {
    border: 1px solid var(--color-border);
    height: auto;
    font-size: 14px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
}

.CodeMirror-focused {
    border-color: var(--color-primary);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

button {
    padding: 8px 16px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border-radius: 3px;
}

/* Button states */
.btn-gray {
    background: var(--color-bg-gray-light);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

.btn-gray:hover {
    background: var(--color-bg-gray-medium);
}

.btn-blue {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
}

.btn-blue:hover {
    background: var(--color-primary-hover);
}

/* File button */
.file-button {
    background: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-border);
}

.file-button:hover {
    background: var(--color-primary-hover);
}

.file-button.file-loaded {
    background: var(--color-bg-gray-light);
    color: var(--color-text-dark);
}

.file-button.file-loaded:hover {
    background: var(--color-bg-gray-medium);
}

#loadButton {
    background: var(--color-bg-gray-light);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    flex: 1;
}

#loadButton:hover {
    background: var(--color-bg-gray-medium);
}

#loadButton.file-loaded {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
}

#loadButton.file-loaded:hover {
    background: var(--color-primary-hover);
}

#exportButton,
#plotButton {
    background: var(--color-bg-gray-light);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

#exportButton:hover,
#plotButton:hover {
    background: var(--color-bg-gray-medium);
}

#exportButton.query-executed,
#plotButton.query-executed {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
}

#exportButton.query-executed:hover,
#plotButton.query-executed:hover {
    background: var(--color-primary-hover);
}

#progressContainer {
    display: none;
    margin: 15px 0;
}

#progressBar {
    width: 100%;
    height: 30px;
    background-color: var(--color-bg-gray-light);
    overflow: hidden;
}

#progressFill {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 500;
    font-size: 14px;
}

.table-scroll-wrapper {
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Custom scrollbar styling */
.table-scroll-wrapper::-webkit-scrollbar,
#tableContainer::-webkit-scrollbar {
    height: 12px;
}

.table-scroll-wrapper::-webkit-scrollbar-track,
#tableContainer::-webkit-scrollbar-track {
    background: var(--color-bg-gray-light);
    border-radius: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb,
#tableContainer::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover,
#tableContainer::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-hover);
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    margin-top: 10px;
}

/* DataTables pagination styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border: 1px solid var(--color-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--color-primary-hover) !important;
    color: var(--color-white) !important;
    border: 1px solid var(--color-primary-hover) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-primary-light) !important;
    color: var(--color-text-dark) !important;
    border: 1px solid var(--color-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 3px;
}

#dataTable thead th {
    background: var(--color-primary);
    color: var(--color-white) !important;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 10px;
    line-height: 1;
    vertical-align: middle;
}

#dataTable tbody td {
    padding: 4px 10px;
    font-size: 13px;
}

#dataTable tbody tr:hover {
    background-color: var(--color-primary-light);
}

#tableContainer {
    margin-top: 20px;
    overflow-x: auto;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

#plotContainer {
    margin-top: 20px;
    display: none;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.subplot {
    margin-bottom: 30px;
}

.subplot .u-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 10px;
}

/* Plot Options Menu */
.plot-options-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
}

.plot-options-menu.visible {
    display: block;
}

.hamburger-button {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px var(--color-shadow-medium);
}

.hamburger-button:hover {
    background: var(--color-primary-hover);
}

.options-panel {
    display: none;
    position: absolute;
    bottom: 50px;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 15px;
    min-width: 250px;
    box-shadow: 0 4px 12px var(--color-shadow-light);
}

.options-panel.open {
    display: block;
}

.option-group {
    margin-bottom: 15px;
}

.option-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--color-text-medium);
    font-weight: 500;
    font-size: 13px;
}

.option-group select,
.option-group input[type="color"] {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    font-size: 14px;
}

.option-group input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.apply-button {
    width: 100%;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
}

.apply-button:hover {
    background: var(--color-primary-hover);
}