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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header-bar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    font-size: 1.5rem;
    color: #667eea;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: #666;
    font-size: 0.9rem;
}

/* Login Card */
.login-card {
    max-width: 400px;
    width: 100%;
    margin: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
}

.login-card .header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .header h1 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

.query-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.query-card h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.query-form {
    margin-top: 1.5rem;
}

/* Results */
.results-container {
    margin-top: 2rem;
}

.result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.result-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.answer-content {
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
}

.sources-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.sources-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.sources-list {
    list-style: none;
    padding: 0;
}

.sources-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.source-filename {
    font-weight: 500;
    color: #333;
}

.source-type {
    color: #666;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin: 1rem 0;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

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

.loading-indicator p {
    color: #666;
    margin-top: 1rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 1.5rem;
    color: white;
    font-size: 0.9rem;
}

.login-card .footer {
    background: transparent;
    color: #666;
    margin-top: 1.5rem;
    padding: 1rem 0 0;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 1.25rem;
    }
    
    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .query-card,
    .result-card,
    .sources-card {
        padding: 1.5rem;
    }
    
    .main-content {
        margin: 1rem auto;
    }
}

@media (max-width: 480px) {
    .login-card .header h1 {
        font-size: 1.5rem;
    }
    
    .query-card h2 {
        font-size: 1.25rem;
    }
}

