/* RAG Chat Interface Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2)
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh
}

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

.header {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border)
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px
}

.logo-icon {
    font-size: 48px;
    animation: float 3s ease-in-out infinite
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px)
    }

    50% {
        transform: translateY(-10px)
    }
}

.title {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px
}

.status-section {
    display: flex;
    align-items: center;
    gap: 12px
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
    background: var(--surface-light);
    font-size: 14px;
    font-weight: 500
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite
}

.status-indicator.loading .status-dot {
    background: var(--warning)
}

.status-indicator.ready .status-dot {
    background: var(--success)
}

.status-indicator.error .status-dot {
    background: var(--error)
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.5
    }
}

.refresh-btn {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease
}

.refresh-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(180deg)
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px
}

@media (max-width:1024px) {
    .main-content {
        grid-template-columns: 1fr
    }
}

.summary-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    height: fit-content
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary)
}

.summary-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8
}

.summary-content strong {
    color: var(--text-primary)
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto
}

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

.chat-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px
}

.chat-header {
    margin-bottom: 20px
}

.chat-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px
}

.suggested-questions {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border)
}

.suggested-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 500
}

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

.question-chip {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap
}

.question-chip:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm)
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 20px
}

.chat-messages::-webkit-scrollbar {
    width: 8px
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--border)
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary)
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: wave 2s ease-in-out infinite
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg)
    }

    25% {
        transform: rotate(20deg)
    }

    75% {
        transform: rotate(-20deg)
    }
}

.welcome-message h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 24px
}

.message {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600
}

.message.user .message-header {
    color: var(--primary-light)
}

.message.bot .message-header {
    color: var(--secondary)
}

.message-content {
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    border-left: 3px solid var(--border);
    color: var(--text-secondary);
    line-height: 1.6
}

.message.user .message-content {
    border-left-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%)
}

.message.bot .message-content {
    border-left-color: var(--secondary);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%)
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0)
    }

    30% {
        transform: translateY(-10px)
    }
}

.input-container {
    border-top: 1px solid var(--border);
    padding-top: 20px
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end
}

.question-input {
    flex: 1;
    background: var(--background);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease
}

.question-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1)
}

.question-input::placeholder {
    color: var(--text-muted)
}

.send-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md)
}

.send-btn:disabled {
    background: var(--surface-light);
    cursor: not-allowed;
    opacity: 0.5
}

.input-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px
}

@media (max-width:768px) {
    .container {
        padding: 12px
    }

    .header {
        padding: 16px
    }

    .title {
        font-size: 20px
    }

    .logo-icon {
        font-size: 36px
    }

    .chat-container {
        height: calc(100vh - 180px);
        min-height: 500px
    }

    .question-chips {
        flex-direction: column
    }

    .question-chip {
        width: 100%;
        text-align: left
    }
}