/* ARC Chatbot Widget */
.arc-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* Floating toggle button */
.arc-chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1d2327;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    position: absolute;
    bottom: 0;
    right: 0;
}

.arc-chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.arc-chatbot-toggle.arc-chatbot-active {
    display: none;
}

/* Chat window */
.arc-chatbot-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    height: min(680px, calc(100vh - 100px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.25s, transform 0.25s;
}

.arc-chatbot-window.arc-chatbot-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.arc-chatbot-window.arc-chatbot-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.arc-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #1d2327;
    color: #fff;
    flex-shrink: 0;
}

.arc-chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.arc-chatbot-header-left i {
    font-size: 18px;
}

.arc-chatbot-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.arc-chatbot-header-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.15s;
}

.arc-chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Messages area */
.arc-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.arc-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.arc-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.arc-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Message bubbles */
.arc-chatbot-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    animation: arc-chatbot-fade-in 0.25s ease;
}

@keyframes arc-chatbot-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.arc-chatbot-bot {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.arc-chatbot-user {
    background: #1d2327;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.arc-chatbot-bubble p {
    margin: 0 0 6px;
}

.arc-chatbot-bubble p:last-child {
    margin-bottom: 0;
}

.arc-chatbot-bubble ul {
    margin: 6px 0;
    padding-left: 0;
    list-style: none;
}

.arc-chatbot-bubble ul li {
    padding: 3px 0;
    font-size: 14px;
}

.arc-chatbot-bubble ul li i {
    width: 18px;
    margin-right: 6px;
    color: #64748b;
    text-align: center;
}

.arc-chatbot-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px !important;
}

/* Links inside bot messages */
.arc-chatbot-bot a {
    color: #2563eb;
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    transition: text-decoration-color 0.15s;
}

.arc-chatbot-bot a:hover {
    text-decoration-color: #2563eb;
}

.arc-chatbot-bot ol {
    margin: 6px 0;
    padding-left: 20px;
}

.arc-chatbot-bot ol li {
    margin-bottom: 4px;
    font-size: 14px;
}

.arc-chatbot-bot strong {
    font-weight: 600;
}

/* Result cards within bot messages */
.arc-chatbot-results {
    margin-top: 8px;
}

.arc-chatbot-result-section {
    margin-bottom: 8px;
}

.arc-chatbot-result-section:last-child {
    margin-bottom: 0;
}

.arc-chatbot-result-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 6px;
}

.arc-chatbot-result-item {
    display: block;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.arc-chatbot-result-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    text-decoration: none;
}

.arc-chatbot-result-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}

.arc-chatbot-result-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    display: block;
}

.arc-chatbot-result-meta span {
    margin-right: 8px;
}

/* Typing indicator */
.arc-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}

.arc-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: arc-chatbot-typing 1.4s infinite;
}

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

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

@keyframes arc-chatbot-typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Input area */
.arc-chatbot-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
    flex-shrink: 0;
}

.arc-chatbot-input-area input {
    flex: 1;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.15s;
}

.arc-chatbot-input-area input:focus {
    border-color: #94a3b8;
}

.arc-chatbot-input-area input::placeholder {
    color: #94a3b8;
}

.arc-chatbot-send-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #1d2327;
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.arc-chatbot-send-btn:hover {
    background: #2d3339;
}

.arc-chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Fullscreen / expanded mode */
body.arc-chatbot-body-lock {
    overflow: hidden !important;
}

.arc-chatbot-widget.arc-chatbot-fullscreen {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

.arc-chatbot-widget.arc-chatbot-fullscreen .arc-chatbot-window {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}

.arc-chatbot-widget.arc-chatbot-fullscreen .arc-chatbot-toggle {
    display: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .arc-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }

    .arc-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        max-height: none;
        border-radius: 12px;
    }

    .arc-chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

@media (max-width: 380px) {
    .arc-chatbot-window {
        width: calc(100vw - 16px);
        right: -2px;
    }
}
