/* Kajinga Support — Chat Widget v0.6.0 */

/* =============================================
   POSITION & WRAPPER
   ============================================= */

#ks-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

#ks-chat-widget.ks-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

#ks-chat-widget.ks-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* =============================================
   BUBBLE
   ============================================= */

.ks-chat-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #179AFC;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(23, 154, 252, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    font-size: 14px;
}

.ks-chat-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(23, 154, 252, 0.45);
}

.ks-chat-bubble-icon {
    font-size: 20px;
}

/* =============================================
   MINI-BUTTON (geschlossener Zustand)
   ============================================= */

.ks-chat-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #179AFC;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(23, 154, 252, 0.3);
    transition: transform 0.2s;
    opacity: 0.7;
}

.ks-chat-mini:hover {
    transform: scale(1.1);
    opacity: 1;
}

.ks-chat-mini-icon {
    font-size: 20px;
}

/* =============================================
   CHAT-WINDOW
   ============================================= */

.ks-chat-window {
    display: flex;
    flex-direction: column;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Header */
.ks-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #179AFC;
    color: #fff;
}

.ks-chat-header-title {
    font-family: 'Poppins', Helvetica, sans-serif;
    font-weight: 600;
    font-size: 15px;
}

.ks-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
}

.ks-chat-close:hover {
    opacity: 1;
}

/* =============================================
   MESSAGES
   ============================================= */

.ks-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.ks-chat-msg {
    margin-bottom: 10px;
    max-width: 85%;
}

.ks-chat-msg--customer {
    margin-left: auto;
    text-align: right;
}

.ks-chat-msg--customer .ks-chat-msg-body {
    background: #179AFC;
    color: #fff;
    border-radius: 14px 14px 4px 14px;
    padding: 8px 14px;
    display: inline-block;
    text-align: left;
}

.ks-chat-msg--agent .ks-chat-msg-body,
.ks-chat-msg--system .ks-chat-msg-body {
    background: #f0f0f0;
    color: #333;
    border-radius: 14px 14px 14px 4px;
    padding: 8px 14px;
    display: inline-block;
}

.ks-chat-msg--system .ks-chat-msg-body {
    background: #E3F2FD;
    color: #1565C0;
    font-size: 13px;
}

.ks-chat-msg-name {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
    font-weight: 600;
}

.ks-chat-msg-body p {
    margin: 0;
}

/* =============================================
   PRE-CHAT FORM + INPUT
   ============================================= */

.ks-chat-prechat,
.ks-chat-input-area {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.ks-chat-prechat {
    flex-direction: column;
}

.ks-chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.ks-chat-input:focus {
    border-color: #179AFC;
    box-shadow: 0 0 0 2px rgba(23, 154, 252, 0.15);
}

.ks-chat-btn {
    background: #179AFC;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.ks-chat-btn:hover {
    background: #0d7fd4;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 480px) {
    .ks-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        border-radius: 12px;
    }

    #ks-chat-widget.ks-chat-bottom-left,
    #ks-chat-widget.ks-chat-bottom-right {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }

    .ks-chat-bubble-text {
        display: none;
    }

    .ks-chat-bubble {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
}

/* =============================================
   OFFLINE-MODUS
   ============================================= */

.ks-chat-offline {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    color: #666;
}
.ks-chat-offline-icon { font-size: 40px; margin-bottom: 12px; }
.ks-chat-offline p { font-size: 14px; line-height: 1.6; margin: 0; }
