/* =========================================
   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:10px;
    background:#f8f8f8;
    border-radius:10px;
    margin-bottom:15px;
}

.system-message{
    background:#eaf4ff;
    color:#0d47a1;
    padding:10px 14px;
    border-radius:10px;
    margin-bottom:10px;
    display:inline-block;
    max-width:85%;
    font-size:14px;
}

.message-input-area{
    display:flex;
    gap:10px;
}

#message-input{
    flex:1;
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
}

#send-message{
    width:55px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    background:#0d47a1;
    color:white;
    font-size:18px;
}


.visitor-message{
    background:#e8f0ff;
    padding:10px 14px;
    border-radius:10px;
    margin-bottom:10px;
    width:fit-content;
    max-width:85%;
}

.system-message{
    background:#d8ffd8;
    padding:10px 14px;
    border-radius:10px;
    margin-bottom:10px;
    margin-left:auto;
    width:fit-content;
    max-width:85%;
}

