/* ------------------------------------------------------------------------------ */
/* Chat Button Styles                                                             */
/* ------------------------------------------------------------------------------ */
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #35607F;
    color: white;
    font-size: 16px;
    font-family: Arial, sans-serif;
    padding: 12px 18px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

.chat-button .icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    background-color: white;
    mask: url('../../images/speaking-bubbles-line-icon.svg') no-repeat center;
    mask-size: contain;
}

.chat-button .online-dot {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 16px;
    height: 16px;
    background-color: #28a745;
    border-radius: 50%;
    border: 2px solid white;
}

/* ------------------------------------------------------------------------------ */
/* Chatfenster                                                                    */
/* ------------------------------------------------------------------------------ */
.chat-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-window.expanded {
    width: 500px;
    height: 650px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-header {
    background: linear-gradient(135deg, #35607F, #35607f);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: white !important;
}

.settings-dialog {
    position: absolute;
    top: 50px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 0;
    min-width: 280px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.settings-dialog.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.settings-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.settings-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.settings-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    transition: background-color 0.2s ease;
}

.setting-item:hover {
    background: #f8f9fa;
}

.setting-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e3f2fd;
    border-radius: 50%;
}

.setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    flex: 1;
    font-weight: 500;
}

.setting-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.setting-label input[type="checkbox"]:checked + .toggle-switch {
    background: #2196F3;
}

.setting-label input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(20px);
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.chat-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    font-size: 18px;
}

.chat-control-btn:hover {
    background: rgba(255,255,255,0.1);
}

.chat-body {
    flex: 1;
    padding: 20px;
    padding-bottom: 20px;
    background: #f8f9fa;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    min-height: 0;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ------------------------------------------------------------------------------ */
/* Chatnachrichten                                                                */
/* ------------------------------------------------------------------------------ */
.msg {
    margin-bottom: 15px;
    display: flex;
}

.msg.user {
    justify-content: flex-end;
}

.msg.bot {
    justify-content: flex-start;
}

.msg span {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.msg.user span {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 5px;
}

.msg.bot span {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
}

/* ------------------------------------------------------------------------------ */
/* Typing Indicator                                                               */
/* ------------------------------------------------------------------------------ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    max-width: 60px;
    margin-bottom: 15px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* ------------------------------------------------------------------------------ */
/* Eingabefeld                                                                  */
/* ------------------------------------------------------------------------------ */
.chat-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    min-height: 20px;
    background: white;
}

.chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.chat-send-btn {
    background: #3b82f6;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.chat-send-btn:hover {
    background: #2563eb;
}

.powered-by {
    text-align: center;
    padding: 10px;
    font-size: 11px;
    color: #999;
    background: #f8f9fa;
}

/* ------------------------------------------------------------------------------ */
/* Responsive Design - Laptop/Kleinere Bildschirme                               */
/* ------------------------------------------------------------------------------ */
@media screen and (max-height: 740px) {
    .chat-window {
        width: 320px;
        height: 420px;
        bottom: 90px;
        display: flex;
        flex-direction: column;
    }

    .chat-window.expanded {
        width: 450px;
        height: 550px;
    }

    .chat-header {
        padding: 12px 16px;
        flex-shrink: 0;
    }

    .chat-header-info h3 {
        font-size: 14px;
    }

    .chat-body {
        flex: 1;
        padding: 15px;
        padding-bottom: 15px;
        min-height: 0;
        overflow-y: auto;
    }

    .msg span {
        max-width: 85%;
        padding: 8px 12px;
        font-size: 13px;
    }

    .chat-input-area {
        padding: 12px 16px;
        background: white;
        border-top: 2px solid #e9ecef;
        flex-shrink: 0;
    }

    .chat-input {
        padding: 8px 12px;
        font-size: 13px;
        border: 2px solid #ddd;
        min-height: 16px;
    }

    .chat-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    }

    .chat-send-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .settings-dialog {
        min-width: 250px;
        right: 5px;
    }

    .powered-by {
        padding: 8px;
        font-size: 11px;
        flex-shrink: 0;
    }
}

/* Extra kleine Bildschirmhöhen */
@media screen and (max-height: 600px) {
    .chat-window {
        width: 300px;
        height: 350px;
        bottom: 90px;
        display: flex;
        flex-direction: column;
    }

    .chat-window.expanded {
        width: 400px;
        height: 450px;
    }

    .chat-header {
        flex-shrink: 0;
    }

    .chat-body {
        flex: 1;
        padding: 12px;
        padding-bottom: 12px;
        min-height: 0;
        overflow-y: auto;
    }

    .msg {
        margin-bottom: 12px;
    }

    .msg span {
        padding: 7px 10px;
        font-size: 12px;
    }

    .chat-input-area {
        padding: 10px 14px;
        background: white;
        border-top: 2px solid #e9ecef;
        flex-shrink: 0;
    }

    .chat-input {
        padding: 6px 10px;
        font-size: 12px;
        border: 2px solid #ddd;
        min-height: 14px;
    }

    .chat-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    }

    .chat-send-btn {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .powered-by {
        padding: 6px;
        font-size: 10px;
        flex-shrink: 0;
    }
}
