/* Krapulix AI Chat – stílus */

#kaichat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

#kaichat-open-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a6fc4;
    color: #fff;
    border: none;
    border-radius: 28px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
    transition: background 0.2s, transform 0.15s;
}
#kaichat-open-btn:hover { background: #155da0; transform: translateY(-1px); }
#kaichat-open-btn svg { flex-shrink: 0; }

/* Chat ablak */
#kaichat-window {
    position: fixed;
    bottom: 88px;
    right: 24px;
    z-index: 9999;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
}
#kaichat-window[hidden] { display: none; }

/* Header */
#kaichat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a6fc4;
    color: #fff;
    padding: 14px 16px;
    flex-shrink: 0;
}
#kaichat-title { font-weight: 600; font-size: 15px; }

#kaichat-restart-btn,
#kaichat-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s;
}
#kaichat-restart-btn:hover,
#kaichat-close-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* Üzenetek */
#kaichat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f5f6fa;
    scroll-behavior: smooth;
}

.kaichat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
    animation: kaichat-in 0.2s ease;
}
@keyframes kaichat-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.kaichat-msg-bot {
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.kaichat-msg-user {
    background: #1a6fc4;
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* Gépelés animáció */
.kaichat-typing {
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    align-items: center;
}
.kaichat-typing span {
    width: 7px;
    height: 7px;
    background: #9ba0af;
    border-radius: 50%;
    animation: kaichat-bounce 1.2s infinite;
}
.kaichat-typing span:nth-child(2) { animation-delay: 0.2s; }
.kaichat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes kaichat-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* Bot opció gombok */
.kaichat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 4px 0 2px;
    align-self: flex-start;
    max-width: 90%;
}
.kaichat-option-btn {
    background: #fff;
    border: 1.5px solid #1a6fc4;
    color: #1a6fc4;
    border-radius: 18px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.kaichat-option-btn:hover { background: #1a6fc4; color: #fff; }

/* Input terület */
#kaichat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e8eaf0;
    background: #fff;
    flex-shrink: 0;
}

#kaichat-input {
    flex: 1;
    border: 1.5px solid #dde1ec;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    background: #f7f8fb;
    color: #1a1a2e;
    transition: border-color 0.15s;
}
#kaichat-input:focus { border-color: #1a6fc4; background: #fff; }
#kaichat-input:disabled { opacity: 0.5; }

#kaichat-send-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #1a6fc4;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
#kaichat-send-btn:hover { background: #155da0; }
#kaichat-send-btn:active { transform: scale(0.93); }
#kaichat-send-btn:disabled { background: #b0bec5; cursor: not-allowed; }

/* Mobil */
@media (max-width: 480px) {
    #kaichat-window { width: calc(100vw - 16px); right: 8px; bottom: 80px; border-radius: 12px; }
    #kaichat-launcher { right: 12px; bottom: 16px; }
}
