/* --- B-DESIGN GEMINI CHATBOT STYLE --- */

/* 1. Ikona (Launcher) */
#chatIcon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0054a6, #007bff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chatIcon:hover {
    transform: scale(1.1);
}

#chatIcon i {
    color: white;
    font-size: 28px;
}

/* 2. Prozor Chata */
#chatWindow {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: none; /* Skriveno po defaultu */
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    border: 1px solid #eee;
}

#chatWindow.show {
    display: flex;
    animation: slideUp 0.4s ease-out;
}

/* Header */
.chat-header {
    background: #0054a6;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#closeChatBtn {
    cursor: pointer;
    opacity: 0.8;
}

#closeChatBtn:hover {
    opacity: 1;
}

/* Poruke */
#chatMessages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-message, .bot-message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background: #e1f5fe;
    color: #01579b;
    border-bottom-right-radius: 2px;
}

.bot-message {
    align-self: flex-start;
    background: #ffffff;
    color: #333;
    border: 1px solid #ddd;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Linkovi unutar poruka */
.bot-message a {
    color: #0054a6;
    text-decoration: underline;
    font-weight: bold;
}

/* Input zona */
.chat-input-area {
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

#chatInput {
    flex: 1;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
}

#sendBtn {
    background: #0054a6;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- ANIMACIJE --- */

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Vibracija za privlačenje pažnje */
.vibrate {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    border: 3px solid #ff9800 !important; /* Narančasti rub kad vibrira */
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Točka za notifikaciju */
.notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

/* Razmak između odlomaka unutar bot poruke */
.bot-message p {
    margin-bottom: 10px;
}

/* Razmak unutar lista */
.bot-message ul, .bot-message ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.bot-message li {
    margin-bottom: 5px;
}

/* Popravak za linkove da ne bježe iz okvira */
.bot-message a {
    word-break: break-all;
    display: inline-block;
}

.bot-message a {
    color: #007bb1;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed #007bb1;
    transition: all 0.2s ease;
}

.bot-message a:hover {
    color: #0054a6;
    border-bottom: 1px solid #0054a6;
    background-color: rgba(0, 123, 177, 0.05);
}