/* Assistenten-Button */
#assistant-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.assistant-inline-btn {
    position: static;
    right: 8px;
    top: 50%;
    z-index: 10;
    width: 36px;
    height: 36px;
    font-size: 14px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}



/* Modal Container */
#assistant-modal-container {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 400px;
    height: 620px;
    z-index: 1080 !important; /* war: 1060 */
    pointer-events: auto;
}


/* Modal Content */
.modal-content-assistant {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd;
}

/* Modal Header */
#assistant-modal-header {
    background-color: #222f3e;
    color: white;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

/* Header Buttons */
#assistant-modal-header .btn {
    border: none;
    padding: 4px 8px;
    font-size: 14px;
    background: transparent;
}

#assistant-modal-header .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

#new-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Chat Container */
#assistant-chat {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

/* Welcome Screen Styling */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    text-align: start;
    padding: 10px 20px 20px 20px;
    box-sizing: border-box;
}

.welcome-text {
    margin-bottom: 25px;
    width: 100%;
}

.greeting-small {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.greeting-large {
    font-size: 18px;
    font-weight: 600;
    color: #222f3e;
    margin-bottom: 0;
}

.prompts-section {
    width: 100%;

}

.prompts-title {
    font-size: 15px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 12px;
    text-align: start;
}

.prompts-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prompt-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.prompt-btn:hover {
    background-color: #f8f9fa;
    border-color: #222f3e;
    color: #222f3e;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Chat Messages */
.assistant-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    word-wrap: break-word;
}

.assistant-message.redirect {
    align-self: center;
    background-color: rgba(167, 208, 255, 0.29);
    width: 100%;
    max-width: none !important;
    text-align: center;
    color: #328aec;
    font-size: 12px;
    font-weight: bold;
}

.assistant-message.update_form_action {
    align-self: center;
    background-color: rgba(167, 208, 255, 0.29);
    color: #328aec;
    width: 100%;
    max-width: none !important;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
}

.assistant-message.user {
    align-self: flex-end;
    background-color: #222f3e;
    color: white;
    margin-left: auto;
    font-size: 14px !important;
}

.assistant-message.assistant {
    align-self: flex-start;
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    margin-right: auto;
    font-size: 14px !important;
}

/* Modal Footer */
.modal-footer {
    border-top: 1px solid #ddd;
    background-color: white;
    flex-shrink: 0;
}

/* Form Styling */
#assistant-form {
    display: flex;
    flex-direction: column;
}

.input-section {
    background-color: white;
}

#assistant-input {
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 20px;
    overflow-y: hidden;
    border-radius: 6px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    box-sizing: border-box;
    pointer-events: auto; /* 👈 Hinzufügen */

}

.buttons-section {
    background-color: white;
}

.btn-transparent {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 6px 10px;
    font-size: 16px;
    transition: color 0.2s ease;
}

.btn-transparent:hover {
    color: #222f3e;
    background: transparent;
}

#assistant-input::-webkit-scrollbar {
    width: 4px;
}

#assistant-input::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

#assistant-input::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

#assistant-input::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Scrollbar Styling */
#assistant-chat::-webkit-scrollbar {
    width: 6px;
}

#assistant-chat::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#assistant-chat::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#assistant-chat::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* HTML: <div class="loader"></div> */
.loader {
    width: 30px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side,#222f3e 90%,#0000);
    background:
            var(--_g) 0%   50%,
            var(--_g) 50%  50%,
            var(--_g) 100% 50%;
    background-size: calc(100%/3) 50%;
    animation: l3 1s infinite linear;
}
@keyframes l3 {
    20%{background-position:0%   0%, 50%  50%,100%  50%}
    40%{background-position:0% 100%, 50%   0%,100%  50%}
    60%{background-position:0%  50%, 50% 100%,100%   0%}
    80%{background-position:0%  50%, 50%  50%,100% 100%}
}


/* Responsive Design */
@media (max-width: 768px) {
    #assistant-modal-container {
        width: 350px;
        height: 450px;
        right: 10px;
        bottom: 80px;
    }

    #assistant-btn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    #assistant-modal-container {
        width: calc(100vw - 20px);
        height: 400px;
        right: 10px;
        left: 10px;
        bottom: 80px;
    }
}

.chat-swipe {
    animation: chatSwipe 0.4s ease forwards;
}

@keyframes chatSwipe {
    0% {

        opacity: 0.5;
    }
    100% {

        opacity: 1;
    }
}

.fade-message {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInMessage 0.3s ease forwards;
}

/* Benutzer-Nachricht von rechts */
.user.fade-message {
    transform: translateX(20px);
    animation: fadeInUser 0.3s ease forwards;
}

/* Assistenten-Nachricht von links */
.assistant.fade-message {
    transform: translateX(-20px);
    animation: fadeInAssistant 0.3s ease forwards;
}

/* Redirect-Aktion vielleicht wie ein Hinweis */
.redirect.fade-message {
    transform: scale(0.95);
    animation: fadeInRedirect 0.3s ease forwards;
}

@keyframes fadeInMessage {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUser {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInAssistant {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRedirect {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.redirect-anim {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(0, 123, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: redirectShimmer 1s ease-in-out infinite;
}

@keyframes redirectShimmer {
    0%   { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

.field-highlight {
    animation: fieldFillHighlight 1.2s ease-out;
}

@keyframes fieldFillHighlight {
    0%   { background-color: #cce5ff; } /* hellblau */
    100% { background-color: white; }
}
