/* CSS Variables for theming */
:root {
    /* Dark theme (default) */
    --bg-primary: #0D1117;
    --bg-secondary: #161B22;
    --bg-tertiary: #21262D;
    --text-primary: #C9D1D9;
    --text-secondary: #8B949E;
    --border-color: #30363D;
    --accent-primary: #2F80ED;
    --accent-secondary: #1C6DD0;
    --accent-error: #D63384;
    --code-bg: #0D1117;
    --line-numbers-bg: #21262D;
    --line-numbers-color: #8B949E;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --accent-primary: #2563EB;
    --accent-secondary: #1D4ED8;
    --accent-error: #DC2626;
    --code-bg: #F8FAFC;
    --line-numbers-bg: #F1F5F9;
    --line-numbers-color: #64748B;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.header-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 40px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.icon {
    margin-right: 15px;
    font-size: 2.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    transition: color 0.3s ease;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Controls panel */
.controls-panel {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.control-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.select-control {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Style dropdown options for better contrast */
.select-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Additional styling for better dropdown appearance */
.select-control:focus option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Ensure proper contrast for selected option */
.select-control option:checked {
    background: var(--accent-primary);
    color: #ffffff;
    font-weight: 600;
}

.select-control:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.select-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.format-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.format-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.format-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Editor container */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex: 1;
}

.editor-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.editor-header h3 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
}

/* Editor wrapper for line numbers */
.editor-wrapper {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Line numbers */
.line-numbers {
    background: var(--line-numbers-bg);
    color: var(--line-numbers-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 25px 15px 25px 25px;
    border-right: 1px solid var(--border-color);
    text-align: right;
    user-select: none;
    min-width: 50px;
    white-space: pre;
    flex-shrink: 0;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 10;
    height: 100%;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* SQL Editor */
.sql-editor {
    flex: 1;
    padding: 25px;
    background: var(--code-bg);
    border: none;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 400px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sql-editor::placeholder {
    color: var(--text-secondary);
}

/* SQL Output */
.sql-output {
    flex: 1;
    padding: 25px;
    background: var(--code-bg);
    margin: 0;
    overflow: auto;
    min-height: 400px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

.sql-output code {
    background: none !important;
    padding: 0 !important;
    color: var(--text-primary) !important;
}

/* Prism.js customization */
pre[class*="language-"] {
    background: var(--code-bg) !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* Custom SQL syntax highlighting for dark theme */
.token.keyword {
    color: #D63384 !important;
    font-weight: 600;
}

.token.string {
    color: #7C3AED !important;
}

.token.number {
    color: #059669 !important;
}

.token.operator {
    color: #DC2626 !important;
}

.token.punctuation {
    color: #8B949E !important;
}

.token.comment {
    color: #6B7280 !important;
    font-style: italic;
}

.token.function {
    color: #2563EB !important;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    min-width: 320px;
    max-width: 450px;
    word-wrap: break-word;
    line-height: 1.4;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
}

.notification.error {
    background: linear-gradient(45deg, var(--accent-error), #C92A7A);
}

/* Responsive design */
@media (max-width: 1024px) {
    .editor-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 30px;
        padding: 20px 0;
    }
    
    .header-content {
        padding: 25px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .controls-panel {
        padding: 20px;
    }
    
    .editor-header {
        padding: 15px 20px;
    }
    
    .sql-editor,
    .sql-output {
        padding: 20px;
        min-height: 300px;
    }
}

/* Loading animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4ecdc4;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 32px;
    z-index: 100;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37,99,235,0.06);
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.theme-toggle:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px rgba(47,128,237,0.12);
}
.theme-toggle-icon {
    pointer-events: none;
    transition: color 0.3s;
}

@media (max-width: 600px) {
    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    transition: color 0.3s ease;
}

.signature {
    color: var(--accent-primary);
    font-weight: 600;
    font-style: italic;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
} 