/* SQL Trainer - Custom Styles */

:root {
    --sql-bg: #1e1e1e;
    --sql-text: #d4d4d4;
}

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* SQL Editor Styling */
#sqlEditor {
    background-color: var(--sql-bg);
    color: var(--sql-text);
    border: 2px solid #495057;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px;
    resize: vertical;
    min-height: 150px;
}

#sqlEditor:focus {
    background-color: var(--sql-bg);
    color: var(--sql-text);
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#sqlEditor::placeholder {
    color: #6c757d;
}

/* Ergebnis-Tabellen */
.table-responsive {
    max-height: 500px;
    overflow-y: auto;
}

.table {
    margin-bottom: 0;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Übungsliste */
.list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Cards */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
}

/* Buttons */
.btn {
    transition: all 0.2s ease;
}

.btn:disabled {
    cursor: not-allowed;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.125);
}

/* Alert-Animationen */
.alert {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Styling */
.toast {
    min-width: 250px;
}

/* Scrollbar für Ergebnis-Tabellen */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Badge Styling */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .col-md-3 {
        margin-bottom: 20px;
    }
    
    #sqlEditor {
        font-size: 12px;
    }
    
    .btn {
        margin-bottom: 5px;
    }
}

/* Loading Spinner in Buttons */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Hint Box */
#exerciseHint {
    border-left: 4px solid #0dcaf0;
}

/* Code-ähnliche Darstellung */
.font-monospace {
    font-family: 'Courier New', Courier, monospace !important;
}

/* Erfolgs-/Fehler-Highlighting */
.alert-success {
    border-left: 4px solid #198754;
}

.alert-danger {
    border-left: 4px solid #dc3545;
}

.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert-info {
    border-left: 4px solid #0dcaf0;
}

/* Tabellen-Hover-Effekt */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Sticky Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles für Accessibility */
button:focus,
a:focus,
textarea:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .col-md-3,
    button {
        display: none;
    }
    
    .col-md-9 {
        width: 100%;
    }
}
