/* =========================================================
   ADR SOLUTIONS CHATBOT
   POTPUNO IZOLOVAN CSS
   ========================================================= */


/* =========================================================
   GLAVNI CHATBOT KONTEJNER
   ========================================================= */

.adr-root {
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 99999;
    font-family: Arial, sans-serif;
}


/* =========================================================
   GLAVNI PLAVI GUMB
   ========================================================= */

.adr-root .adr-btn {
    width: 68px;
    height: 68px;

    border: none;
    border-radius: 50%;

    background: linear-gradient(135deg, #0878ff, #0059d9);

    display: grid;
    place-items: center;

    cursor: pointer;
    position: relative;

    animation:
        adrChatButtonIn 0.7s cubic-bezier(.18, .89, .32, 1.28) both;

    transition: box-shadow 0.2s ease;
}


/* Pulsirajući krug */

.adr-root .adr-btn::before {
    content: "";

    position: absolute;
    inset: -9px;

    border-radius: 50%;

    border: 1px solid rgba(8, 120, 255, 0.25);

    animation:
        adrChatPulse 2.6s ease-out infinite;

    pointer-events: none;
}


/* =========================================================
   IKONA CHAT MJEHURIĆA
   ========================================================= */

.adr-root .bubble {
    width: 32px;
    height: 25px;

    background: #ffffff;

    border-radius: 8px;

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

    gap: 4px;

    position: relative;
}


.adr-root .bubble::after {
    content: "";

    position: absolute;

    left: 5px;
    bottom: -6px;

    border-width: 7px 7px 0 0;
    border-style: solid;

    border-color:
        #ffffff
        transparent
        transparent
        transparent;
}


.adr-root .bubble i {
    width: 4px;
    height: 4px;

    background: #172033;

    border-radius: 50%;
}


/* =========================================================
   CHAT PROZOR
   ========================================================= */

.adr-root .win {
    position: absolute;

    right: 0;
    bottom: 84px;

    width: 390px;
    height: 610px;

    max-height: calc(100vh - 170px);

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 22px 60px rgba(12, 40, 80, 0.25);

    display: flex;
    flex-direction: column;

    opacity: 0;

    transform:
        translateY(30px)
        scale(0.88);

    pointer-events: none;

    transform-origin: bottom right;
}


/* OTVARANJE */

.adr-root .win.open {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;

    animation:
        adrChatOpen 0.5s cubic-bezier(.16, 1, .3, 1) both;
}


/* ZATVARANJE */

.adr-root .win.closing {
    animation:
        adrChatClose 0.32s cubic-bezier(.4, 0, 1, 1) both;
}


/* =========================================================
   ZAGLAVLJE CHATBOTA
   ========================================================= */

.adr-root .head {
    height: 68px;

    flex: 0 0 68px;

    background:
        linear-gradient(
            135deg,
            #0878ff,
            #0059d9
        );

    color: #ffffff;

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

    padding: 9px 12px;

    position: relative;

    overflow: hidden;
}


/* Shine efekt */

.adr-root .head::after {
    content: "";

    position: absolute;

    top: -40%;
    left: -30%;

    width: 35%;
    height: 180%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.20),
            transparent
        );

    transform: skewX(-22deg);

    animation:
        adrChatShine 5s ease-in-out infinite;
}


/* =========================================================
   LIJEVA STRANA ZAGLAVLJA
   ========================================================= */

.adr-root .headleft {
    display: flex;
    align-items: center;

    gap: 10px;

    position: relative;

    z-index: 1;
}


/* =========================================================
   CHATBOT LOGO
   =========================================================
   
   VAŽNO:
   Više NE koristimo globalni .logo.
   Ovo pravilo vrijedi samo unutar .adr-root.
   
   Time se glavni ADR logo na stranici više
   ne može slučajno smanjiti.
   ========================================================= */

.adr-root .logo {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    background: #ffffff;

    border-radius: 12px;

    display: grid;
    place-items: center;

    overflow: hidden;

    animation:
        adrChatLogo 0.6s 0.15s both;
}


.adr-root .logo img {
    max-width: 38px;
    max-height: 38px;

    width: auto;
    height: auto;

    object-fit: contain;
}


/* =========================================================
   NASLOV CHATBOTA
   ========================================================= */

.adr-root .adr-title {
    display: flex;
    flex-direction: column;

    gap: 4px;
}


.adr-root .adr-title b {
    font-size: 16px;
}


.adr-root .adr-title small {
    font-size: 11px;
    font-weight: 600;
}


/* =========================================================
   GUMBI MINIMIZE / CLOSE
   ========================================================= */

.adr-root .adr-head-actions {
    position: relative;

    z-index: 1;

    display: flex;
}


.adr-root .adr-head-actions button {
    width: 32px;
    height: 32px;

    border: none;

    background: transparent;

    color: #ffffff;

    font-size: 24px;

    cursor: pointer;

    border-radius: 8px;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.adr-root .adr-head-actions button:hover {
    background: rgba(255,255,255,0.14);

    transform:
        translateY(-2px)
        scale(1.1);
}


/* =========================================================
   PORUKE
   ========================================================= */

.adr-root .msgs {
    flex: 1;

    overflow-y: auto;

    padding: 15px 14px;

    background: #ffffff;

    scroll-behavior: smooth;
}


/* =========================================================
   BOT ODGOVOR
   ========================================================= */

.adr-root .bot {
    width: 88%;

    background: #edf3fb;

    border-radius: 16px;

    padding: 13px 15px;

    margin: 0 0 8px;

    animation:
        adrChatMessage 0.4s cubic-bezier(.16, 1, .3, 1) both;
}


.adr-root .bot strong {
    display: block;

    margin-bottom: 7px;
}


.adr-root .bot p {
    margin: 0;

    line-height: 1.55;

    font-size: 14px;
}


/* =========================================================
   KORISNIČKI ODGOVOR
   ========================================================= */

.adr-root .user {
    width: fit-content;

    max-width: 88%;

    margin:
        0
        0
        8px
        auto;

    background: #0878ff;

    color: #ffffff;

    border-radius: 16px;

    padding: 10px 14px;

    font-size: 14px;

    animation:
        adrChatMessage 0.4s cubic-bezier(.16, 1, .3, 1) both;
}


/* =========================================================
   OPCIJE / GUMBI
   ========================================================= */

.adr-root .opts {
    display: flex;

    flex-direction: column;

    gap: 8px;

    margin:
        5px
        0
        14px;

    animation:
        adrChatOptions 0.35s ease both;
}


.adr-root .opt {
    width: 100%;

    min-height: 49px;

    border:
        1px solid #d7e2f0;

    border-radius: 14px;

    background: #ffffff;

    color: #172033;

    text-align: left;

    padding: 10px 14px;

    font-size: 14px;

    cursor: pointer;

    text-decoration: none;

    display: flex;
    align-items: center;

    box-shadow:
        0 2px 0 rgba(30, 65, 105, 0.08),
        0 4px 10px rgba(30, 65, 105, 0.06);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;

    animation:
        adrChatOption 0.3s ease both;
}


/* Hover samo na chatbot opcijama */

.adr-root .opt:hover {
    transform:
        translateY(-5px)
        scale(1.01);

    box-shadow:
        0 6px 0 rgba(30, 65, 105, 0.07),
        0 15px 25px rgba(30, 65, 105, 0.16);

    background: #fafdff;

    border-color: #b9cde5;
}


.adr-root .opt:active {
    transform:
        translateY(-1px);
}


/* =========================================================
   ANIMACIJA TRI TOČKICE
   ========================================================= */

.adr-root .typing {
    width: 58px;

    background: #edf3fb;

    border-radius: 16px;

    padding: 12px;

    display: flex;

    gap: 4px;

    margin-bottom: 8px;
}


.adr-root .typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #6c7d95;

    animation:
        adrChatDots 1s infinite ease-in-out;
}


.adr-root .typing span:nth-child(2) {
    animation-delay: 0.15s;
}


.adr-root .typing span:nth-child(3) {
    animation-delay: 0.30s;
}


/* =========================================================
   FOOTER
   ========================================================= */

.adr-root .foot {
    height: 33px;

    flex: 0 0 33px;

    border-top:
        1px solid #edf1f6;

    display: grid;

    place-items: center;

    color: #8b99ab;

    font-size: 10px;
}


/* =========================================================
   ANIMACIJE
   ========================================================= */


/* GUMB */

@keyframes adrChatButtonIn {

    0% {
        opacity: 0;

        transform:
            translateY(28px)
            scale(0.55)
            rotate(-15deg);
    }

    70% {
        opacity: 1;

        transform:
            translateY(-5px)
            scale(1.08)
            rotate(3deg);
    }

    100% {
        opacity: 1;

        transform:
            translateY(0)
            scale(1)
            rotate(0);
    }

}


/* PULS */

@keyframes adrChatPulse {

    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    25% {
        opacity: 0.7;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }

}


/* OTVARANJE */

@keyframes adrChatOpen {

    0% {
        opacity: 0;

        transform:
            translateY(35px)
            scale(0.86);

        filter: blur(5px);
    }

    100% {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);

        filter: none;
    }

}


/* ZATVARANJE */

@keyframes adrChatClose {

    to {
        opacity: 0;

        transform:
            translateY(25px)
            scale(0.90);

        filter: blur(4px);
    }

}


/* SHINE */

@keyframes adrChatShine {

    0%,
    75% {
        transform:
            translateX(-180%)
            skewX(-22deg);
    }

    100% {
        transform:
            translateX(550%)
            skewX(-22deg);
    }

}


/* LOGO */

@keyframes adrChatLogo {

    from {
        opacity: 0;

        transform:
            scale(0.5)
            rotate(-14deg);
    }

    to {
        opacity: 1;

        transform:
            scale(1)
            rotate(0);
    }

}


/* PORUKE */

@keyframes adrChatMessage {

    from {
        opacity: 0;

        transform:
            translateY(12px)
            scale(0.96);

        filter: blur(2px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);

        filter: none;
    }

}


/* GRUPA OPCIJA */

@keyframes adrChatOptions {

    from {
        opacity: 0;

        transform:
            translateY(8px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


/* POJEDINA OPCIJA */

@keyframes adrChatOption {

    from {
        opacity: 0;

        transform:
            translateY(7px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


/* TRI TOČKICE */

@keyframes adrChatDots {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }

}


/* =========================================================
   MOBITEL
   ========================================================= */

@media (max-width: 600px) {

    .adr-root {
        right: 10px;
        bottom: 78px;
    }


    .adr-root .adr-btn {
        width: 62px;
        height: 62px;
    }


    .adr-root .win {
        position: fixed;

        right: 10px;
        left: 10px;

        bottom: 145px;

        width: auto;

        height: calc(100vh - 165px);

        max-height: none;
    }

}