/* YBM Assistant Chat CSS */

:root {
    --ybm-primary: #1a5f7a;
    --ybm-primary-hover: #134b61;
    --ybm-secondary: #f4f7f6;
    --ybm-text: #333;
    --ybm-white: #ffffff;
    --ybm-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ybm-radius: 8px;
}

.ybm-chat-inline,
.ybm-chat-popup-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: var(--ybm-radius);
    background: var(--ybm-white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--ybm-shadow);
}

.ybm-chat-inline {
    width: 600px;
    max-width: 100%;
    height: 600px;
    margin: 30px auto;
}

.ybm-chat-header {
    background: linear-gradient(135deg, var(--ybm-primary) 0%, var(--ybm-primary-hover) 100%);
    color: var(--ybm-white);
    padding: 16px 20px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ybm-chat-header #ybm-chat-close {
    cursor: pointer;
    font-size: 20px;
}

.ybm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--ybm-secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ybm-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ybm-msg.user {
    align-self: flex-end;
    background: var(--ybm-primary);
    color: var(--ybm-white);
}

.ybm-msg.assistant {
    align-self: flex-start;
    background: #e1e9eb;
    color: var(--ybm-text);
    border-bottom-left-radius: 2px;
}

.ybm-msg.error {
    background: #ffdada;
    color: #cc0000;
}

.ybm-suggestions-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.ybm-suggestion {
    display: inline-block;
    padding: 8px 14px;
    background: var(--ybm-white);
    border: 1px solid var(--ybm-primary);
    color: var(--ybm-primary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 5px;
    margin-bottom: 10px;
    transition: all 0.2s;
    font-weight: 600;
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ybm-suggestion:hover {
    background: var(--ybm-primary);
    color: var(--ybm-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ybm-chat-input-area {
    padding: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: var(--ybm-white);
}

.ybm-chat-input-area textarea {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    resize: none;
    height: 60px;
    font-size: 14px;
    outline: none;
    box-shadow: none !important;
}

.ybm-chat-input-area button {
    background: var(--ybm-primary);
    color: var(--ybm-white);
    border: none;
    padding: 0 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.ybm-chat-input-area button:hover {
    background: var(--ybm-primary-hover);
}

.ybm-chat-input-area button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ybm-chat-popup-container {
    position: fixed !important;
    bottom: 110px !important;
    right: 30px !important;
    left: auto !important;
    width: 420px !important;
    height: 650px !important;
    z-index: 2147483647 !important;
    /* Maximum possible z-index to stay on top */
    max-width: 90vw;
    max-height: 80vh;
}

.ybm-chat-popup-toggle {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    left: auto !important;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    z-index: 2147483647 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ybm-chat-popup-toggle:hover {
    transform: scale(1.05) translateY(-2px);
}

.ybm-chat-popup-badge {
    background: var(--ybm-primary);
    color: var(--ybm-white);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    border: 2px solid var(--ybm-white);
    order: 1;
    /* Keep text on the left of the icon */
}

.ybm-chat-icon-circle {
    width: 70px;
    height: 70px;
    background: var(--ybm-primary);
    color: var(--ybm-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--ybm-white);
    order: 2;
}

.ybm-chat-icon-circle span {
    margin: 30px auto;
}

.ybm-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ybm-typing span {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: ybm-bounce 1s infinite;
}

.ybm-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ybm-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ybm-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Overlay Styling */
.ybm-chat-inline,
.ybm-chat-popup-container {
    position: relative;
}

.ybm-chat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.ybm-chat-overlay-content {
    max-width: 280px;
}

.ybm-chat-overlay-content h4 {
    color: var(--ybm-primary);
    margin: 0 0 15px 0;
    font-size: 18px;
}

.ybm-chat-overlay-content p {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 12px;
}

.ybm-chat-overlay-content label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    margin: 20px 0;
    cursor: pointer;
    color: var(--ybm-text);
}

.ybm-chat-overlay-content button {
    background: var(--ybm-primary);
    color: var(--ybm-white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ybm-chat-overlay-content button:hover:not(:disabled) {
    background: var(--ybm-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.ybm-chat-overlay-content button:active:not(:disabled) {
    transform: translateY(0);
}

.ybm-chat-overlay-content button:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 480px) {
    .ybm-chat-popup-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .ybm-chat-popup-badge {
        display: none;
    }

    .ybm-chat-popup-toggle {
        bottom: 15px;
        right: 15px;
    }

    .ybm-chat-icon-circle {
        width: 55px;
        height: 55px;
    }
}