/* gregi-bot.css */

/* Container für den gesamten Chatbot */
#gregi-bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Die Lasche/Tab zum Öffnen des Chats */
#gregi-bot-lasche {
    padding: 12px 24px;
    background-color: #0073aa; /* Typisches WordPress-Blau */
    color: white;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease;
}

#gregi-bot-lasche:hover {
    background-color: #005a87;
}

/* Das Hauptfenster des Chatbots */
#gregi-bot-window {
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: bottom right;
}

#gregi-bot-window:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hidden {
    display: none !important; /* Wichtig, um das Layout nicht zu beeinflussen */
}


/* Header des Chat-Fensters */
#gregi-bot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    font-weight: 600;
    color: #333;
}

#gregi-bot-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0;
}

#gregi-bot-close:hover {
    color: #333;
}

/* Bereich, in dem die Nachrichten angezeigt werden */
#gregi-bot-chat-area {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

/* Einzelne Nachrichtenblasen */
.gregi-bot-message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Nachrichten vom Bot */
.gregi-bot-message.assistant {
    background-color: #e5e5ea;
    color: #000;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    float: left;
    clear: both;
}

/* Nachrichten vom User */
.gregi-bot-message.user {
    background-color: #0073aa;
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    float: right;
    clear: both;
}

/* Lade-Indikator */
.gregi-bot-message.typing-indicator {
    background-color: #e5e5ea;
    align-self: flex-start;
    float: left;
    clear: both;
    padding: 12px 15px;
}
.gregi-bot-message.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out both;
}
.gregi-bot-message.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.gregi-bot-message.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.gregi-bot-message.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

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


/* Eingabebereich */
#gregi-bot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e5e5e5;
    background-color: #ffffff;
}

#gregi-bot-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 18px;
    padding: 8px 15px;
    font-size: 14px;
    resize: none;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
}

#gregi-bot-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

#gregi-bot-send {
    margin-left: 10px;
    padding: 0 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#gregi-bot-send:hover {
    background-color: #005a87;
}

#gregi-bot-send:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}


/* Footer mit Datenschutzhinweis */
#gregi-bot-footer {
    padding: 8px 15px;
    font-size: 11px;
    color: #888;
    background-color: #f1f1f1;
    text-align: center;
    line-height: 1.3;
}

#gregi-bot-footer a {
    color: #0073aa;
    text-decoration: none;
}

#gregi-bot-footer a:hover {
    text-decoration: underline;
}
