/* ==========================================================================
   CHATBOT WIDGET — meteo.pteleos.gr
   ========================================================================== */

/* --- Κουμπί Chatbot (Bubble) --- */
#chat-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 8999;
    width: 58px;
    height: 58px;
    background: rgba(0, 229, 255, 0.2);
    border: 2px solid #00e5ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #00e5ff;
    box-shadow: 0 0 20px rgba(0,229,255,0.3);
    transition: all 0.3s ease;
}

#chat-bubble:hover {
    background: #00e5ff;
    color: #000;
    transform: scale(1.1);
}

/* --- Badge ειδοποίησης --- */
#chat-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4d4d;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-animation 1.5s infinite;
}

/* --- Panel Chatbot --- */
#chat-panel {
    display: none;
    opacity: 0;
    flex-direction: column;
    position: fixed;
    bottom: 95px;
    right: 20px;
    width: 320px;
    height: 450px;
    z-index: 9000;
    background: rgba(25, 35, 45, 0.97);
    border: 1px solid rgba(0,229,255,0.4);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    backdrop-filter: blur(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(20px);
}

#chat-panel.open {
    opacity: 1;
    transform: translateY(0);
}

/* --- Header --- */
#chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: rgba(0,229,255,0.1);
    border-bottom: 1px solid rgba(0,229,255,0.2);
    color: #00e5ff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Μηνύματα --- */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,229,255,0.3);
    border-radius: 4px;
}

/* ✅ ΔΙΟΡΘΩΣΗ: Συγχώνευση — το .chat-msg-user και .chat-msg-bot
   ορίζονται επίσης στο style.css (white-space/word-break).
   Εδώ κρατάμε μόνο τα οπτικά στυλ του chatbot. */
.chat-msg-user {
    align-self: flex-end;
    background: rgba(0,229,255,0.15);
    border: 1px solid rgba(0,229,255,0.3);
    color: #00e5ff;
    padding: 8px 12px;
    border-radius: 15px 15px 3px 15px;
    font-size: 0.82rem;
    max-width: 85%;
    line-height: 1.4;
}

.chat-msg-bot {
    align-self: flex-start;
    background: rgba(46,204,113,0.1);
    border: 1px solid rgba(46,204,113,0.3);
    color: #2ecc71;
    padding: 8px 12px;
    border-radius: 15px 15px 15px 3px;
    font-size: 0.82rem;
    max-width: 85%;
    line-height: 1.4;
}

.chat-msg-loading {
    align-self: flex-start;
    color: #aaa;
    font-size: 1.2rem;
    padding: 4px 12px;
    animation: pulse-animation 1s infinite;
}

/* --- Quick Replies
   ✅ ΔΙΟΡΘΩΣΗ: Συγχώνευση 2 διπλών #chat-quick-replies σε ένα --- */
#chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 229, 255, 0.1);
}

/* ✅ ΔΙΟΡΘΩΣΗ: Συγχώνευση 2 διπλών .quick-reply-btn σε ένα */
.quick-reply-btn {
    background: rgba(0,229,255,0.08);
    border: 1px solid rgba(0,229,255,0.3);
    color: #00e5ff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    animation: fadeInSlide 0.4s ease forwards;
    opacity: 0;
    transform: translateY(5px);
}

.quick-reply-btn:hover { background: rgba(0,229,255,0.2); }

/* ✅ ΠΡΟΣΘΗΚΗ: Κουμπί κλεισίματος quick replies */
.quick-reply-close-btn {
    width: 100%;
    margin-top: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    color: #aaa;
    padding: 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.quick-reply-close-btn:hover { background: rgba(255,255,255,0.1); }

/* --- Input Area --- */
#chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#chat-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(0,229,255,0.3);
    border-radius: 10px;
    color: white;
    padding: 8px 12px;
    font-size: 0.82rem;
    outline: none;
}

#chat-input:focus { border-color: #00e5ff; }

#chat-send-btn {
    background: rgba(0,229,255,0.2);
    border: 1px solid #00e5ff;
    border-radius: 10px;
    color: #00e5ff;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

#chat-send-btn:hover { background: #00e5ff; color: #000; }

/* --- Animation --- */
@keyframes fadeInSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Mobile --- */
@media (max-width: 400px) {
    #chat-panel {
        width: calc(100vw - 30px);
        right: 15px;
    }
}