/* ======= CHAT CONTAINER ======= */
#chat-popup {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    max-height: 450px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

/* ======= HEADER ======= */
#chat-header {
    background: #22c55e;
    color: #fff;
    padding: 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 8px;
}

#chat-back {
    display: none; /* ascuns implicit */
}

/* ======= MESSAGES ======= */
#chat-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 15px;
    word-wrap: break-word;
}

.chat-message.client {
    align-self: flex-start;
    background: #f1f0f0;
    color: #000;
}

.chat-message.operator {
    align-self: flex-end;
    background: #22c55e;
    color: #fff;
}

/* ======= INPUT AREA ======= */
#chat-input-area {
    display: flex;
    border-top: 1px solid #ccc;
}

#chat-input {
    flex: 1;
    padding: 8px 10px;
    border: none;
    outline: none;
}

#chat-send {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
}

/* ======= FAQ BUTTONS ======= */
#chat-bot-questions {
    padding: 10px;
}

.faq-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 15px;
    border: 1px solid #007bff;
    background: #fff;
    color: #007bff;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
}

.faq-btn:hover {
    background: #22c55e;
    color: #fff;
}

.redirect-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 5px;
}

/* ======= BUTONUL DE CHAT ======= */
#chat-open {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #28a745;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    animation: wiggle 2s ease-in-out infinite;
}

#chat-open::after {
    content: "💬";
    font-size: 36px;
}

/* Efect hover */
#chat-open:hover {
    background: #22c55e;
    transform: scale(1.1);
}

/* ======= ANIMAȚIE CLĂTINARE ======= */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-8deg); }
    20% { transform: rotate(8deg); }
    30% { transform: rotate(-5deg); }
    40% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
}

/* ======= NORUL CU TEXT ======= */
#chat-hint {
    position: fixed;
    bottom: 95px;
    right: 18px;
    background: #fff;
    color: #333;
    border-radius: 20px;
    padding: 10px 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    font-size: 14px;
    font-family: Arial, sans-serif;
    animation: fadeInOut 10s ease-in-out infinite;
    z-index: 999;
}

/* Triunghiul de sub balon */
#chat-hint::after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #fff;
}

/* Animație nor */
@keyframes fadeInOut {
    0%, 80%, 100% { opacity: 0; transform: translateY(10px); }
    10%, 70% { opacity: 1; transform: translateY(0); }
}


#chat-open::after {
    content: "💬";
    font-size: 24px;
}

#chat-open:hover {
    background: #22c55e;
    transform: scale(1.1);
}
