/* EL-C Chat Widget Enterprise Styles */
:root {
    --elc-primary-gold: #DAB970;
    --elc-dark-bg: #111111;
    --elc-dark-card: #181818;
    --elc-text: #ffffff;
    --elc-text-muted: #b0b0b0;
    --elc-button-text: #111111;
    --elc-shadow: 0 10px 40px rgba(0,0,0,0.5);
    --elc-shadow-gold: 0 4px 15px rgba(218, 185, 112, 0.2);
    --elc-radius-lg: 16px;
    --elc-radius-md: 10px;
}

#elc-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999; /* Über anderen Elementen */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    max-width: calc(100vw - 24px);
}

/* Teaser Bubble */
#elc-chat-teaser {
    background-color: #fff;
    color: #111;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    position: absolute;
    bottom: 80px;
    right: 5px;
    max-width: 250px;
    white-space: normal;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
#elc-chat-teaser:hover { transform: translateY(-3px); }
#elc-chat-teaser svg { width: 28px; height: 28px; color: var(--elc-primary-gold); stroke-width: 2.2; flex-shrink: 0; }

/* Launcher */
#elc-chat-launcher {
    width: 70px;
    height: 70px;
    background: var(--elc-dark-bg);
    color: var(--elc-primary-gold);
    border: 3px solid var(--elc-primary-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--elc-shadow-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    float: right;
    outline: none;
    padding: 0;
}
#elc-chat-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--elc-primary-gold);
    color: #fff;
    border-color: #fff;
}
#elc-chat-launcher svg { width: 34px; height: 34px; }

/* Chat Window */
#elc-chat-window {
    width: 440px;
    height: 720px;
    max-height: calc(100vh - 130px);
    max-width: calc(100vw - 24px);
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(218, 185, 112, 0.15);
    border-radius: var(--elc-radius-lg);
    box-shadow: var(--elc-shadow);
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 95px;
    right: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
    overflow: hidden;
}
#elc-chat-window.elc-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
#elc-chat-header {
    background: #0d0d0d;
    color: #fff;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(218, 185, 112, 0.2);
}
.elc-header-info { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.elc-status-dot { width: 10px; height: 10px; background: var(--elc-primary-gold); border-radius: 50%; box-shadow: 0 0 10px var(--elc-primary-gold); }
#elc-close-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.2); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#elc-close-btn:hover { background: rgba(255,255,255,0.15); }

/* Body (Chat Messages) */
#elc-chat-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #111111;
}

/* Bubbles */
.elc-msg {
    max-width: 88%;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    animation: elcPopIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    overflow-wrap: anywhere;
}
.elc-msg-bot { background: #fff; color: #111; align-self: flex-start; border-bottom-left-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.elc-msg-user { background: var(--elc-primary-gold); color: var(--elc-button-text); align-self: flex-end; border-bottom-right-radius: 6px; font-weight: 600; }
.elc-msg-bot a { color: #8a6a2e; font-weight: 700; text-decoration: none; }
.elc-msg-bot a:hover { text-decoration: underline; }

/* OPTIONEN GRID - LAYOUT FIX */
#elc-chat-options {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: #0d0d0d;
    border-top: 1px solid rgba(218, 185, 112, 0.1);
    /* Der Fix: Max-Height und Scrollbar für die Optionen! */
    max-height: 32vh;
    overflow-y: auto; 
}
#elc-chat-options::-webkit-scrollbar { width: 6px; }
#elc-chat-options::-webkit-scrollbar-track { background: transparent; }
#elc-chat-options::-webkit-scrollbar-thumb { background: rgba(218, 185, 112, 0.3); border-radius: 10px; }

.elc-option-card {
    background: #f0e6cc;
    border: 1px solid var(--elc-primary-gold);
    color: #111;
    padding: 14px 10px;
    border-radius: var(--elc-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 12.5px;
    letter-spacing: normal;
    text-transform: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    justify-content: center;
    min-height: 78px;
    overflow: hidden;
}
.elc-option-card:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(218, 185, 112, 0.2); background: #fff; }
.elc-option-card svg { width: 24px; height: 24px; color: #1d1506; opacity: 1; stroke-width: 2.2; flex-shrink: 0; }
.elc-option-card:hover svg,
.elc-option-card:focus-visible svg { color: #8a6a2e; }
.elc-option-card-label {
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    text-transform: none;
    white-space: normal;
}

/* Input Area */
#elc-chat-input-area {
    display: flex;
    padding: 16px;
    background: #0d0d0d;
    border-top: 1px solid rgba(218, 185, 112, 0.1);
    align-items: center;
}
#elc-input-field {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 2px solid rgba(218, 185, 112, 0.2);
    border-radius: 30px;
    outline: none;
    font-size: 14px;
    background: var(--elc-dark-card);
    color: var(--elc-text);
}
#elc-input-field::placeholder { color: #b7b7b7; font-size: 13.5px; opacity: 1; }
#elc-input-field:focus { border-color: var(--elc-primary-gold); }

#elc-send-btn {
    background: var(--elc-primary-gold);
    color: var(--elc-button-text);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(218, 185, 112, 0.15);
    transition: transform 0.2s;
}
#elc-send-btn:hover { transform: scale(1.05); }
#elc-send-btn svg { width: 22px; height: 22px; }

.elc-hidden { display: none !important; }
@keyframes elcPopIn { 0% { opacity: 0; transform: translateY(15px) scale(0.96); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
#elc-chat-body::-webkit-scrollbar { width: 6px; }
#elc-chat-body::-webkit-scrollbar-track { background: transparent; }
#elc-chat-body::-webkit-scrollbar-thumb { background: rgba(218, 185, 112, 0.2); border-radius: 10px; }

/* Mobile Anpassungen */
@media (max-width: 768px) {
    #elc-chat-widget { right: 0; left: 0; bottom: 0; max-width: none; padding: 0; }
    #elc-chat-launcher { width: 64px; height: 64px; position: fixed; bottom: 16px; right: 16px; }
    #elc-chat-window {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        bottom: auto;
    }
    #elc-chat-body { padding: 14px; gap: 11px; }
    #elc-chat-options { max-height: 40vh; }
    #elc-chat-input-area { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    #elc-input-field { font-size: 16px; }
}

@media (max-width: 480px) {
    #elc-chat-widget { right: 0; left: 0; bottom: 0; }
    #elc-chat-launcher { position: fixed; bottom: 16px; right: 16px; }
    #elc-chat-teaser { position: fixed; bottom: 92px; right: 90px; left: auto; max-width: 220px; margin-bottom: 0; padding: 14px 22px; gap: 14px; flex-direction: row; justify-content: flex-start; }
    #elc-chat-teaser svg { margin-left: 0; margin-right: 2px; }
    #elc-chat-window { width: 100%; border-radius: 0; }
    #elc-chat-options { grid-template-columns: 1fr 1fr; max-height: 40vh; }
    .elc-option-card { min-height: 72px; flex-direction: column; justify-content: center; padding: 10px 8px; text-align: center; }
    .elc-option-card svg { width: 26px; height: 26px; display: block !important; visibility: visible !important; color: #1d1506 !important; margin: 0 auto 4px; }
    #elc-send-btn { width: 44px; height: 44px; }
}
