/*-------------------------------------*/
/*         ZEN-AI POPUP                */
/*-------------------------------------*/

/* Floating Button (verschiebbar) */
.zen-ai-floating {
    position: fixed;
    top: 50%;
    left: 10px;
    z-index: 999999;
    cursor: grab;
}
.zen-ai-floating:active {
    cursor: grabbing;
}

/* Popup-Fenster */
#zen-ai-window {
    position: fixed;
    /* Startposition über calc sauber ausrichten statt mit der Transform-Falle */
    top: calc(50% - 350px);  /* 50% minus halbe Höhe (700px / 2) */
    left: calc(50% - 500px); /* 50% minus halbe Breite (1000px / 2) */
    z-index: 1000;

    width: 1000px;
    height: 700px;
    display: none;
    background: white;
    box-sizing: border-box;
    overflow: hidden;
}

/* Drag-Handle oben links */
#zen-ai-drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 22px;
    cursor: grab;
    z-index: 1002;
}

/* Close-Button oben rechts */
#zen-ai-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1002;
}

/* Resize-Handle unten rechts */
#zen-ai-resize-handle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 22px;
    cursor: se-resize;
    z-index: 1002;
}

/* Iframe – bekommt Abstand nach oben */
#zen-ai-frame {
    position: absolute;
    top: 40px; /* Platz für Drag + Close */
    left: 0;
    width: 100%;
    height: calc(100% - 40px);
    border: none;
    overflow: hidden;
}

/*-------------------------------------*/
/* AI-BUBBLE CHAT                      */
/*-------------------------------------*/

#ai-chat-interface {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    font-family: "Segoe UI", sans-serif;
}

.bubble-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
    height: 400px;
    overflow-y: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.bubble-user {
    align-self: flex-end;
    background: #d0f0ff;
    padding: 12px 16px;
    border-radius: 16px 16px 0 16px;
    max-width: 80%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: right;
}

.bubble-ai {
    align-self: flex-start;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 0;
    max-width: 80%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bubble-loading {
    align-self: flex-start;
    background: #eeeeee;
    padding: 12px 16px;
    border-radius: 16px;
    font-style: italic;
    opacity: 0.7;
}

.input-area {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

#ai-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #008cff;
    color: white;
    cursor: pointer;
}

#zen-ai-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

#zen-ai-left {
    width: 120px;
    flex-shrink: 0;
}

.zen-ai-avatar {
    width: 100%;
    border-radius: 10px;
}

#zen-ai-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* History-Buttons */
#zenai-history-list button {
    margin: 4px;
    padding: 6px 10px;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#zenai-history-list button:hover {
    background: #666;
}

/* Feedback-Container für Zen-AI Antworten */
.zenai-feedback-container {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 6px;
}

.zenai-feedback-container button {
    background: transparent !important;
    border: none !important;
    padding: 2px 4px !important;
    font-size: 15px;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.zenai-feedback-container button:hover {
    transform: scale(1.2);
}

/* Dauerhafter aktiver Zustand nach Klick – der Kreis bleibt fixiert */
.zenai-feedback-container button.active-feedback {
    opacity: 1 !important;
    transform: scale(1.2) !important;
    background: rgba(0, 140, 255, 0.25) !important;
    border-radius: 50% !important;
}

/* Verhindert, dass der Hover-Effekt den aktiven Zustand übertönt */
.zenai-feedback-container button.active-feedback:hover {
    transform: scale(1.2) !important;
    background: rgba(0, 140, 255, 0.25) !important;
}