/* ================================================= */
/* =========== CHATBOT STYLES (Soft UI) ============ */
/* ================================================= */

:root {
    --chat-bg: #ffffff;
    --chat-bot-msg-bg: #f2f4f8; 
    --chat-user-msg-bg: var(--main-color, #2f3331); 
    --chat-text-color: var(--text-color, #333333);
    --chat-accent: var(--main-color, #2f3331);
    --chat-chip-bg: #eef1f6; 
}

/* 1. Launcher (Bleibt wie er ist) */
.chat-launcher {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: 1001;
    cursor: pointer;
    background: var(--chat-accent);
    border: none;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.6, 1);
}

.chat-launcher i {
    font-size: 3rem;
    color: #fff;
    transition: transform 0.3s ease;
}

.chat-launcher:hover {
    transform: scale(1.1);
}

/* Das Pseudo-Element für den Text */
.chat-launcher::after {
    content: "Chatbot"; /* <--- Hier deinen Text ändern */
    position: absolute;
    bottom: 7.5rem; /* Platziert es über dem Button (6rem Button + 1.5rem Abstand) */
    left: 50%;
    transform: translateX(-50%) scale(0.8); /* Startet zentriert und etwas kleiner */
    background: #fff;
    color: var(--chat-accent); /* Textfarbe passend zum Theme */
    padding: 0.8rem 1.2rem;
    border-radius: 0.8rem;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: "Quicksand", sans-serif;
    white-space: nowrap; /* Verhindert Umbruch */
    /* Ein schöner Schatten, damit es schwebt */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    /* Unsichtbar starten */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Damit es Klicks nicht blockiert */
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy Animation */
}

/* Ein kleiner Pfeil, der nach unten zeigt (Optional, für Sprechblasen-Look) */
.chat-launcher::before {
    content: "";
    position: absolute;
    bottom: 6.8rem; /* Knapp unter dem Text */
    left: 50%;
    transform: translateX(-50%) scale(0);
    /* Dreieck zeichnen mit CSS Border-Hack */
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff; /* Farbe der Sprechblase */
    opacity: 0;
    transition: all 0.3s ease;
}

/* --- HOVER EFFEKT --- */
/* Wenn man über den Launcher fährt, zeige Text und Pfeil */
.chat-launcher:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1); /* Ploppt auf */
}

.chat-launcher:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* 2. Chat Fenster */
.chat-panel {
    position: fixed;
    right: 2rem;
    bottom: 9rem;
    width: 38rem; 
    height: 60rem;
    max-height: 75vh;
    background: var(--chat-bg);
    border-radius: 2.4rem; 
    display: none;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    font-family: "Quicksand", sans-serif;
    font-size: 1.5rem;
    overflow: hidden;
    /* Border leicht angepasst, damit er zum dunklen Header passt */
    border: 1px solid rgba(0,0,0,0.05);
}

.chat-panel.active {
    display: flex;
}

/* 3. Header (HIER IST DIE ÄNDERUNG) */
.chat-header {
    padding: 2rem;
    
    /* Hintergrund ist jetzt deine Main-Color (Dunkel) */
    background: var(--chat-accent); 
    
    /* Text ist jetzt die Hintergrund-Farbe (Weiß) */
    color: var(--chat-bg); 
    
    font-weight: 700;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none; /* Linie entfernt, sieht auf dunkel besser aus */
}

/* Das "X" zum Schließen im Header muss auch hell sein */
.chat-header i {
    font-size: 2.4rem;
    color: var(--chat-bg); /* Weiß */
    opacity: 0.8; /* Leicht transparent für Eleganz */
    cursor: pointer;
    transition: all 0.2s;
}

.chat-header i:hover {
    opacity: 1; /* Beim Drüberfahren voll weiß */
    transform: rotate(90deg); /* Kleiner Dreheffekt */
}

/* 4. Body */
.chat-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: none; 
}
.chat-body::-webkit-scrollbar { 
    display: none; 
}

/* 5. Nachrichten */
.msg {
    max-width: 85%;
    padding: 1.2rem 1.8rem;
    border-radius: 1.8rem;
    line-height: 1.5;
    font-weight: 500;
    position: relative;
    animation: msgSlide 0.3s ease;
}

@keyframes msgSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.bot {
    background: var(--chat-bot-msg-bg);
    color: var(--chat-text-color);
    border-bottom-left-radius: 0.4rem;
    margin-right: auto;
}

.msg.user {
    background: var(--chat-user-msg-bg);
    color: #fff;
    border-bottom-right-radius: 0.4rem;
    margin-left: auto;
    box-shadow: 0 4px 12px rgba(47, 51, 49, 0.15);
}

.msg a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px dotted currentColor;
}

/* 6. Typing Dots */
.typing-indicator {
    background-color: var(--chat-bot-msg-bg);
    padding: 1.2rem 1.5rem;
    border-radius: 1.8rem;
    border-bottom-left-radius: 0.4rem;
    width: fit-content;
    margin-bottom: 1rem;
    display: none;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 7. Option Buttons */
.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.5rem;
    animation: msgSlide 0.4s ease;
}

.option-button {
    background: var(--chat-chip-bg); 
    border: 1px solid rgba(27, 152, 184, 0.342); 
    color: var(--chat-text-color);
    padding: 0.8rem 1.6rem;
    border-radius: 2rem; 
    font-family: "Quicksand", sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-button:hover {
    background: #e2e6ea; 
    transform: translateY(-1px);
    color: var(--chat-accent);
    border-color: rgba(0, 0, 0, 0.308);
}

.option-button:active {
    background: var(--chat-accent);
    color: #fff;
    border-color: var(--chat-accent);
    transform: scale(0.98);
}

/* 8. Input Bereich */
.chat-input {
    padding: 1.5rem;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.03);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
    background: var(--chat-bot-msg-bg);
    border: none;
    border-radius: 2.5rem;
    padding: 1.2rem 1.8rem;
    font-size: 1.5rem;
    font-family: "Quicksand", sans-serif;
    color: var(--chat-text-color);
    outline: none;
    transition: box-shadow 0.2s;
}

.chat-input input:focus {
    box-shadow: 0 0 0 2px rgba(47, 51, 49, 0.1);
    background: #fff;
}

.chat-input button {
    font-size: 0; 
    background: var(--chat-accent);
    border: none;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    cursor: pointer;
    position: relative; 
    transition: transform 0.2s;
    flex-shrink: 0; 
}

.chat-input button::before {
    content: '\ea81'; 
    font-family: 'boxicons'; 
    font-size: 2.4rem;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.chat-input button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(47, 51, 49, 0.2);
}

@media (max-width: 450px) {
    .chat-panel {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}