﻿/* Trợ lý học tập tiểu học - Scoped Widget Styles */
.la-widget-root {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #102a43;
}

.la-widget-root.la-embedded-mode {
    position: static;
    width: 100%;
    height: 100%;
}

.la-widget-launcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0b6bcb;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 999px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(11, 107, 203, 0.35);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.la-widget-launcher:hover,
.la-widget-launcher:focus {
    background: #08519c;
    transform: translateY(-1px);
    outline: 3px solid #fbd38d;
}

.la-widget-panel {
    display: none;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 550px;
    max-height: calc(100vh - 36px);
    background: #ffffff;
    border: 1px solid #bcccdc;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(16, 42, 67, 0.24);
    overflow: hidden;
    transition: width 0.2s ease, height 0.2s ease;
}

.la-widget-panel.la-open {
    display: flex;
}

.la-widget-panel.la-expanded {
    width: 720px;
    max-width: calc(100vw - 36px);
    height: 78vh;
    max-height: calc(100vh - 36px);
}

.la-embedded-mode .la-widget-panel {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
}

.la-widget-header {
    background: linear-gradient(135deg, #0b6bcb 0%, #1985a1 100%);
    color: #ffffff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.la-widget-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.la-widget-subtitle {
    font-size: 11px;
    opacity: 0.92;
    margin: 2px 0 0 0;
}

.la-widget-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.la-icon-btn {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.la-icon-btn:hover,
.la-icon-btn:focus {
    background: rgba(255, 255, 255, 0.32);
    outline: 2px solid #fbd38d;
}

.la-widget-controls {
    background: #f0f4f8;
    border-bottom: 1px solid #d9e2ec;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
}

.la-widget-controls select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #9fb3c8;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    color: #102a43;
}

.la-widget-notices {
    background: #fffbeb;
    border-bottom: 1px solid #f6e05e;
    padding: 6px 10px;
    font-size: 11.5px;
    color: #744210;
}

.la-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.la-msg {
    max-width: 88%;
    padding: 9px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.la-msg-user {
    align-self: flex-end;
    background: #0b6bcb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.la-msg-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #102a43;
    border: 1px solid #d9e2ec;
    border-bottom-left-radius: 4px;
}

.la-msg-safety {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #742a2a;
}

.la-msg-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    color: #0b6bcb;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 999px;
    padding: 2px 9px;
    margin-bottom: 6px;
}

.la-msg-meta {
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px dashed #d9e2ec;
    font-size: 11.5px;
    color: #486581;
}

.la-msg-followup {
    margin-top: 6px;
    font-style: italic;
    color: #0b6bcb;
    font-size: 13px;
}

.la-action-chip {
    display: inline-block;
    margin-top: 6px;
    margin-right: 6px;
    padding: 4px 9px;
    background: #ebf8ff;
    color: #0b6bcb;
    border: 1px solid #90cdf4;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.la-action-chip:hover,
.la-action-chip:focus {
    background: #bee3f8;
    outline: 2px solid #0b6bcb;
}

.la-suggestions {
    padding: 6px 10px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 74px;
    overflow-y: auto;
}

.la-sugg-btn {
    background: #edf2f7;
    color: #1a365d;
    border: 1px solid #cbd5e0;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}

.la-sugg-btn:hover,
.la-sugg-btn:focus {
    background: #dbeafe;
    border-color: #60a5fa;
    outline: 2px solid #2563eb;
}

.la-widget-inputbar {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: #ffffff;
    border-top: 1px solid #d9e2ec;
    align-items: flex-end;
}

.la-widget-inputbar textarea {
    flex: 1;
    resize: none;
    height: 40px;
    max-height: 92px;
    padding: 8px 10px;
    border: 1px solid #9fb3c8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    box-sizing: border-box;
}

.la-widget-inputbar textarea:focus {
    outline: 2px solid #0b6bcb;
    border-color: #0b6bcb;
}

.la-send-btn {
    background: #0b6bcb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 14px;
    height: 40px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
}

.la-send-btn:disabled {
    background: #9fb3c8;
    cursor: not-allowed;
}

.la-typing {
    align-self: flex-start;
    font-size: 12.5px;
    color: #486581;
    background: #edf2f7;
    padding: 6px 10px;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .la-expand-btn {
        display: none !important;
    }

    .la-widget-root {
        right: 10px;
        bottom: 10px;
    }

    .la-widget-panel {
        position: fixed;
        left: 6px;
        right: 6px;
        bottom: 6px;
        width: auto;
        max-width: none;
        height: 82vh;
        max-height: 82vh;
        border-radius: 14px;
    }
}
