/* NoBase Web Interface Styles */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar-brand {
    font-weight: bold;
}

.collection-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #dee2e6;
}

.collection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.btn-group .btn {
    font-size: 0.875rem;
}

#queryResults {
    max-height: 400px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.document-item {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.document-item:hover {
    border-color: #007bff;
}

.document-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.document-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.json-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #e9ecef;
    margin: 0.5rem 0;
}

.stats-card {
    text-align: center;
    padding: 1rem;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stats-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.alert {
    border-radius: 0.5rem;
}

.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.form-control, .form-select {
    border-radius: 0.375rem;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: #6c757d !important;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

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

/* Query input styling */
textarea.form-control {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

/* Results table styling */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
}

.table td {
    vertical-align: middle;
}

/* Responsive design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group .btn {
        font-size: 0.75rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
}

/* Success/Error states */
.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #b8daff;
    color: #055160;
}

/* Empty state styling */
#emptyState {
    color: #6c757d;
}

#emptyState i {
    opacity: 0.5;
}

/* Syntax highlighting for JSON */
.json-key {
    color: #d73a49;
    font-weight: bold;
}

.json-string {
    color: #032f62;
}

.json-number {
    color: #005cc5;
}

.json-boolean {
    color: #e36209;
}

.json-null {
    color: #6f42c1;
}
