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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #16213e;
    padding: 16px 24px;
    border-bottom: 2px solid #0f3460;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 {
    font-size: 20px;
    color: #e94560;
    font-weight: 700;
}

.header p {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.status-badge {
    background: #0f3460;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #4ecca3;
    border: 1px solid #4ecca3;
}

/* Main Layout */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Panel */
.left-panel {
    width: 300px;
    background: #16213e;
    border-right: 1px solid #0f3460;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Upload Section */
.upload-area {
    border: 2px dashed #0f3460;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.05);
}

.upload-area.uploaded {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.05);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 13px;
    color: #888;
}

.upload-text strong {
    color: #e94560;
    display: block;
    margin-bottom: 4px;
}

.upload-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

.upload-status.success {
    background: rgba(78, 204, 163, 0.1);
    color: #4ecca3;
    border: 1px solid #4ecca3;
}

.upload-status.error {
    background: rgba(233, 69, 96, 0.1);
    color: #e94560;
    border: 1px solid #e94560;
}

.upload-status.loading {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

/* Mode Card */
.mode-card {
    background: #0f3460;
    border-radius: 8px;
    padding: 14px;
}

.mode-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.mode-value {
    font-size: 14px;
    font-weight: 600;
    color: #4ecca3;
}

.domain-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
    border: 1px solid #e94560;
    text-transform: capitalize;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-card {
    background: #0f3460;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #4ecca3;
}

.stat-label {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* Clear Button */
.btn-clear {
    background: transparent;
    border: 1px solid #e94560;
    color: #e94560;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: rgba(233, 69, 96, 0.1);
}

/* Chat Panel */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 3px;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.welcome-message h2 {
    font-size: 24px;
    color: #e94560;
    margin-bottom: 10px;
}

.welcome-message p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 20px;
}

.example-queries {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.example-query {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
}

.example-query:hover {
    border-color: #e94560;
    color: #e94560;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.bot {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #e94560;
}

.message.bot .message-avatar {
    background: #0f3460;
}

.message-content {
    background: #16213e;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #0f3460;
}

.message.user .message-content {
    background: #0f3460;
    border-color: #e94560;
    color: #fff;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    color: #4ecca3;
    margin: 10px 0 6px;
    font-size: 14px;
}

.message-content strong {
    color: #4ecca3;
}

.message-content p {
    margin-bottom: 8px;
}

.message-content ul,
.message-content ol {
    margin-left: 20px;
    margin-bottom: 8px;
}

.message-content hr {
    border-color: #0f3460;
    margin: 10px 0;
}

.message-meta {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
    display: flex;
    gap: 10px;
}

.meta-badge {
    background: #0f3460;
    padding: 2px 8px;
    border-radius: 10px;
    color: #888;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #16213e;
    border-radius: 12px;
    border: 1px solid #0f3460;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ecca3;
    animation: typing 1.4s 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); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Input Area */
.input-area {
    background: #16213e;
    border-top: 1px solid #0f3460;
    padding: 16px 20px;
}

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

.input-box {
    flex: 1;
    background: #0f3460;
    border: 1px solid #1a4a7a;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 14px;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.input-box:focus {
    border-color: #e94560;
}

.input-box::placeholder {
    color: #555;
}

.btn-send {
    background: #e94560;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-send:hover {
    background: #c73652;
}

.btn-send:disabled {
    background: #555;
    cursor: not-allowed;
}

.input-hint {
    font-size: 11px;
    color: #555;
    margin-top: 6px;
    text-align: center;
}

/* Disclaimer */
.disclaimer {
    font-size: 11px;
    color: #555;
    text-align: center;
    padding: 6px;
    border-top: 1px solid #0f3460;
}