/* =============================================
   KUSTOM FX — Live Chat Widget
   ============================================= */

.chat-bubble {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #a855f7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.1);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 30px rgba(0, 240, 255, 0.5), 0 0 60px rgba(0, 240, 255, 0.2);
}

.chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: #0a0a0f;
}

/* Offline state */
.chat-bubble.offline {
    background: linear-gradient(135deg, #3a3a4e, #2a2a3e);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chat-bubble.offline:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.chat-bubble.offline svg { fill: #6b6b80; }

.chat-bubble .chat-close-icon { display: none; }
.chat-bubble.open .chat-open-icon { display: none; }
.chat-bubble.open .chat-close-icon { display: block; }

/* Notification dot */
.chat-bubble .chat-notif {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #0a0a0f;
    display: none;
}

.chat-bubble .chat-notif.active {
    display: block;
    animation: notifPulse 1.5s infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* =============================================
   CHAT PANEL
   ============================================= */

.chat-panel {
    position: fixed;
    bottom: 176px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #12121a;
    border: 1px solid #2a2a3e;
    border-radius: 16px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.08);
}

.chat-panel.open {
    display: flex;
    animation: chatSlideIn 0.3s ease;
}

@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-bottom: 1px solid #2a2a3e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 900;
    color: #0a0a0f;
}

.chat-header-info h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    color: #ffffff;
    margin: 0;
}

.chat-header-info span {
    font-size: 0.75rem;
    color: #22c55e;
}

/* =============================================
   INTRO FORM (name, email, phone)
   ============================================= */

.chat-intro {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-intro h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    color: #ffffff;
    margin-bottom: 4px;
}

.chat-intro p {
    font-size: 0.85rem;
    color: #a0a0b8;
    margin-bottom: 20px;
    line-height: 1.5;
}

.chat-intro .form-field {
    margin-bottom: 14px;
}

.chat-intro .form-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a0a0b8;
    margin-bottom: 6px;
}

.chat-intro .form-field input {
    width: 100%;
    padding: 10px 14px;
    background: #0a0a0f;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.chat-intro .form-field input:focus {
    border-color: #00f0ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

.chat-intro .form-field input::placeholder {
    color: #6b6b80;
}

.chat-intro .privacy-text {
    font-size: 0.7rem;
    color: #6b6b80;
    line-height: 1.5;
    margin-top: 8px;
    margin-bottom: 16px;
}

.chat-intro .privacy-text svg {
    vertical-align: middle;
    margin-right: 4px;
}

.chat-intro altcha-widget {
    --altcha-color-text: #ffffff;
    --altcha-color-border: #2a2a3e;
    --altcha-color-border-focus: #00f0ff;
    --altcha-max-width: 100%;
}

.chat-start-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00f0ff, #a855f7);
    border: none;
    border-radius: 8px;
    color: #0a0a0f;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3);
}

.chat-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   OFFLINE PANEL
   ============================================= */

.chat-offline {
    flex: 1;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.chat-offline-icon {
    color: #6b6b80;
    margin-bottom: 16px;
}

.chat-offline p {
    font-size: 0.95rem;
    color: #a0a0b8;
    line-height: 1.6;
    max-width: 280px;
}

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

.chat-messages {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #2a2a3e;
    border-radius: 4px;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg.customer {
    align-self: flex-end;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: #e0e0e8;
    border-bottom-right-radius: 4px;
}

.chat-msg.support {
    align-self: flex-start;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #e0e0e8;
    border-bottom-left-radius: 4px;
}

.chat-msg .msg-time {
    font-size: 0.65rem;
    color: #6b6b80;
    margin-top: 4px;
}

.chat-msg-greeting {
    align-self: flex-start;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #e0e0e8;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =============================================
   INPUT AREA
   ============================================= */

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #2a2a3e;
    display: flex;
    gap: 8px;
    align-items: center;
    background: #16161f;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    background: #0a0a0f;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.chat-input-area input:focus {
    border-color: #00f0ff;
    outline: none;
}

.chat-input-area input::placeholder {
    color: #6b6b80;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00f0ff, #a855f7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

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

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: #0a0a0f;
}

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

@media (max-width: 480px) {
    .chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chat-bubble {
        bottom: 90px;
        right: 16px;
    }
}
