/* Stilizacija dugmeta za otvaranje chata */
#chat-button {
    /* position: fixed;
    bottom: 20px;
    right: 80px;
    background: #113F74;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.3s ease;
    z-index: 9999; */
    position: fixed;
    bottom: 20px;
    right: 80px;
    background: #113F74;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.3s ease;
    z-index: 9999;
}

#chat-button:hover {
    background: #0E2D58;
    transform: scale(1.05);
}

/* Chat prozor */
#chat-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
}

/* Prikaz chat prozora sa animacijom */
#chat-container.show {
    opacity: 1;
    transform: translateY(0);
}

/* Sakrivanje chat kontejnera kada je zatvoren */
#chat-container.hidden {
    z-index: -1;
    pointer-events: none;
}

/* Omogućavanje interakcije kada je chat otvoren */
#chat-container.show {
    z-index: 9999;
    pointer-events: auto;
}


/* Responsive prilagođavanje za mobilne uređaje */
@media screen and (max-width: 768px) {
    #chat-container {
        width: 90%;
        /* height: 85vh; */
        bottom: 80px;
        right: 5%;
        left: 5%;
        border-radius: 10px;
    }

    #chat-box {
        height: 70vh;
    }

    #chat-button {
        bottom: 20px;
        right: 80px;
        font-size: 14px;
        padding: 12px 24px;
    }
}

@media screen and (max-width: 480px) {
    #chat-container {
        width: 95%;
        /* height: 90vh; */
        bottom: 80px;
        right: 2.5%;
        left: 2.5%;
        border-radius: 8px;
        z-index: 1;
    }

    #chat-box {
        height: 75vh;
    }

    #chat-button {
        bottom: 20px;
        right: 80px;
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* Header chata */
#chat-header {
    background: #113F74;
    color: white;
    padding: 16px;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#close-chat:hover {
    transform: scale(1.2);
}

/* Chat box */
#chat-box {
    padding: 12px;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #F9F9F9;
    scroll-behavior: smooth;
}

/* Stil poruka */
.bot-message, .user-message {
    padding: 12px;
    border-radius: 10px;
    margin: 8px 0;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s ease forwards;
}

/* Animacija prikaza poruke */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stil poruka korisnika i bota */
.user-message {
    background: #113F74;
    color: white;
    align-self: flex-end;
}

.bot-message {
    background: #E5E5EA;
    align-self: flex-start;
}

/* Input polje */
#chat-input {
    display: flex;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: white;
}

#user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
}

#send-button {
    background: #113F74;
    color: white;
    border: none;
    padding: 10px 14px;
    margin-left: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, background 0.3s ease;
}

#send-button:hover {
    background: #0E2D58;
    transform: scale(1.05);
}

/* Animacija kada ChatGPT piše poruku */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px;
    font-size: 14px;
    font-style: italic;
    color: #888;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typingDots 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}
.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Efekat trepćućih tačaka */
@keyframes typingDots {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.3; transform: scale(1); }
}
