/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header .tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
.main-nav {
    background-color: white;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.main-nav li {
    flex: 1;
    min-width: 150px;
}

.main-nav a {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.main-nav a:hover {
    background-color: #f8f9fa;
    color: #667eea;
}

.main-nav a.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f8f9fa;
}

/* Main Content */
main {
    padding: 2rem 20px;
    min-height: calc(100vh - 300px);
}

/* Tool Sections */
.tool-section {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.tool-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-section h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tool-description {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Query Form */
.query-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #444;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Locations Grid */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.location-group h4 {
    color: #667eea;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-group label {
    display: block;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.location-group label:hover {
    color: #667eea;
}

.location-group input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Advanced Options */
.advanced-options {
    margin: 1.5rem 0;
}

.advanced-panel {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.advanced-panel label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.advanced-panel input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-link {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background-color: #667eea;
    color: white;
}

.btn-link {
    background: none;
    color: #667eea;
    padding: 0.5rem 1rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: #764ba2;
}

/* Results Container */
.results-container {
    margin-top: 2rem;
}

.results-container.loading::before {
    content: "Loading...";
    display: block;
    padding: 2rem;
    text-align: center;
    color: #667eea;
    font-weight: 600;
    font-size: 1.2rem;
}

.result-card {
    background-color: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.result-card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.result-card pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.result-success {
    border-left-color: #28a745;
}

.result-error {
    border-left-color: #dc3545;
}

.result-warning {
    border-left-color: #ffc107;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.result-table th,
.result-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.result-table th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

.result-table tr:hover {
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background-color: #2d2d2d;
    color: #ccc;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

footer .disclaimer {
    font-size: 0.9rem;
    color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav li {
        min-width: 100%;
    }

    .locations-grid {
        grid-template-columns: 1fr;
    }

    .tool-section {
        padding: 1rem;
    }

    .form-group input[type="text"],
    .form-group select {
        max-width: 100%;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-success {
    background-color: #28a745;
}

.status-error {
    background-color: #dc3545;
}

.status-warning {
    background-color: #ffc107;
}

.status-info {
    background-color: #17a2b8;
}
