/* ========================================
   REAL LIVE CHAT WIDGET - SIDE STYLE
   ======================================== */

/* ----- FLOATING CHAT BUTTON ----- */
#livechat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,115,170,0.35);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

#livechat-button:hover {
    transform: scale(1.04);
    background: #005a87;
    box-shadow: 0 6px 25px rgba(0,115,170,0.5);
}

#livechat-button .chat-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

#livechat-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ----- CHAT WIDGET (Side mein open) ----- */
#livechat-widget {
    position: fixed;
    bottom: 85px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 60px);
    max-height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.2);
    z-index: 9998;
    display: none;
    overflow: hidden;
    animation: slideUp 0.25s ease;
    border: 1px solid rgba(0,0,0,0.06);
}

#livechat-widget.active {
    display: block;
}

@keyframes slideUp {
    from { 
        transform: translateY(15px) scale(0.95); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

/* ----- WIDGET HEADER ----- */
#livechat-widget .widget-header {
    background: linear-gradient(135deg, #0073aa, #006699);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#livechat-widget .widget-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

#livechat-widget .widget-header .avatar {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

#livechat-widget .widget-header .header-info {
    display: flex;
    flex-direction: column;
}

#livechat-widget .widget-header .header-info .title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

#livechat-widget .widget-header .header-info .status-text {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}

#livechat-widget .widget-header .header-info .status-text .dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#livechat-widget .widget-header .close-widget {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#livechat-widget .widget-header .close-widget:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* ----- WIDGET BODY (No scroll, sab visible) ----- */
#livechat-widget .widget-body {
    padding: 16px 20px;
    background: #f8fafc;
    overflow: visible;
}

#livechat-widget .widget-body .welcome-msg {
    background: #eef2ff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 14px;
    border-left: 3px solid #0073aa;
    display: flex;
    align-items: center;
    gap: 8px;
}

#livechat-widget .widget-body .welcome-msg .emoji {
    font-size: 16px;
}

#livechat-widget .widget-body .form-group {
    margin-bottom: 10px;
}

#livechat-widget .widget-body label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 3px;
}

#livechat-widget .widget-body label .req {
    color: #ef4444;
}

#livechat-widget .widget-body input,
#livechat-widget .widget-body textarea {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.3s;
    font-family: inherit;
}

#livechat-widget .widget-body input:focus,
#livechat-widget .widget-body textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

#livechat-widget .widget-body textarea {
    min-height: 65px;
    resize: none;
}

#livechat-widget .widget-body .submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #0073aa, #006699);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 2px;
    font-family: inherit;
}

#livechat-widget .widget-body .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,115,170,0.3);
}

#livechat-widget .widget-body .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ----- ERROR ----- */
#livechat-widget .widget-body #livechat-error {
    display: none;
    background: #fee2e2;
    color: #991b1b;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    border-left: 3px solid #ef4444;
}

/* ----- SUCCESS ----- */
#livechat-widget .widget-body #livechat-success {
    display: none;
    text-align: center;
    padding: 20px 10px;
}

#livechat-widget .widget-body #livechat-success .icon {
    font-size: 40px;
    margin-bottom: 6px;
}

#livechat-widget .widget-body #livechat-success h4 {
    margin: 0 0 4px 0;
    color: #1e293b;
    font-size: 16px;
}

#livechat-widget .widget-body #livechat-success p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

/* ----- FOOTER ----- */
#livechat-widget .widget-footer {
    padding: 8px 18px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    #livechat-widget {
        right: 10px;
        bottom: 80px;
        width: calc(100vw - 20px);
        max-height: 460px;
        border-radius: 14px;
    }
    
    #livechat-button {
        bottom: 20px;
        right: 20px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    #livechat-button span:not(.badge) {
        display: none;
    }
    
    #livechat-button .badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -4px;
        right: -4px;
    }
    
    #livechat-widget .widget-body {
        padding: 12px 14px;
    }
    
    #livechat-widget .widget-body textarea {
        min-height: 55px;
    }
    
    #livechat-widget .widget-body input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    #livechat-widget .widget-header {
        padding: 12px 16px;
    }
    
    #livechat-widget .widget-header .avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    #livechat-widget .widget-header .header-info .title {
        font-size: 14px;
    }
}