/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0066cc 0%, #0044aa 50%, #003399 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 3rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}

/* Main Content */
.main {
    flex: 1;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

/* Search Container */
.search-container {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    padding: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.input-group:focus-within {
    border-color: #0066cc;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    backdrop-filter: blur(15px);
}

.query-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    outline: none;
    color: #333;
}

.query-input::placeholder {
    color: #999;
}

.search-btn {
    background: linear-gradient(135deg, #0066cc 0%, #0044aa 100%);
    border: none;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: white;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading p {
    color: #666;
    font-size: 1rem;
}

/* Result Container */
.result-container {
    animation: fadeIn 0.5s ease-in;
}

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

.answer-section {
    margin-bottom: 2rem;
}

.answer-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.answer-text {
    background: rgba(248, 249, 250, 0.8);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #0066cc;
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.citations-section {
    margin-top: 2rem;
}

.citations-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.citations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.citation-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(224, 224, 224, 0.5);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.citation-item:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.citation-source {
    font-weight: 500;
    color: #0066cc;
    margin-bottom: 0.5rem;
}

.citation-content {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 2rem;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    color: #c53030;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .main {
        padding: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .main {
        padding: 1rem;
    }
    
    .answer-text {
        padding: 1rem;
    }
}
