/* Knooz Live Chat - Frontend Customer Luxury Widget */
#knooz-chat-root {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

#knooz-chat-root * {
    box-sizing: border-box;
}

/* Floating Trigger Button */
.knooz-chat-trigger-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(15, 18, 25, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    position: relative;
}

.knooz-chat-trigger-btn:hover {
    transform: scale(1.06);
    background: #14192b;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.45);
}

.knooz-chat-trigger-btn:active {
    cursor: grabbing;
    transform: scale(0.96);
}

.knooz-trigger-icon {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    pointer-events: none;
}

.knooz-unread-pill {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #08090d;
}

/* Chat Modal Window */
.knooz-widget-window {
    position: absolute;
    bottom: 74px;
    left: 0;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 120px);
    max-width: calc(100vw - 32px);
    background: #090b10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.knooz-widget-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Widget Header */
.knooz-widget-header {
    background: linear-gradient(180deg, #121622 0%, #0c0f17 100%);
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.knooz-widget-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.knooz-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    position: relative;
}

.knooz-online-dot {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #090b10;
}

.knooz-header-text h4 {
    margin: 0;
    font-size: 15px;
    color: #f8fafc;
    font-weight: 700;
}

.knooz-header-text span {
    font-size: 11.5px;
    color: #94a3b8;
}

.knooz-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s;
}

.knooz-close-btn:hover {
    color: #f1f5f9;
}

/* Messages Scroll Container */
.knooz-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.03) 0%, transparent 60%);
}

.knooz-w-row {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.knooz-w-row.customer {
    align-self: flex-start;
}

.knooz-w-row.support {
    align-self: flex-end;
}

.knooz-w-row.bot {
    align-self: center;
    max-width: 90%;
    text-align: center;
}

.knooz-w-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.knooz-w-row.customer .knooz-w-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-top-right-radius: 2px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.knooz-w-row.support .knooz-w-bubble {
    background: #141924;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 2px;
}

.knooz-w-row.bot .knooz-w-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 12px;
    border-radius: 12px;
}

.knooz-w-meta {
    font-size: 10px;
    color: #64748b;
    margin-top: 3px;
    padding: 0 4px;
}

.knooz-w-row.customer .knooz-w-meta {
    align-self: flex-start;
}

.knooz-w-row.support .knooz-w-meta {
    align-self: flex-end;
}

/* Footer & Input Bar */
.knooz-widget-footer {
    background: #0d1017;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 12px 14px;
}

.knooz-widget-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.knooz-widget-input {
    flex: 1;
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    outline: none;
    transition: border 0.2s;
}

.knooz-widget-input:focus {
    border-color: #6366f1;
}

.knooz-widget-attach-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    font-size: 18px;
    line-height: 1;
    transition: color 0.15s;
}

.knooz-widget-attach-btn:hover {
    color: #818cf8;
}

.knooz-widget-send-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}

.knooz-widget-send-btn:hover {
    transform: scale(1.05);
}

.knooz-widget-send-btn:active {
    transform: scale(0.95);
}

.knooz-widget-brand {
    font-size: 10.5px;
    text-align: center;
    color: #475569;
    margin-top: 8px;
}

.knooz-widget-brand a {
    color: #64748b;
    text-decoration: none;
}

