/* =========================================
   PREMIUM RESPONSIVE CHAT WIDGET
   ZADKIEL GLOBAL PUBLISHING
========================================= */


/* =========================================
   FLOATING CHAT BUTTON
========================================= */

#chat-toggle {

    position: fixed;

    right: clamp(16px, 3vw, 35px);
    bottom: clamp(16px, 3vw, 35px);

    width: clamp(56px, 5vw, 68px);
    height: clamp(56px, 5vw, 68px);

    border: none;
    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #d4af37,
        #b8860b
    );

    color: white;

    font-size: clamp(22px, 2vw, 28px);

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, .25),
        0 0 0 6px rgba(212, 175, 55, .12);

    z-index: 99999;

    transition: .35s ease;

    animation: chatPulse 2.5s infinite;

}


/* Hover */

#chat-toggle:hover {

    transform: scale(1.1) rotate(5deg);

    box-shadow:

        0 15px 35px rgba(0, 0, 0, .35),

        0 0 0 10px rgba(
            212,
            175,
            55,
            .12
        );

}


/* =========================================
   ONLINE STATUS DOT
========================================= */

#chat-toggle::after {

    content: "";

    position: absolute;

    top: 3px;
    right: 3px;

    width: clamp(10px, 1vw, 14px);
    height: clamp(10px, 1vw, 14px);

    background: #22c55e;

    border: 3px solid white;

    border-radius: 50%;

}


/* =========================================
   PULSE ANIMATION
========================================= */

@keyframes chatPulse {

    0% {

        box-shadow:

            0 10px 25px rgba(0, 0, 0, .25),

            0 0 0 0 rgba(
                212,
                175,
                55,
                .5
            );

    }

    70% {

        box-shadow:

            0 10px 25px rgba(0, 0, 0, .25),

            0 0 0 14px rgba(
                212,
                175,
                55,
                0
            );

    }

    100% {

        box-shadow:

            0 10px 25px rgba(0, 0, 0, .25),

            0 0 0 0 rgba(
                212,
                175,
                55,
                0
            );

    }

}


/* =========================================
   CHAT WINDOW
========================================= */

#chat-box {

    position: fixed;

    right: clamp(16px, 3vw, 35px);

    bottom:

        calc(
            clamp(16px, 3vw, 35px)
            +
            clamp(56px, 5vw, 68px)
            +
            18px
        );

    width: min(380px, calc(100vw - 32px));

    max-height: min(650px, calc(100vh - 130px));

    background: white;

    border-radius: 20px;

    overflow: hidden;

    box-shadow:

        0 20px 60px rgba(
            0,
            0,
            0,
            .25
        );

    display: none;

    z-index: 99998;

    animation: chatOpen .35s ease;

}


/* =========================================
   OPENING ANIMATION
========================================= */

@keyframes chatOpen {

    from {

        opacity: 0;

        transform:
            translateY(25px)
            scale(.95);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


/* =========================================
   CHAT HEADER
========================================= */

.chat-header {

    position: relative;

    padding: clamp(16px, 2vw, 22px);

    background:

        linear-gradient(
            135deg,
            #041f54,
            #08214f
        );

    color: white;

    display: flex;

    justify-content: space-between;

    align-items: center;

}


/* Gold Line */

.chat-header::after {

    content: "";

    position: absolute;

    bottom: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background:

        linear-gradient(
            to right,
            #b8860b,
            #d4af37,
            #f5d76e,
            #d4af37,
            #b8860b
        );

}


/* Header Title */

.chat-header h3 {

    margin: 0;

    font-family: 'Montserrat', sans-serif;

    font-size: clamp(16px, 2vw, 19px);

    letter-spacing: .5px;

}


/* Online Indicator */

.chat-header h3::before {

    content: "●";

    color: #22c55e;

    font-size: 11px;

    margin-right: 8px;

}


/* Close Button */

#chat-close {

    width: 34px;
    height: 34px;

    background: rgba(
        255,
        255,
        255,
        .1
    );

    border: none;

    border-radius: 50%;

    color: white;

    font-size: 22px;

    cursor: pointer;

    transition: .3s ease;

}


#chat-close:hover {

    background: #d4af37;

    transform: rotate(90deg);

}


/* =========================================
   CHAT BODY
========================================= */

.chat-body {

    padding: clamp(18px, 3vw, 26px);

    background:

        linear-gradient(
            180deg,
            #ffffff,
            #f8f9fc
        );

}


/* Welcome Message */

.welcome-message {

    background: #f3f5fa;

    border-left: 4px solid #d4af37;

    padding: clamp(12px, 2vw, 16px);

    border-radius: 10px;

    color: #555;

    font-size: clamp(13px, 1.5vw, 15px);

    line-height: 1.7;

    margin-bottom: 18px;

}


/* =========================================
   INPUTS
========================================= */

.chat-body input {

    width: 100%;

    min-height: 46px;

    padding: 12px 14px;

    margin-top: 12px;

    border: 1px solid #e2e5eb;

    border-radius: 10px;

    box-sizing: border-box;

    font-family: inherit;

    font-size: 14px;

    outline: none;

    transition: .3s;

    background: white;

}


.chat-body input:focus {

    border-color: #d4af37;

    box-shadow:

        0 0 0 3px rgba(
            212,
            175,
            55,
            .12
        );

}


/* =========================================
   START CHAT BUTTON
========================================= */

#start-chat {

    width: 100%;

    min-height: 46px;

    margin-top: 20px;

    padding: 13px;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    background:

        linear-gradient(
            135deg,
            #b8860b,
            #d4af37
        );

    color: white;

    font-size: 14px;

    font-weight: 600;

    letter-spacing: .5px;

    transition: .3s ease;

}



#start-chat:hover {

    transform: translateY(-2px);

    box-shadow:

        0 8px 18px rgba(
            184,
            134,
            11,
            .3
        );

}


/* =========================================
   SMALL MOBILE PHONES
   320px - 380px
========================================= */

@media screen and (max-width: 380px) {

    #chat-toggle {

        width: 54px;
        height: 54px;

        right: 14px;
        bottom: 14px;

        font-size: 21px;

    }

    #chat-box {

        right: 10px;

        bottom: 82px;

        width: calc(100vw - 20px);

        border-radius: 16px;

    }

    .chat-body {

        padding: 16px;

    }

    .welcome-message {

        font-size: 13px;

    }

}


/* =========================================
   NORMAL MOBILE PHONES
   381px - 600px
========================================= */

@media screen and (min-width: 381px)
and (max-width: 600px) {

    #chat-toggle {

        right: 18px;
        bottom: 18px;

    }

    #chat-box {

        right: 15px;

        bottom: 92px;

        width: calc(100vw - 30px);

    }

}


/* =========================================
   TABLETS
   601px - 992px
========================================= */

@media screen and (min-width: 601px)
and (max-width: 992px) {

    #chat-box {

        width: 370px;

    }

}


/* =========================================
   LAPTOPS & DESKTOPS
   993px - 1600px
========================================= */

@media screen and (min-width: 993px)
and (max-width: 1600px) {

    #chat-box {

        width: 380px;

    }

}


/* =========================================
   LARGE SCREENS
   1601px+
========================================= */

@media screen and (min-width: 1601px) {

    #chat-box {

        width: 420px;

    }

    .chat-body {

        padding: 30px;

    }

}


/* =========================================
   REDUCE ANIMATION FOR USERS
   WHO PREFER LESS MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    #chat-toggle,
    #chat-box {

        animation: none;

    }

    #chat-toggle,
    #chat-close,
    #start-chat {

        transition: none;

    }

}

/* =========================================
   CHAT MESSAGES
========================================= */

#messages {

    height: 260px;

    overflow-y: auto;

    padding: 14px;

    background:
        linear-gradient(
            180deg,
            #f8f9fc,
            #f1f4f8
        );

    border-radius: 12px;

    margin-bottom: 15px;

    display: flex;

    flex-direction: column;

    gap: 8px;

    scroll-behavior: smooth;

}


/* =========================================
   CUSTOM SCROLLBAR
========================================= */

#messages::-webkit-scrollbar {

    width: 6px;

}

#messages::-webkit-scrollbar-track {

    background: transparent;

}

#messages::-webkit-scrollbar-thumb {

    background: #d4af37;

    border-radius: 20px;

}


/* =========================================
   VISITOR MESSAGE — RIGHT
========================================= */

.visitor-message {

    align-self: flex-end;

    background: white;

    color: #333;

    padding: 11px 14px;

    border-radius:
        6px
        16px
        16px
        16px;

    margin: 0;

    width: fit-content;

    max-width: 78%;

    overflow-wrap: anywhere;

    word-break: break-word;

    line-height: 1.5;

    font-size: 14px;

    box-shadow:
        0 3px 10px
        rgba(0, 0, 0, .06);

    border: 1px solid #e9edf3;

    animation:
        messageIn .25s ease;

}


/* =========================================
   ADMIN MESSAGE — LEFT
========================================= */

.admin-message {

    align-self: flex-start;

    background:
        linear-gradient(
            135deg,
            #08214f,
            #0d3478
        );

    color: white;

    padding: 11px 14px;

    border-radius:
        16px
        6px
        16px
        16px;

    margin: 0;

    width: fit-content;

    max-width: 78%;

    overflow-wrap: anywhere;

    word-break: break-word;

    line-height: 1.5;

    font-size: 14px;

    box-shadow:
        0 4px 12px
        rgba(4, 31, 84, .18);

    animation:
        messageIn .25s ease;

}


/* =========================================
   MESSAGE ANIMATION
========================================= */

@keyframes messageIn {

    from {

        opacity: 0;

        transform:
            translateY(6px)
            scale(.98);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


/* =========================================
   MESSAGE INPUT AREA
========================================= */

.message-input-area {

    display: flex;

    align-items: center;

    gap: 9px;

    padding-top: 4px;

}


/* =========================================
   MESSAGE INPUT
========================================= */

#message-input {

    flex: 1;

    width: auto;

    min-height: 46px;

    margin: 0;

    padding:
        11px
        14px;

    border:
        1px solid
        #dfe3ea;

    border-radius: 12px;

    background: white;

    color: #333;

    font-size: 14px;

    outline: none;

    box-sizing: border-box;

    transition:
        border-color .25s ease,
        box-shadow .25s ease;

}


#message-input::placeholder {

    color: #9aa1ad;

}


#message-input:focus {

    border-color: #d4af37;

    box-shadow:
        0 0 0 3px
        rgba(
            212,
            175,
            55,
            .12
        );

}


/* =========================================
   SEND BUTTON
========================================= */

#send-message {

    flex-shrink: 0;

    width: 48px;

    height: 46px;

    border: none;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #b8860b,
            #d4af37
        );

    color: white;

    cursor: pointer;

    font-size: 18px;

    display: flex;

    align-items: center;

    justify-content: center;

    box-shadow:
        0 5px 14px
        rgba(
            184,
            134,
            11,
            .25
        );

    transition:
        transform .2s ease,
        box-shadow .2s ease;

}


#send-message:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 8px 18px
        rgba(
            184,
            134,
            11,
            .32
        );

}


#send-message:active {

    transform:
        translateY(0)
        scale(.96);

}


/* =========================================
   DISABLED SEND BUTTON
========================================= */

#send-message:disabled {

    opacity: .55;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;

}


/* =========================================
   MOBILE CHAT
========================================= */

@media screen and (max-width: 600px) {

    #messages {

        height: 280px;

        padding: 12px;

    }

    .visitor-message,
    .admin-message {

        max-width: 84%;

        font-size: 13px;

        padding:
            10px
            12px;

    }

    #message-input {

        font-size: 14px;

    }

}

/* =========================================================
   CHAT ONLINE / TYPING STATUS
========================================================= */

.chat-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#chat-status {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-top: 3px;

    font-size: 11px;
    line-height: 1.2;

    color: rgba(255,255,255,.70);
}

.status-dot {
    width: 7px;
    height: 7px;

    min-width: 7px;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        0 0 0 3px rgba(34,197,94,.12);
}

.status-dot.offline {
    background: #9ca3af;

    box-shadow:
        0 0 0 3px rgba(156,163,175,.12);
}

.status-dot.typing {
    background: #d4af37;

    box-shadow:
        0 0 0 3px rgba(212,175,55,.12);
}