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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    height: 80vh;
}

.chatbot-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    width: 70%;
    overflow: hidden;
}

.chatbot-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-text {
    font-size: 12px;
    font-weight: bold;
    color: #1e3c72;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chatbot-header h1 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.status {
    font-size: 0.9rem;
    opacity: 0.8;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.streaming-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    color: white;
    font-size: 0.9rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4CAF50;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.language-toggle select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.language-toggle select option {
    background: #1e3c72;
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
}

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

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

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

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

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

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

.message-content a {
    color: #2a5298;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.message-content a:hover {
    color: #1e3c72;
}

.user-message .message-content a {
    color: #fff;
    text-decoration: underline;
}

.user-message .message-content a:hover {
    color: #f0f0f0;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e3c72;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

.chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.message-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.message-input:focus {
    border-color: #1e3c72;
}

.send-button {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.send-button:active {
    transform: scale(0.95);
}

.info-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 25px;
    width: 30%;
    height: fit-content;
}

.quick-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.info-panel h2 {
    color: #1e3c72;
    margin: 0;
    font-size: 1.3rem;
}

.language-toggle {
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: #e9ecef;
    color: #1e3c72;
}

.lang-btn.active {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-color: #1e3c72;
}

.info-panel h3 {
    color: #1e3c72;
    margin: 25px 0 15px 0;
    font-size: 1.1rem;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.topics-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-size: 0.9rem;
}

.topics-list li:last-child {
    border-bottom: none;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: 95vh;
    }

    .chatbot-container {
        width: 100%;
        height: 70%;
    }

    .info-panel {
        width: 100%;
        height: 25%;
        overflow-y: auto;
    }

    .chatbot-header {
        padding: 15px;
    }

    .chatbot-header h1 {
        font-size: 1.2rem;
    }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

.source-indicator {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}

.source-indicator small {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6c757d;
}

.user-message .source-indicator small {
    color: rgba(255, 255, 255, 0.8);
}