/* =========================
   DRIN WEBSITE CHAT - CLEAN VERSION
========================= */

/* FLOAT BUTTON */

.chat-float-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00bcd4;
    box-shadow: 0 8px 22px rgba(0, 188, 212, 0.35);
}

/* =========================
   CHAT MODAL
========================= */

.website-chat-modal {
    border-radius: 22px 22px 0 0;

    position: fixed;
    right: 20px;
    bottom: 92px;

    width: 440px;
    max-width: calc(100vw - 24px);

    height: 560px;
    max-height: calc(100vh - 130px);

    background: #fff;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);

    display: none;
    overflow: hidden;

    z-index: 5000;
}

.website-chat-modal.show {
    display: flex;
}


.website-chat-box {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}


/* =========================
   HEADER
========================= */

.website-chat-header {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: #fff;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.website-chat-header img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.website-chat-header strong {
    font-size: 15px;
}

.website-chat-header small {
    font-size: 12px;
    opacity: .9;
}


.website-chat-close {

    margin-left: auto;

    border: none;

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.28);

    backdrop-filter: blur(8px);

    color: #fff;

    font-size: 18px;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition: 0.2s ease;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.website-chat-close:hover {

    background: rgba(255, 255, 255, 0.35);

    transform: scale(1.08);
}

/* =========================
   MESSAGES
========================= */

.website-chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f8fafc;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    display: inline-block;
    width: fit-content;
    max-width: 75%;
    padding: 10px 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-msg.customer {
    background: #00bcd4;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-msg.admin,
.chat-msg.system {
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* =========================
   INPUT ROW (CLEAN FIXED)
========================= */

.website-chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

#websiteChatInput {
    flex: 1;
    height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 14px;
    outline: none;
}

/* BUTTONS (emoji, attach, send) */

/* 😊 + 📎 buttons */
.website-chat-input-row button {
    width: 40px;
    height: 40px;

    border: none;
    background: transparent;

    font-size: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

/* 🚀 SEND BUTTON */

.website-chat-input-row button:last-child {
    background: #00bcd4;
    color: white;

    border-radius: 999px;

    padding: 0 14px;

    min-width: 64px;

    width: auto;

    font-weight: bold;

    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.35);

    flex-shrink: 0;
}

/* =========================
   EMOJI PANEL
========================= */

#emojiPanel {
    position: absolute;
    bottom: 70px;
    left: 10px;
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-size: 20px;
    z-index: 9999;
}

/* =========================
   TYPING INDICATOR
========================= */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    width: fit-content;
    margin-bottom: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.2s infinite ease-in-out;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(.7);
        opacity: .5;
    }

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

@media (max-width: 768px) {

    .website-chat-header {
        border-radius: 18px 18px 0 0;
        flex-shrink: 0;
    }

    .website-chat-modal {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 70px !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 65vh !important;
        max-height: 65vh !important;
        border-radius: 18px 18px 0 0 !important;
        overflow: hidden !important;
        flex-direction: column !important;
        transform: none !important;
        margin: 0 !important;
    }

    .website-chat-modal.show {
        display: flex !important;
    }

    .website-chat-modal:not(.show) {
        display: none !important;
    }

}

/* =========================
   ONLINE STATUS
========================= */

.messenger-float::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 5px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .7);
    animation: onlinePulse 1.6s infinite;
}

@keyframes onlinePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .7);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* =========================
   MEDIA (FUTURE READY)
========================= */

.chat-image {
    max-width: 320px;
    width: 100%;

    border-radius: 14px;

    display: block;
}

.chat-video {
    max-width: 340px;
    width: 100%;

    border-radius: 14px;

    display: block;
}

.messenger-float {
    position: fixed;

    right: 18px;

    bottom: 18px;

    z-index: 99999;

    border: none;

    background: transparent !important;

    overflow: visible;

    cursor: pointer;
}

.chat-unread-badge {
    position: absolute;

    top: -6px;
    right: -6px;

    min-width: 22px;
    height: 22px;

    padding: 0 6px;

    border-radius: 999px;

    background: #ef4444;

    color: white;

    font-size: 12px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid white;

    z-index: 999999;
}

.mobile-nav-item {
    position: relative;
}

.website-chat-modal,
.website-chat-box {
    box-sizing: border-box;
}

.website-chat-input-row {
    flex-wrap: nowrap;
    box-sizing: border-box;
    overflow: visible;
}

.website-chat-input-row button:last-child {
    flex-shrink: 0;
}

.mobile-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
}

.mobile-nav-item {
    position: relative;
}

#mobileChatUnreadBadge {
    position: absolute !important;

    top: -4px !important;
    right: 28px !important;

    z-index: 999999 !important;
}

@media (min-width: 769px) {

    .website-chat-modal {
        width: 440px !important;
    }

    .website-chat-box {
        width: 440px !important;
    }

}

.chat-unread-badge,
#mobileChatUnreadBadge {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 0 0 3px rgba(0, 0, 0, .45) !important;
}

@media (max-width: 768px) {

    .chat-unread-badge,
    #mobileChatUnreadBadge {
        color: #ffffff !important;
        font-weight: 800 !important;
    }
}

/* =========================
   CHAT CLICKABLE LINKS
========================= */

.chat-msg a {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.chat-msg a:hover {
    text-decoration: underline;
}

/* ===== Guest Name Form ===== */

.guest-name-form {
    padding: 20px;
    text-align: center;
}

.guest-name-form p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #333;
}

#guestNameInput {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    margin-bottom: 12px;
    font-size: 14px;
    box-sizing: border-box;
}

.guest-name-form button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.guest-name-form button:hover {
    opacity: 0.9;
}

/* chat area after form */

#chatMainUI {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
}

#chatMainUI.active {
    display: flex;
}

#chatMainUI .website-chat-messages {
    flex: 1;
    min-height: 0;
}