/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    
    /* Secondary colors */
    --secondary-color: #64748b;
    --secondary-light: #94a3b8;
    --secondary-dark: #475569;
    
    /* Accent colors */
    --accent-color: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #7c3aed;
    
    /* Background colors */
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --surface-hover: #f8fafc;
    
    /* Text colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    /* Border colors */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    /* Status colors */
    --success-color: #10b981;
    --success-light: #34d399;
    --error-color: #ef4444;
    --error-light: #f87171;
    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    /* background-color: var(--background-color); */
    background-color: #1e293b;
}

/* Navigation */
.navbar {
    /* background-color: var(--surface-color); #0f0f10 */
    background-color: #0f0f10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.2s ease;
}

.nav-brand:hover {
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* Main content */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Query form */
.query-form {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.query-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

#query-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    resize: vertical;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#query-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Toggle switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    color: var(--text-secondary);
    font-weight: 500;
}

#submit-query {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

#submit-query:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-dark));
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

#submit-query:active {
    transform: translateY(0);
}

/* Results */
.results-container {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    color: var(--error-color);
    padding: 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--error-color);
}

.sql-display {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
}

.data-display {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background-color: var(--surface-hover);
}

.visualization {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
}

.visualization img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .form-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #submit-query {
        width: 100%;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Content pages */
.content-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.content-section h2 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.content-section h3 {
    color: #444;
    margin: 1.5rem 0 1rem;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.content-section ul, .content-section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.paper-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.paper-info p {
    margin-bottom: 0.5rem;
}

.paper-download {
    text-align: center;
    margin-top: 2rem;
}

.download-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.download-button:hover {
    background-color: #0056b3;
}

.viz-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 20px 0;
    display: block;
    width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.viz-button:hover {
    background-color: #45a049;
}

#visualization {
    margin-top: 20px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#visualization img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
} 