* {
    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;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 30px;
    min-height: 600px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    border-radius: 15px;
    max-height: 500px;
    min-height: 400px;
}

.welcome-message {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.welcome-message h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.example-questions {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.example-questions h3 {
    color: #475569;
    margin-bottom: 10px;
    font-size: 1em;
}

.example-questions ul {
    list-style: none;
    padding-left: 0;
}

.example-questions li {
    padding: 8px 0;
    color: #64748b;
    font-style: italic;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

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

.message.user {
    text-align: right;
}

.message.assistant {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.message.assistant .message-content {
    background: white;
    color: #1e293b;
}

.message-label {
    font-size: 0.8em;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 600;
}

.sources {
    margin-top: 15px;
    padding: 15px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.85em;
}

.sources h4 {
    color: #475569;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.source-item {
    padding: 8px;
    background: white;
    border-radius: 5px;
    margin-bottom: 8px;
    color: #64748b;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#questionInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1em;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s;
}

#questionInput:focus {
    outline: none;
    border-color: #667eea;
}

#sendButton {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 100px;
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sendButton:active {
    transform: translateY(0);
}

#sendButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.info-panel {
    background: #f8fafc;
    padding: 20px;
    border-radius: 15px;
    height: fit-content;
}

.info-panel h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#systemInfo {
    background: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 0.9em;
}

#systemInfo p {
    margin-bottom: 10px;
    color: #475569;
}

#systemInfo strong {
    color: #1e293b;
}

footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 20px;
}

footer p {
    margin: 5px 0;
    opacity: 0.9;
}

.tech-stack {
    font-size: 0.9em;
    opacity: 0.7;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.8em;
    }

    .message-content {
        max-width: 90%;
    }
}

