/* NP-Chat Widget Styles - Fixed Layout */
#np-chat-widget-container {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
}

#np-chat-widget-container * {
    box-sizing: border-box;
    pointer-events: auto;
}

/* ================================================================
   CHAT BUBBLE
   ================================================================ */
#np-chat-bubble {
    width: 60px;
    height: 60px;
    background: #007cba;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: white;
    font-size: 24px;
    transition: transform 0.2s ease;
    pointer-events: auto;
    position: relative;
    z-index: 100001;
}

#np-chat-bubble:hover {
    transform: scale(1.05);
}

/* ================================================================
   CHAT WINDOW
   ================================================================ */
#np-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: 95vw;
    height: 600px;
    max-height: 85vh;
    min-height: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d0d0d0;
    z-index: 100001;
    pointer-events: auto;
}

/* ================================================================
   HEADER - Blue toolbar
   ================================================================ */
.np-chat-header {
    background: #007cba !important;
    background-color: #007cba !important;
    color: #ffffff !important;
    padding: 12px 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    min-height: 48px !important;
    height: 48px !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-bottom: 2px solid #005a87 !important;
    width: 100% !important;
    z-index: 10 !important;
    position: relative !important;
}

.np-chat-title {
    font-weight: 700 !important;
    font-size: 15px !important;
    margin: 0 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.np-chat-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.np-chat-contact-btn-header {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 15px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.np-chat-contact-btn-header:hover {
    background: rgba(255,255,255,0.3) !important;
}

.np-chat-close {
    background: none !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 24px !important;
    cursor: pointer !important;
    padding: 0 5px !important;
    line-height: 1 !important;
    transition: color 0.2s !important;
}

.np-chat-close:hover {
    color: #ff6b6b !important;
}

/* ================================================================
   CHAT BODY
   ================================================================ */
.np-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: #f5f6f8;
    position: relative;
    z-index: 1;
}

/* ================================================================
   LANGUAGE SECTION
   ================================================================ */
.np-chat-language-section {
    padding: 8px 12px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e5e5 !important;
    flex-shrink: 0 !important;
    display: block !important;
    z-index: 2 !important;
    position: relative !important;
}

.np-chat-language-selectors {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
}

.np-chat-language-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.np-chat-language-group label {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    white-space: nowrap !important;
    min-width: 40px !important;
}

.np-chat-input-lang,
.np-chat-output-lang {
    padding: 3px 6px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    background: #ffffff !important;
    color: #333333 !important;
    width: 100% !important;
    min-height: 26px !important;
    height: 26px !important;
}

/* ================================================================
   VOICE SECTION
   ================================================================ */
.np-chat-voice-section {
    padding: 6px 12px !important;
    background: #f0f4ff !important;
    border-bottom: 1px solid #ddd !important;
    flex-shrink: 0 !important;
    display: block !important;
    z-index: 2 !important;
    position: relative !important;
}

.np-chat-input-method {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.method-option {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 3px 8px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    background: #ffffff !important;
    font-size: 11px !important;
}

.method-option.active {
    border-color: #007cba !important;
    background-color: #e7f3ff !important;
}

.method-option.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.method-option input[type="radio"] {
    display: none !important;
}

.method-icon {
    font-size: 12px !important;
}

.method-label {
    font-size: 11px !important;
    color: #333333 !important;
}

/* ================================================================
   VOICE SELECTION
   ================================================================ */
#np-voice-selection {
    display: block !important;
    margin-top: 6px !important;
    padding: 6px 10px !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    border: 1px solid #e1e5e9 !important;
}

#np-voice-selection .voice-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    margin-bottom: 6px !important;
}

#np-voice-selection .voice-row label {
    font-size: 11px !important;
    font-weight: 600 !important;
    min-width: 44px !important;
    color: #333333 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

#np-voice-selection .voice-row #np-voice-select {
    flex: 1 !important;
    min-width: 80px !important;
    padding: 3px 6px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    background: #ffffff !important;
    color: #333333 !important;
    min-height: 26px !important;
    height: 26px !important;
}

#np-voice-selection .button-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    padding-top: 4px !important;
    border-top: 1px solid #eee !important;
}

/* ================================================================
   VOICE BUTTONS - Compact
   ================================================================ */
.voice-test-btn,
.voice-stop-btn,
.np-voice-btn,
.np-voice-contact-btn {
    flex: 0 0 auto !important;
    border: none !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    min-height: 26px !important;
    height: 26px !important;
    min-width: 50px !important;
    white-space: nowrap !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.voice-test-btn {
    background: #007cba !important;
}
.voice-test-btn:hover {
    background: #005a87 !important;
}

.voice-stop-btn {
    background: #dc2626 !important;
}
.voice-stop-btn:hover {
    background: #b91c1c !important;
}

.np-voice-btn {
    background: #28a745 !important;
}
.np-voice-btn:hover {
    background: #218838 !important;
}
.np-voice-btn.listening {
    background: #dc2626 !important;
    animation: pulse 1.5s infinite !important;
}

.np-voice-contact-btn {
    background: #6f42c1 !important;
}
.np-voice-contact-btn:hover {
    background: #5a32a3 !important;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

.np-voice-status {
    margin-top: 4px !important;
    padding: 3px !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    font-size: 9px !important;
    text-align: center !important;
    color: #2e7d32 !important;
}

/* ================================================================
   MESSAGES AREA - FIXED SCROLLING
   ================================================================ */
.np-chat-messages {
    flex: 1 1 auto !important;
    padding: 10px 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #f5f6f8 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    min-height: 100px !important;
    max-height: none !important;
    height: 100% !important;
    position: relative !important;
    z-index: 1 !important;
}

.np-chat-messages::-webkit-scrollbar {
    width: 4px !important;
}
.np-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 2px !important;
}
.np-chat-messages::-webkit-scrollbar-thumb {
    background: #007cba !important;
    border-radius: 2px !important;
}

.np-chat-message {
    display: flex !important;
    flex-shrink: 0 !important;
}

.np-chat-message.user {
    justify-content: flex-end !important;
}

.np-chat-message.bot {
    justify-content: flex-start !important;
}

.np-chat-message-bubble {
    max-width: 85% !important;
    padding: 8px 12px !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
}

.np-chat-message.user .np-chat-message-bubble {
    background: #007cba !important;
    color: #ffffff !important;
    border-bottom-right-radius: 4px !important;
}

.np-chat-message.bot .np-chat-message-bubble {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #ddd !important;
    border-bottom-left-radius: 4px !important;
}

/* ================================================================
   VIDEO EMBED INSIDE CHAT
   ================================================================ */
.np-chat-message-bubble .video-embed {
    margin-top: 6px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #000000 !important;
    max-width: 100% !important;
}

.np-chat-message-bubble .video-embed iframe {
    width: 100% !important;
    height: 160px !important;
    border: none !important;
    max-width: 100% !important;
    display: block !important;
}

.np-chat-message-bubble .video-embed .video-caption {
    padding: 4px 10px !important;
    background: #1a1a2e !important;
    color: #ffffff !important;
    font-size: 10px !important;
    text-align: center !important;
}

/* ================================================================
   INPUT AREA
   ================================================================ */
.np-chat-input-area {
    padding: 8px 12px !important;
    background: #ffffff !important;
    border-top: 1px solid #ddd !important;
    flex-shrink: 0 !important;
    z-index: 2 !important;
    position: relative !important;
}

.np-chat-input-row {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
}

.np-chat-input {
    flex: 1 !important;
    padding: 6px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    resize: none !important;
    min-height: 32px !important;
    max-height: 80px !important;
    color: #333333 !important;
    background: #ffffff !important;
}

.np-chat-input:focus {
    border-color: #007cba !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.2) !important;
}

.np-chat-send {
    background: #007cba !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 14px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-height: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.np-chat-send:hover {
    background: #005a87 !important;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 480px) {
    #np-chat-window {
        width: 95vw !important;
        right: 2.5vw !important;
        bottom: 70px !important;
        height: 75vh !important;
        min-height: 350px !important;
        max-width: 95vw !important;
    }
    
    .np-chat-language-selectors {
        flex-direction: column !important;
        gap: 3px !important;
    }
    
    .np-chat-language-group {
        min-width: 100% !important;
    }
    
    .np-chat-language-group label {
        min-width: 40px !important;
        font-size: 9px !important;
    }
    
    .voice-test-btn,
    .voice-stop-btn,
    .np-voice-btn,
    .np-voice-contact-btn {
        min-width: 42px !important;
        padding: 3px 6px !important;
        font-size: 9px !important;
        min-height: 24px !important;
        height: 24px !important;
    }
    
    .np-chat-send {
        min-height: 28px !important;
        height: 28px !important;
        padding: 3px 10px !important;
        font-size: 10px !important;
    }
    
    .np-chat-input {
        min-height: 28px !important;
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
    
    #np-voice-selection .voice-row #np-voice-select {
        min-width: 60px !important;
        font-size: 9px !important;
    }
    
    .np-chat-message-bubble {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    #np-chat-bubble {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}


