/* SemStore Federated Retrieval Demo Styles */

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}


/* Section Styles */
section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* Query Input Section */
.query-input-container {
    margin-bottom: 30px;
}

.query-input-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #374151;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

#query-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

#query-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Styles */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #374151;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* Sample Queries */
.sample-queries h3 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.sample-queries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.sample-query {
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sample-query:hover {
    background: #e2e8f0;
    border-color: #667eea;
}

.sample-query .query-text {
    font-weight: 500;
    color: #374151;
}

.sample-query .query-category {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Mode Toggle Section */
.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toggle-label {
    font-weight: 600;
    color: #374151;
}

.toggle-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-option {
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    color: #64748b;
}

.toggle-switch input[type="radio"]:checked + .toggle-option {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-info {
    padding: 16px;
    background: #f8fafc;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #475569;
}

/* Loading Indicator */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    font-size: 1.1rem;
    color: #6b7280;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results Styles */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.results-header h3 {
    color: #374151;
    font-size: 1.3rem;
}

.results-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #6b7280;
}

.results-list {
    space-y: 12px;
}

.result-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    transition: all 0.2s;
    cursor: pointer;
    background: #fafbfc;
}

.result-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.result-name {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
    flex: 1;
}

.result-score {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.result-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #6b7280;
}

.result-rank {
    font-weight: 600;
    color: #374151;
}

.result-type {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* QuickSight Link Styles */
.quicksight-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quicksight-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
}

.quicksight-icon {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Comparison Styles */
.comparison-header {
    margin-bottom: 30px;
}

.comparison-header h3 {
    color: #374151;
    margin-bottom: 15px;
}


.comparison-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.comparison-panel h4 {
    color: #374151;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* Ranking Change Indicators */
.result-item.moved-up {
    border-left: 4px solid #10b981;
}

.result-item.moved-down {
    border-left: 4px solid #ef4444;
}

.result-item.new-result {
    border-left: 4px solid #3b82f6;
}

.ranking-change {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.ranking-change.up {
    background: #ecfdf5;
    color: #10b981;
}

.ranking-change.down {
    background: #fef2f2;
    color: #ef4444;
}

.ranking-change.new {
    background: #eff6ff;
    color: #3b82f6;
}

/* Error Styles */
.error-container {
    text-align: center;
    padding: 40px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 30px;
    color: #991b1b;
}

.error-message h3 {
    margin-bottom: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    word-wrap: break-word;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Custom scrollbar for webkit browsers */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f7fafc;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Improve JSON formatting in modal */
.modal-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Ensure modal content sections have proper spacing */
.modal-body h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #374151;
}

.modal-body p {
    margin-bottom: 8px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    font-size: 0.9rem;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mode-toggle-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comparison-panels {
        grid-template-columns: 1fr;
    }
}
