/**
 * NOAS Chat Widget - New Ocean Group UI Styles
 */

:root {
    --noas-primary:      #0077c8;
    --noas-primary-dark: #005fa3;
    --noas-text:         #1a1a1a;
    --noas-text-muted:   #6b7280;
    --noas-border:       #e5e7eb;
    --noas-sidebar-bg:   #ffffff;
    --noas-sidebar-text: #374151;
    --noas-sidebar-border: #e5e7eb;
}

/* ==========================================
   EMBED INPUT — shortcode [noas_chat]
   ========================================== */
.noas-chat-embed {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.noas-embed-wrap {
    display: flex !important;
    align-items: center !important;
    background: rgba(254, 253, 254, 0.66) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 7px 7px 7px 20px !important;
    transition: background .2s, box-shadow .2s;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box !important;
    overflow: hidden !important;
}
.noas-embed-wrap:focus-within {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}
.noas-chat-embed .noas-embed-wrap textarea.noas-embed-input,
.noas-chat-embed textarea.noas-embed-input,
textarea.noas-embed-input {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    background: transparent !important;
    font-size: 15px !important;
    resize: none !important;
    min-height: unset !important;
    height: 36px !important;
    max-height: 36px !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    color: #1a1a1a !important;
    padding: 9px 8px 9px 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border-radius: 0 !important;
}
.noas-embed-input::placeholder { color: #777 !important; }

/* Force SVG icon visible — Flatsome may hide SVGs inside buttons */
.noas-embed-send svg {
    fill: #fff !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
    overflow: visible !important;
}
.noas-embed-send {
    background: var(--noas-primary) !important;
    border: none !important;
    cursor: pointer !important;
    color: #fff !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: background .15s, transform .1s;
}
.noas-embed-send:hover {
    background: var(--noas-primary-dark);
    transform: scale(1.06);
}
.noas-embed-try {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    margin-top: 12px;
}
.noas-embed-try-label {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    flex-shrink: 0;
}
.noas-embed-try-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-family: inherit;
    padding: 2px 0;
    transition: color .15s;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 0;
    flex-shrink: 1;
    max-width: 45%;
    text-transform: none !important;
}
.noas-embed-try-btn:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==========================================
   BACKDROP + MODAL
   ========================================== */
.agentiq-chat-backdrop {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2vh 2vw !important;
}
.agentiq-chat-backdrop.open {
    display: flex !important;
}
.agentiq-chat-modal {
    background: #fff !important;
    width: 96vw !important;
    max-width: 1600px !important;
    height: 94vh !important;
    max-height: 1000px !important;
    border-radius: 12px !important;
    position: relative !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.25) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: noasSlideIn .22s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--noas-text) !important;
}

/* ==========================================
   MODAL TOP HEADER — logo + close
   ========================================== */
.agentiq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 20px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--noas-border);
    flex-shrink: 0;
}
.agentiq-modal-logo {
    display: flex;
    align-items: center;
}
.agentiq-logo-img {
    height: 34px;
    width: auto;
    display: block;
}
.agentiq-logo-text {
    font-size: 17px;
    font-weight: 800;
    color: var(--noas-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}
@keyframes noasSlideIn {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================
   CONVERSATION VIEW — 2-panel layout
   ========================================== */
.agentiq-conv-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────── */
.agentiq-sidebar {
    width: 240px;
    background: var(--noas-sidebar-bg);
    border-right: 1px solid var(--noas-border);
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.agentiq-new-chat {
    background: none;
    border: 1px solid var(--noas-border);
    border-radius: 8px;
    color: var(--noas-text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .15s, border-color .15s;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.agentiq-new-chat:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.agentiq-sidebar-trending {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.agentiq-sidebar-label {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}
.agentiq-sidebar-questions {
    list-style: none;
    margin: 0;
    padding: 0;
}
.agentiq-sidebar-question {
    border-radius: 6px;
    margin-bottom: 1px;
}
.agentiq-sidebar-question button {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 8px 10px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-radius: 6px;
    transition: background .12s, color .12s;
    text-transform: none !important;
}
.agentiq-sidebar-question button::before {
    content: '›';
    color: #d1d5db;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.2;
}
.agentiq-sidebar-question button:hover {
    background: #f3f4f6;
    color: var(--noas-primary);
}
.agentiq-sidebar-question button:hover::before { color: var(--noas-primary); }

/* Sidebar — Contact section */
.agentiq-sidebar-contact {
    margin-top: 16px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-top: 3px solid var(--noas-primary);
    border-radius: 10px;
    padding: 14px 12px;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.agentiq-contact-label {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 4px;
}
.agentiq-contact-desc {
    font-size: 13px;
    color: #374151;
    margin: 0 0 12px;
    line-height: 1.4;
}
.agentiq-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    background: var(--noas-primary);
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 10px;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agentiq-contact-btn:hover {
    background: var(--noas-primary-dark);
    color: #fff;
    text-decoration: none;
}

/* ── Main Panel ────────────────────────────── */
.agentiq-main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

/* Panel Header */
.agentiq-panel-header {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--noas-border);
    flex-shrink: 0;
    background: #fff;
}
.agentiq-agent-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.agentiq-robot-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--noas-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.agentiq-agent-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--noas-text);
    line-height: 1.2;
}
.agentiq-agent-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #22c55e;
    letter-spacing: 0.04em;
}
.agentiq-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.agentiq-chat-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #9ca3af;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color .15s, background .15s;
    line-height: 1;
    flex-shrink: 0;
}
.agentiq-chat-close:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Messages container */
.agentiq-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================
   USER MESSAGE
   ========================================== */
.agentiq-user-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    justify-content: flex-start;
    flex-direction: row;
}
.agentiq-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.agentiq-user-text {
    background: #1a1a1a;
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 75%;
}

/* ==========================================
   BOT MESSAGE
   ========================================== */
.agentiq-bot-message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
}
.agentiq-bot-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #eef3ff;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}
.agentiq-bot-disclaimer-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--noas-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.agentiq-bot-content {
    font-size: 14px;
    font-weight: 400 !important;
    color: var(--noas-text);
    line-height: 1.7;
}
.agentiq-bot-content h1,
.agentiq-bot-content h2,
.agentiq-bot-content h3,
.agentiq-bot-content h4 { font-weight: 700 !important; color: #111; margin: 18px 0 6px; }
.agentiq-bot-content h1 { font-size: 18px; }
.agentiq-bot-content h2 { font-size: 16px; }
.agentiq-bot-content h3 { font-size: 15px; }
.agentiq-bot-content h4 { font-size: 14px; }
.agentiq-bot-content p  { margin: 8px 0; font-weight: 400 !important; }
.agentiq-bot-content ul,
.agentiq-bot-content ol { padding-left: 22px; margin: 8px 0; }
.agentiq-bot-content li { margin: 5px 0; font-weight: 400 !important; }
.agentiq-bot-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 400 !important;
}
.agentiq-bot-content pre {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 12px 0;
}
.agentiq-bot-content pre code { background: none; padding: 0; }
.agentiq-bot-content strong,
.agentiq-bot-content b { font-weight: 700 !important; color: #111; }
.agentiq-bot-content a { color: var(--noas-primary); text-decoration: none; }
.agentiq-bot-content a:hover { text-decoration: underline; }
.agentiq-bot-content blockquote {
    border-left: 3px solid var(--noas-primary);
    margin: 10px 0;
    padding: 4px 14px;
    color: #555;
    font-weight: 400 !important;
}
.agentiq-bot-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.agentiq-bot-content thead tr { background: #f0f4ff; }
.agentiq-bot-content th { text-align: left; padding: 9px 14px; font-weight: 600 !important; color: #333; border: 1px solid #dde4f0; }
.agentiq-bot-content td { padding: 8px 14px; border: 1px solid #e8ecf4; vertical-align: top; line-height: 1.5; }
.agentiq-bot-content tbody tr:nth-child(even) { background: #f8f9fc; }
.agentiq-bot-content tbody tr:hover { background: #eef3ff; }

/* Typing indicator */
.agentiq-typing { display: flex; gap: 5px; align-items: center; padding: 6px 0; }
.agentiq-typing-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #bbb;
    animation: noasTypingBounce 1.1s infinite;
}
.agentiq-typing-dot:nth-child(2) { animation-delay: .16s; }
.agentiq-typing-dot:nth-child(3) { animation-delay: .32s; }
@keyframes noasTypingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-7px); }
}

/* Suggestion buttons */
.agentiq-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.agentiq-suggestion-btn {
    background: #fff;
    border: 1px solid #d8e4f8;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--noas-primary);
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    transition: background .15s, border-color .15s, box-shadow .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    text-transform: none !important;
}
.agentiq-suggestion-btn:hover {
    background: #eef4ff;
    border-color: var(--noas-primary);
    box-shadow: 0 2px 8px rgba(0,119,200,0.12);
}

/* ==========================================
   CONVERSATION INPUT AREA
   ========================================== */
.agentiq-conv-input-area {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--noas-border);
    background: #fff;
    flex-shrink: 0;
}
.agentiq-conv-input-box {
    border: 1.5px solid #d0d7e8 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center;
    padding: 8px 8px 8px 16px;
    background: #f8faff !important;
    transition: border-color .2s, box-shadow .2s;
}
.agentiq-conv-input-box:focus-within {
    border-color: var(--noas-primary) !important;
    background: #fff !important;
    box-shadow: 0 2px 12px rgba(0, 119, 200, 0.13) !important;
}
/* Kill any theme borders on textareas inside modal */
#agentiq-chat-modal textarea {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}
.agentiq-conv-input,
#agentiq-chat-modal textarea.agentiq-conv-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    font-size: 14px;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    color: var(--noas-text);
    background: transparent !important;
    font-family: inherit;
    line-height: 1.5;
    padding: 6px 0 !important;
    appearance: none;
    -webkit-appearance: none;
}
.agentiq-conv-input::placeholder { color: #888; }
.agentiq-conv-send {
    background: var(--noas-primary) !important;
    border: none !important;
    cursor: pointer !important;
    color: #fff !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: background .15s, transform .1s;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.agentiq-conv-send svg {
    fill: #fff !important;
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
}
.agentiq-conv-send:hover {
    background: var(--noas-primary-dark);
    transform: scale(1.06);
}
.agentiq-footer-disclaimer {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .agentiq-chat-modal {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    .agentiq-sidebar { display: none; }
    .agentiq-chat-messages { padding: 16px; }
    .agentiq-conv-input-area { padding: 10px 14px 14px; }
    .agentiq-modal-header { padding: 0 14px; }
}
