* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
}

body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        padding: 20px;
}

.container {
        max-width: 1200px;
        margin: 0 auto;
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        overflow: hidden;
}

.header {
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        color: white;
        padding: 20px;
}

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

.header h1 {
        font-size: 24px;
        margin-bottom: 5px;
}

.header p {
        opacity: 0.9;
        font-size: 14px;
}

.header-buttons {
        display: flex;
        gap: 10px;
}

.main-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
}

.connection-panel, .editor-panel, .results-panel {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 20px;
}

.connection-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 20px;
}

.form-group {
        display: flex;
        flex-direction: column;
}

.form-group label {
        font-weight: 600;
        margin-bottom: 5px;
        color: #333;
}

.form-group input {
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
}

.form-group input:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

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

.btn {
        padding: 10px 20px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        transition: all 0.3s ease;
}

.btn-primary {
        background: #4CAF50;
        color: white;
}

.btn-primary:hover {
        background: #45a049;
}

.btn-secondary {
        background: #6c757d;
        color: white;
}

.btn-secondary:hover {
        background: #5a6268;
}

.btn-disconnect {
        background: #dc3545;
        color: white;
}

.btn-disconnect:hover {
        background: #c82333;
}

.editor-label {
        font-weight: 600;
        margin-bottom: 10px;
        color: #333;
}

.sql-editor {
        width: 100%;
        height: 200px;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-family: 'Courier New', monospace;
        font-size: 14px;
        resize: vertical;
        background: #fff;
}

.sql-editor:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.results-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
}

.table-container {
        width: 100%;
        overflow-x: auto;
        max-height: 500px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        background: white;
}

.results-table {
        width: 100%;
        border-collapse: collapse;
        background: white;
}

.results-table th {
        background: #4CAF50;
        color: white;
        padding: 12px 15px;
        text-align: left;
        font-weight: 600;
        position: sticky;
        top: 0;
}

.results-table td {
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
}

.status-bar {
        padding: 10px;
        border-radius: 4px;
        margin-bottom: 15px;
        display: none;
}

.status-success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
}

.status-error {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
}

.loading {
        opacity: 0.6;
        pointer-events: none;
}

.login-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
}

.login-box {
        background: white;
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        text-align: center;
        max-width: 400px;
        width: 90%;
}

.login-box h2 {
        color: #333;
        margin-bottom: 20px;
}

.form-control {
        width: 100%;
        padding: 12px;
        margin: 15px 0;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 16px;
}

.history-panel {
        background: #f1f3f4;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        margin-bottom: 15px;
        max-height: 300px;
        overflow-y: auto;
}

.history-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        background: #e9ecef;
        border-bottom: 1px solid #dee2e6;
}

.history-list {
        padding: 10px;
}

.history-item {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        margin-bottom: 5px;
        padding: 8px;
        cursor: pointer;
        font-size: 12px;
}

.history-item:hover {
        background: #f8f9fa;
        border-color: #4CAF50;
}

/* Responsive */
@media (max-width: 768px) {
        .connection-grid {
                grid-template-columns: 1fr;
        }
    
        .button-group {
                flex-direction: column;
        }
    
        .header-content {
                flex-direction: column;
                gap: 15px;
        }
    
        .header-buttons {
                width: 100%;
                justify-content: center;
        }
    
        .main-grid {
                padding: 10px;
        }
    
        .results-table th,
        .results-table td {
                padding: 8px 6px;
                font-size: 12px;
        }
}
