/* Chat Widget Styles */
.chat-widget-btn {
    position: fixed;
    bottom: 70px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f4a024;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(244, 160, 36, 0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.chat-widget-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(244, 160, 36, 0.5);
}
.chat-widget-btn i {
    font-size: 24px;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 70px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.25s ease-out;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.chat-header {
    background: #1a3a5c;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4a024;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.chat-header-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.chat-header-info span {
    font-size: 11px;
    opacity: 0.7;
}
.chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
    padding: 4px;
}
.chat-close-btn:hover {
    opacity: 1;
}

/* Tabs */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.chat-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.chat-tab.active {
    color: #1a3a5c;
    border-bottom-color: #f4a024;
}
.chat-tab:hover {
    color: #1a3a5c;
}

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

/* Message Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-line;
}
.chat-msg-bot {
    background: #f0f2f5;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg-user {
    background: #1a3a5c;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-msg-typing {
    background: #f0f2f5;
    color: #888;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    font-style: italic;
}

/* Search Results */
.chat-search-result {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: default;
}
.chat-search-result h5 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
}
.chat-search-result p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-search-result .chat-result-cat {
    display: inline-block;
    font-size: 10px;
    background: #f4a024;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Agent Handoff Prompt */
.chat-agent-prompt {
    background: #f0f7ff;
    border: 1px solid #c8ddf5;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.chat-agent-prompt p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #1a3a5c;
    font-weight: 500;
    line-height: 1.5;
}
.chat-agent-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.chat-agent-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.15s;
}
.chat-agent-btn:hover {
    opacity: 0.85;
    text-decoration: none;
}
.chat-agent-btn-primary {
    background: #f4a024;
    color: #fff;
}
.chat-agent-btn-primary:hover,
.chat-agent-btn-primary:focus {
    color: #fff;
}
.chat-agent-btn-secondary {
    background: #1a3a5c;
    color: #fff;
}
.chat-agent-btn-secondary:hover,
.chat-agent-btn-secondary:focus {
    color: #fff;
}
.chat-agent-info {
    font-size: 11px !important;
    color: #888 !important;
    font-weight: 400 !important;
    margin-bottom: 0 !important;
    line-height: 1.8 !important;
}

/* Input Area */
.chat-input-area {
    border-top: 1px solid #e8e8e8;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.chat-input-area input[type="text"] {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.chat-input-area input[type="text"]:focus {
    border-color: #f4a024;
}
.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4a024;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.chat-send-btn:hover {
    background: #e0900f;
}
.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.chat-attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    color: #888;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.chat-attach-btn:hover {
    color: #f4a024;
    border-color: #f4a024;
}

/* Image Preview */
.chat-image-preview {
    padding: 6px 12px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafafa;
    flex-shrink: 0;
}
.chat-image-preview img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.chat-image-preview .chat-remove-img {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}
.chat-msg-user img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

/* Disclaimer */
.chat-disclaimer {
    padding: 6px 12px;
    background: #fff8ed;
    border-top: 1px solid #fde9c8;
    font-size: 10px;
    color: #b87a00;
    text-align: center;
    flex-shrink: 0;
}

/* FAQ Grid */
.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.faq-card {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 16px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.faq-card:hover {
    border-color: #f4a024;
    box-shadow: 0 2px 12px rgba(244, 160, 36, 0.15);
}
.faq-card i {
    font-size: 24px;
    color: #f4a024;
    margin-bottom: 8px;
    display: block;
}
.faq-card h5 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
}
.faq-card-count {
    font-size: 11px;
    color: #999;
}
.faq-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
    margin: 4px 0 10px;
    padding: 0 4px;
}

/* FAQ List */
.faq-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: border-color 0.15s;
}
.faq-list-item:hover {
    border-color: #f4a024;
}
.faq-list-item i {
    color: #ccc;
    font-size: 11px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* FAQ Suggestions (in Ask tab) */
.chat-faq-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.faq-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff8ee;
    border: 1px solid #f4a024;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.15s;
}
.faq-suggestion-item:hover {
    background: #fef0d5;
}
.faq-suggestion-item > i:first-child {
    color: #f4a024;
    font-size: 14px;
    flex-shrink: 0;
}

/* FAQ Article */
.faq-article {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px;
}
.faq-article h5 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1a3a5c;
}
.faq-article p {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}

/* FAQ Back Button */
.faq-back-btn {
    background: none;
    border: none;
    color: #1a3a5c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.faq-back-btn:hover {
    color: #f4a024;
}

/* FAQ Expanded Window */
.chat-window.faq-expanded {
    height: 620px;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        bottom: 8px;
        right: 8px;
        border-radius: 10px;
    }
    .chat-window.faq-expanded {
        height: calc(100vh - 100px);
    }
}
