/* Main Site Styles */
body {
    font-family: "Courier New", monospace;
    background-color: #c0c0c0;
    margin: 0;
    padding: 20px;
    color: #000;
}

h1 {
    background-color: #000080;
    color: #fff;
    padding: 10px;
    margin: 0 0 20px 0;
    border: 2px outset #fff;
}

h2 {
    background-color: #008080;
    color: #fff;
    padding: 8px;
    margin: 20px 0 10px 0;
    border: 2px outset #fff;
}

h3 {
    margin-top: 0;
}

.container {
    background-color: #fff;
    padding: 20px;
    border: 2px inset #808080;
    margin-bottom: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
    background-color: #fff;
}

th {
    background-color: #000080;
    color: #fff;
    padding: 8px;
    text-align: left;
    border: 1px solid #000;
    font-weight: bold;
}

td {
    padding: 8px;
    border: 1px solid #808080;
}

tr:nth-child(even) {
    background-color: #e0e0e0;
}

tr:nth-child(odd) {
    background-color: #f0f0f0;
}

/* Form Tables */
table.form-table {
    border: none;
    background: transparent;
}

table.form-table td {
    border: none;
    padding: 5px;
    vertical-align: top;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    padding: 10px;
    background-color: #c0c0c0;
    border: 2px outset #fff;
}

.pagination a,
.pagination span {
    padding: 5px 10px;
    margin: 0 2px;
    background-color: #c0c0c0;
    border: 2px outset #fff;
    text-decoration: none;
    color: #000;
    display: inline-block;
}

.pagination a:hover {
    background-color: #808080;
    color: #fff;
}

.pagination .current {
    background-color: #000080;
    color: #fff;
    border: 2px inset #808080;
}

/* Navigation */
.nav {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #808080;
    border: 2px outset #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 5px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    padding: 5px 15px;
    background-color: #000080;
    border: 2px outset #fff;
    display: inline-block;
}

.nav a:visited {
    color: #fff;
}

.nav a:hover {
    background-color: #0000ff;
}

.user-info {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-info form {
    display: inline;
    margin: 0;
}

/* Buttons */
button, .btn {
    background-color: #c0c0c0;
    border: 2px outset #fff;
    padding: 3px 10px;
    cursor: pointer;
    font-family: "Courier New", monospace;
}

button:hover, .btn:hover {
    background-color: #e0e0e0;
}

button.primary, .btn-primary {
    padding: 5px 15px;
}

button.btn-delete, .btn-delete {
    background-color: #cc0000;
    color: #fff;
    padding: 5px 15px;
}

.btn-link {
    background-color: #008080;
    color: #fff;
    text-decoration: none;
    padding: 3px 10px;
    border: 2px outset #fff;
    display: inline-block;
}

.btn-link:visited {
    color: #fff;
}

.btn-link:hover {
    background-color: #00a0a0;
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 500px;
    padding: 3px;
    font-family: "Courier New", monospace;
}

/* Code and Pre */
pre {
    background-color: #fff;
    padding: 15px;
    border: 2px inset #808080;
    overflow-x: auto;
    font-family: "Courier New", monospace;
    margin-top: 5px;
    max-height: 200px;
    overflow: auto;
}

code {
    font-family: "Courier New", monospace;
    background-color: transparent;
}

/* Info Box */
.info {
    padding: 10px;
    background-color: #ffff00;
    border: 2px solid #000;
    margin-bottom: 10px;
}

/* Error Box */
.error {
    background-color: #ff0000;
    color: #fff;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #000;
}

.error[style*="text-align: center"] {
    font-weight: bold;
}

/* Success Box */
.success {
    background-color: #008000;
    color: #fff;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #000;
}

/* Warning/Delete Box */
.warning {
    background-color: #ff0000;
    color: #fff;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #000;
}

/* Links */
a {
    color: #0000ff;
    text-decoration: underline;
}

a:visited {
    color: #800080;
}

a:hover {
    color: #ff00ff;
}

/* Utility Classes */
.margin-left {
    margin-left: 10px;
}

.margin-top {
    margin-top: 20px;
}

.margin-right {
    margin-right: 10px;
}

.text-small {
    font-size: 0.9em;
}

.text-muted {
    color: #666;
}

.text-danger {
    color: #cc0000;
}

.max-width-400 {
    max-width: 400px;
}

/* Query Specific */
details {
    margin-top: 5px;
    margin-bottom: 20px;
}

details.inline {
    margin-bottom: 0;
}

summary {
    cursor: pointer;
    color: #0000ff;
}

summary.box {
    padding: 8px;
    background-color: #c0c0c0;
    border: 2px outset #fff;
    font-weight: bold;
}

#test-status {
    margin-left: 10px;
    color: #666;
}

#test-results {
    display: none;
    margin-top: 10px;
    border: 2px solid #000;
    padding: 10px;
    background-color: #fff;
    max-height: 400px;
    overflow: auto;
}

/* Select dropdowns */
select {
    padding: 3px;
    font-family: "Courier New", monospace;
}

select.short {
    width: 250px;
}

/* Login/auth forms */
input[type="text"].short,
input[type="password"].short,
input[type="email"].short {
    width: 250px;
}

/* CodeMirror Editor */
.CodeMirror {
    font-family: "Courier New", monospace;
    font-size: 14px;
    border: 1px solid #ccc;
    background-color: #fff;
}

.CodeMirror-gutters {
    background-color: #f0f0f0;
    border-right: 1px solid #ccc;
}

.CodeMirror-linenumber {
    color: #666;
}

/* CodeMirror Syntax Highlighting */
.cm-s-default .cm-keyword {
    color: #0000ff;
    font-weight: bold;
}

.cm-s-default .cm-string {
    color: #a31515;
}

.cm-s-default .cm-number {
    color: #098658;
}

.cm-s-default .cm-comment {
    color: #008000;
    font-style: italic;
}

.cm-s-default .cm-operator {
    color: #000;
}

.cm-s-default .cm-variable {
    color: #000;
}

.cm-s-default .cm-builtin {
    color: #795e26;
}

/* Static code blocks */
code[class*="language-"],
pre[class*="language-"] {
    color: #000;
    background: none;
    font-family: "Courier New", Consolas, Monaco, monospace;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.5;
    tab-size: 4;
}

pre[class*="language-"] {
    padding: 15px;
    margin: 0;
    overflow: auto;
    background: #fff;
    border: 2px inset #808080;
}

.query-cell {
    max-height: 7.5em;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.5;
    padding: 4px;
    background: #fff;
}

.query-cell::-webkit-scrollbar {
    width: 12px;
}

.query-cell::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px solid #808080;
}

.query-cell::-webkit-scrollbar-thumb {
    background: #808080;
    border: 1px outset #fff;
}

.query-cell::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

#test-results {
    margin-top: 15px;
}

#test-results summary {
    cursor: pointer;
    font-weight: bold;
    padding: 5px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

#test-results[open] summary {
    background-color: #008080;
    color: #fff;
}

#results-content {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
}
