/* 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;
    background-color: #0f1117;
    color: #e6e8eb;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #1e2030 0%, #2a2d47 100%);
    border-bottom: 1px solid #1e2030;
    padding: 32px 0;
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6c5ce7;
    margin-bottom: 8px;
}

.tagline {
    font-size: 1.1rem;
    color: #8b92a9;
    font-weight: 400;
}

/* Main Content */
.main {
    padding: 48px 0;
}

/* Search Section */
.search-section {
    text-align: center;
    margin-bottom: 48px;
}

.search-container {
    display: flex;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #1e2030;
    border-radius: 12px;
    background-color: #161822;
    color: #e6e8eb;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.search-input::placeholder {
    color: #6c7293;
}

.compare-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 120px;
}

.compare-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.3);
}

.compare-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text, .btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    color: white;
}

.hidden {
    display: none !important;
}

/* Example Queries */
.examples-label {
    color: #8b92a9;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.query-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.query-chip {
    padding: 10px 16px;
    background-color: #1e2030;
    border: 1px solid #2a2d47;
    border-radius: 20px;
    color: #b4bcc8;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.query-chip:hover {
    background-color: #2a2d47;
    border-color: #6c5ce7;
    color: #e6e8eb;
    transform: translateY(-1px);
}

/* Results Section */
.results-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Comparison Highlights */
.comparison-highlights {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
    text-align: center;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2);
}

.quality-highlight {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%) !important;
    box-shadow: 0 4px 12px rgba(253, 203, 110, 0.2) !important;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .query-chips {
        max-width: none;
    }
}

/* Result Cards */
.result-card {
    background-color: #161822;
    border: 1px solid #1e2030;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: #2a2d47;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e6e8eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.metric {
    background-color: #1e2030;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #8b92a9;
    font-weight: 500;
}

.compression-badge {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    font-weight: 700;
}

.answer {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #e6e8eb;
}

/* Context Toggle */
.context-toggle {
    border-top: 1px solid #1e2030;
    padding-top: 20px;
}

.context-btn {
    width: 100%;
    background: none;
    border: none;
    color: #6c5ce7;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.context-btn:hover {
    color: #a29bfe;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.context-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

.context-content {
    padding-top: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

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

.context-item {
    background-color: #0f1117;
    border: 1px solid #1e2030;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.context-item-header {
    font-size: 0.85rem;
    color: #6c7293;
    margin-bottom: 8px;
    font-weight: 500;
}

.context-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #b4bcc8;
}

.nugget-source {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6c5ce7;
    font-style: italic;
}

/* Loading State */
.loading-state .result-card {
    background-color: #161822;
    border: 1px solid #1e2030;
    border-radius: 16px;
    padding: 24px;
}

.skeleton-card {
    background-color: #161822;
    border: 1px solid #1e2030;
    border-radius: 16px;
    padding: 24px;
}

.skeleton-header {
    margin-bottom: 20px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #1e2030 25%, #2a2d47 50%, #1e2030 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
}

.skeleton-line.short {
    width: 70%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 24px 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .main {
        padding: 32px 0;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .metrics {
        width: 100%;
        justify-content: flex-start;
    }
}