#chatbot-wrapper {
    font-family: system-ui, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

#chat-toggle {
    background: #E31717;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#chat-toggle:hover {
    background: #c01414;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Chat Modal Styles */
#chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(4px);
}

.chat-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    height: 80%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#chat-header {
    background: #E31717;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

#chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.chat-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

#chat-messages p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.4;
    font-weight: normal;
    max-width: 85%;
    word-wrap: break-word;
}

#chat-messages p:has(strong:first-child:contains("👤")) {
    background: #E31717;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

#chat-messages p:has(strong:first-child:contains("🤖")) {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Link-Styling im Website-Stil */
#chat-messages p a {
    color: #E31717;
    text-decoration: none;
    font-weight: normal;
    transition: color 0.3s ease;
    cursor: pointer;
}

#chat-messages p a:hover {
    color: #000;
    text-decoration: underline;
}

/* Icon für externe Links */
#chat-messages p a[target="_blank"]:after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 2px;
}

/* Styling für formatierte Texte */
#chat-messages p strong {
    font-weight: bold;
    color: inherit;
}

#chat-messages p em {
    font-style: italic;
    color: #666;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chat-options button {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    color: #333;
}

.chat-options button:hover {
    background: #E31717;
    color: white;
    border-color: #E31717;
}

#chat-input {
    display: flex;
    padding: 20px;
    gap: 12px;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 16px 16px;
}

#chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#chat-input input:focus {
    border-color: #E31717;
}

#chat-input button {
    background: #E31717;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-input button:hover {
    background: #c01414;
    transform: scale(1.05);
}

/* DSGVO Modal Styles */
#dsgvo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.dsgvo-modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.dsgvo-modal-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 16px;
}

.dsgvo-modal-content p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 24px;
    font-size: 14px;
}

.dsgvo-modal-content p a {
    color: #E31717;
    text-decoration: none;
}

.dsgvo-modal-content p a:hover {
    color: #000;
    text-decoration: underline;
}

.dsgvo-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.dsgvo-btn-decline {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.dsgvo-btn-decline:hover {
    background: #5a6268;
}

.dsgvo-btn-accept {
    background: #E31717;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.dsgvo-btn-accept:hover {
    background: #c01414;
}

/* Ladeanimation */
.dot-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 16px;
    background: white;
}

.dot-loader span {
    width: 8px;
    height: 8px;
    background: #E31717;
    border-radius: 50%;
    animation: dot 1.2s infinite ease-in-out;
}

.dot-loader span:nth-child(2) {
    animation-delay: 0.2s;
}
.dot-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 576px) {
    #chatbot-wrapper {
        bottom: 80px;
        right: 10px;
    }

    #chat-toggle {
        padding: 10px 14px;
        font-size: 14px;
    }

    .chat-modal-content {
        width: 95%;
        height: 90%;
        max-height: none;
        border-radius: 12px;
    }

    #chat-header {
        padding: 16px;
        border-radius: 12px 12px 0 0;
    }

    #chat-messages {
        padding: 16px;
    }

    #chat-input {
        padding: 16px;
    }

    .dsgvo-modal-content {
        padding: 20px;
        border-radius: 12px;
    }

    .dsgvo-modal-buttons {
        flex-direction: column;
    }

    .dsgvo-btn-decline,
    .dsgvo-btn-accept {
        width: 100%;
    }
}

@media screen and (max-width: 400px) {
    .chat-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #chat-header {
        border-radius: 0;
    }
}

/* Touch-optimierte Bereiche für mobile Geräte */
@media (hover: none) and (pointer: coarse) {
    #chat-messages p a {
        padding: 8px;
        margin: -8px;
        border-radius: 4px;
        min-height: 44px;
        display: inline-block;
        line-height: 1.2;