/* Main Styles for Overpass Query Builder */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #dee2e6;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

body {
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
header {
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
}

header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-body {
    padding: 1.5rem;
}

/* Form Controls */
.form-control, .form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Query Output */
#queryOutput {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

/* Condition Groups */
.condition-group {
    background-color: #f8f9fa;
    position: relative;
}

.remove-condition {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Help Section */
.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.05);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .condition-group .row > div {
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
        text-align: center;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Tooltips */
.tooltip {
    font-size: 0.875rem;
}

/* Footer */
footer {
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Condition Group Styling */
.condition-group {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.condition-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0.125rem 0.5rem rgba(13, 110, 253, 0.1);
}

.remove-condition {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.remove-condition:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: rgba(220, 53, 69, 0.1);
}

/* Add vertical spacing between form groups */
.form-group {
    margin-bottom: 1.25rem;
}

/* Add spacing between form elements */
.form-select, 
.form-control,
.input-group {
    margin-bottom: 0.75rem;
}

/* Ensure autocomplete dropdown is above other elements */
.autocomplete {
    z-index: 10;
}
