/* Spanisch-Chatbot Widget Styles */
#spcb-chat-root { position: fixed; z-index: 99999; }
.spcb-bottom-right { right: 20px; bottom: 20px; }
.spcb-bottom-left  { left: 20px; bottom: 20px; }

.spcb-launcher {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--spcb-primary, #d7263d);
    color: #fff; border: none; cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; transition: transform .15s ease;
}
.spcb-launcher:hover { transform: scale(1.05); }

.spcb-window {
    position: fixed; width: 380px; max-width: calc(100vw - 32px);
    height: 560px; max-height: calc(100vh - 120px);
    background: #fff; border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
    display: flex; flex-direction: column; overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px; color: #222;
}
.spcb-bottom-right .spcb-window { right: 20px; bottom: 90px; }
.spcb-bottom-left  .spcb-window { left:  20px; bottom: 90px; }

.spcb-header {
    background: var(--spcb-primary, #d7263d);
    color: #fff; padding: 14px 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.spcb-header strong { font-size: 16px; }
.spcb-close { background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }

.spcb-messages {
    flex: 1; overflow-y: auto; padding: 14px;
    background: #fafafa; display: flex; flex-direction: column; gap: 10px;
}
.spcb-msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; line-height: 1.45; word-wrap: break-word; }
.spcb-msg.user      { align-self: flex-end;   background: var(--spcb-accent, #f4a261); color: #222; border-bottom-right-radius: 4px; }
.spcb-msg.assistant { align-self: flex-start; background: #fff; border: 1px solid #eee; border-bottom-left-radius: 4px; }
.spcb-msg a { color: var(--spcb-primary, #d7263d); text-decoration: underline; }
.spcb-msg .vokabel-table { margin: 10px 0; overflow-x: auto; }
.spcb-msg .vokabel-table table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.spcb-msg .vokabel-table th, .spcb-msg .vokabel-table td { border: 1px solid #e5e5e5; padding: 6px 8px; text-align: left; }
.spcb-msg .vokabel-table th { background: #f3f3f3; }
.spcb-msg .spanisch-wort { font-style: italic; color: #b8001f; }

.spcb-typing { align-self: flex-start; color: #888; font-style: italic; padding: 6px 10px; }
.spcb-typing span { display: inline-block; animation: spcb-dot 1.2s infinite; }
.spcb-typing span:nth-child(2) { animation-delay: .2s; }
.spcb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes spcb-dot { 0%,60%,100% { opacity: .2 } 30% { opacity: 1 } }

.spcb-inputbar {
    display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; background: #fff;
}
.spcb-inputbar input {
    flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px;
    font-size: 15px; outline: none;
}
.spcb-inputbar input:focus { border-color: var(--spcb-primary, #d7263d); }
.spcb-inputbar button {
    border: 0; background: var(--spcb-primary, #d7263d); color: #fff;
    padding: 0 16px; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.spcb-inputbar button:disabled { opacity: .5; cursor: not-allowed; }

.spcb-references {
    padding: 8px 14px; font-size: 12px; color: #666;
    background: #fff; border-top: 1px solid #eee;
}
.spcb-references a { color: #444; margin-right: 8px; }

@media (max-width: 480px) {
    .spcb-window { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0;
                   right: 0 !important; left: 0 !important; bottom: 0 !important; }
}
