/* Widget Launcher */
@font-face {
    font-family: 'Ador Noirrit';
    src: url('https://cdn.jsdelivr.net/gh/lipighor/Free-Fonts@master/AdorNoirrit/AdorNoirrit.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

#dopi-fullscreen-trigger,
#dopi-overlay,
#dopi-chat-modal {
    position: fixed;
    z-index: 999999;
    font-family: 'Bai Jamjuree', 'Ador Noirrit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#dopi-fullscreen-trigger {
    bottom: 24px;
    right: 24px;
}

#dopi-launcher {
    width: 60px;
    height: 60px;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#dopi-launcher svg {
    width: 30px;
    height: 30px;
}

/* Launcher Notification Popup */
#dopi-notification-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 15px;
    z-index: 100000;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom right;
}

#dopi-popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 18px;
    cursor: pointer;
    color: #888;
}

#dopi-popup-close:hover {
    color: #333;
}

.dopi-popup-content {
    margin-top: 5px;
}

.dopi-popup-slide-in {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
}

/* Fullscreen Overlay according to provided image */
#dopi-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

#dopi-overlay-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.dopi-overlay-content {
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.dopi-overlay-header {
    color: white;
    font-size: 16px;
    margin-bottom: 30px;
}

.dopi-big-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: white;
    color: #333;
    padding: 20px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.dopi-big-btn:hover {
    transform: translateY(-2px);
}

#dopi-new-conv-btn {
    justify-content: space-between;
}

/* Chat Modal */
#dopi-chat-modal {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 550px;
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#dopi-modal-header {
    color: white;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#dopi-auth-screen {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

#dopi-chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#dopi-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dopi-msg {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.dopi-user {
    background: #e11d48;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.dopi-bot {
    background: white;
    color: #333;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

#dopi-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #eee;
    background: white;
}

#dopi-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#dopi-send {
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dopi-hidden {
    display: none !important;
}

/* Mobile Responsiveness & Accessibility */
@media (max-width: 480px) {
    #dopi-chat-modal {
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        max-height: none !important;
        border-radius: 0 !important;
    }

    #dopi-modal-header {
        border-radius: 0 !important;
    }

    #dopi-fullscreen-trigger {
        bottom: 16px;
        right: 16px;
    }
}

.dopi-date-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
    user-select: none;
}

.dopi-date-divider span {
    background: #f8fafc;
    padding: 0 10px;
    color: #64748b;
    font-size: 11px;
    z-index: 1;
    position: relative;
    font-weight: 600;
}

.dopi-date-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: #e2e8f0;
    z-index: 0;
}

.dopi-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
    margin-top: 5px;
}

.dopi-typing-dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: dopi-typing 1.4s infinite ease-in-out both;
}

.dopi-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dopi-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dopi-typing {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}