/* --- Gumb za otvaranje (Floating Action Button) --- */
#alpha-chat-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #715fa9;
    border: 1px solid #333;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#alpha-chat-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.4); /* Neon sjaj */
    border-color: #ff0055;
}

#alpha-chat-trigger svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

/* --- Glavni Prozor Chata --- */
#alpha-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif; /* Ili tvoj font s portala */
    overflow: hidden;
}

/* Klasa koja se dodaje kad je chat otvoren */
#alpha-chat-window.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* --- Header --- */
.alpha-header {
    background: #1a1a1a;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alpha-title {
    font-weight: 700;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alpha-status-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff88; /* Online zelena */
    border-radius: 50%;
    box-shadow: 0 0 5px #00ff88;
}

/* Status Offline (Crvena točkica) */
.alpha-status-dot.offline {
    background-color: #ff3333; /* Crvena */
    box-shadow: 0 0 5px #ff3333;
}

.alpha-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.alpha-close-btn:hover { color: #fff; }

/* --- Lista Poruka (Body) --- */
#alpha-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #0d0d0d;
}

/* Scrollbar stiliziranje */
#alpha-messages::-webkit-scrollbar { width: 6px; }
#alpha-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* Balončići poruka */
.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot {
    align-self: flex-start;
    background-color: #1f1f1f;
    color: #e0e0e0;
    border-bottom-left-radius: 2px;
    border: 1px solid #333;
}

.message.user {
    align-self: flex-end;
    background-color: #ff0055; /* Tehix branding boja? */
    color: #fff;
    border-bottom-right-radius: 2px;
}

/* Linkovi u porukama */
.message a {
    color: #55aaff;
    text-decoration: underline;
}

/* --- Input Zona (Footer) --- */
.alpha-input-area {
    padding: 15px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
}

#alpha-user-input {
    flex: 1;
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 12px;
    border-radius: 25px;
    color: #fff;
    outline: none;
    font-size: 14px;
}

#alpha-user-input:focus { border-color: #ff0055; }

#alpha-send-btn {
    background: #ff0055;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#alpha-send-btn:hover { transform: scale(1.05); }
#alpha-send-btn svg { fill: white; width: 18px; height: 18px; margin-left: 2px;}

/* --- Typing Loader --- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px;
    background: #1f1f1f;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid #333;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Dodatak za ljepši ispis listi */
.message.bot {
    line-height: 1.6; /* Malo veći razmak između redova */
}

.message.bot br {
    display: block;
    content: "";
    margin-top: 5px; /* Razmak nakon svakog novog reda */
}

/* Stil za poruku limita */
.message.limit-msg {
    background: rgba(255, 0, 85, 0.15); /* Blago crvena pozadina */
    border: 1px solid #ff0055;
    color: #fff;
    text-align: center;
}

/* Gumb unutar chata */
.alpha-login-btn {
    background: #ff0055;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: transform 0.2s;
    margin-top: 5px;
    width: 100%;
}

.alpha-login-btn:hover {
    transform: scale(1.05);
    background: #e6004c;
}

/* --- Header Actions --- */
.alpha-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#alpha-settings-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.3s;
    padding: 0;
}

#alpha-settings-btn:hover {
    color: #fff;
    transform: rotate(45deg); /* Mala animacija rotacije */
    transition: all 0.3s ease;
}

#alpha-settings-btn svg {
    width: 20px;
    height: 20px;
}

/* --- Settings Dropdown Menu --- */
#alpha-settings-menu {
    position: absolute;
    top: 55px; /* Ispod headera */
    right: 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 100;
    width: 200px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

#alpha-settings-menu.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

#alpha-clear-history {
    background: transparent;
    border: none;
    color: #ff4444; /* Crvenkasta boja za brisanje */
    width: 100%;
    text-align: left;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    border-radius: 4px;
}

#alpha-clear-history:hover {
    background: rgba(255, 68, 68, 0.1);
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #alpha-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100%;
        z-index: 10000;
    }
    #alpha-chat-trigger { bottom: 15px; right: 15px; }
}