/* =========================================================================
   KIRTIKA INFOTECH - ULTRA COMPACT & HIGH CONTRAST AI CHATBOT (V4)
   ========================================================================= */

/* Floating Launcher Button - Ultra Compact */
.kirtika-ai-launcher {
    position: fixed;
    bottom: 16px;
    right: 76px;
    z-index: 999990;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

@media (max-width: 1024px) {
    .kirtika-ai-launcher {
        bottom: 64px;
        right: 12px;
    }
}

.kirtika-ai-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #0284C7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.15s ease;
}

.kirtika-ai-launcher:hover .kirtika-ai-btn {
    transform: scale(1.05);
    background: #0369a1;
}

.kirtika-ai-tooltip {
    background: #0f172a;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chat Window Modal - Ultra Compact & Slim */
.kirtika-ai-modal {
    position: fixed;
    bottom: 68px;
    right: 16px;
    width: 350px;
    max-width: calc(100vw - 24px);
    height: 490px;
    max-height: calc(100vh - 90px);
    z-index: 999995;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform: scale(0.96) translateY(8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', 'Segoe UI', Roboto, sans-serif;
    background: #0b1120;
    color: #f8fafc;
    font-size: 12px;
}

.kirtika-ai-modal.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 640px) {
    .kirtika-ai-modal {
        bottom: 64px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: 100%;
        height: calc(100vh - 130px);
        max-height: 480px;
        border-radius: 12px;
    }
}

/* Light Theme Modal Styling */
html:not(.dark) .kirtika-ai-modal {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.2);
}

/* Chat Header */
.kirtika-ai-header {
    padding: 8px 12px;
    background: #070c18;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

html:not(.dark) .kirtika-ai-header {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.kirtika-ai-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #0284C7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffffff;
}

/* Category Tabs Bar */
.kirtika-category-tabs {
    display: flex;
    gap: 3px;
    padding: 5px 10px;
    background: #070c18;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    flex-shrink: 0;
}

html:not(.dark) .kirtika-category-tabs {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.kirtika-category-tabs::-webkit-scrollbar {
    display: none;
}

.kirtika-tab-btn {
    padding: 2.5px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #94a3b8;
    transition: all 0.12s ease;
}

.kirtika-tab-btn.active, .kirtika-tab-btn:hover {
    background: rgba(56, 189, 248, 0.16);
    color: #38BDF8;
}

html:not(.dark) .kirtika-tab-btn {
    color: #475569;
}
html:not(.dark) .kirtika-tab-btn.active, html:not(.dark) .kirtika-tab-btn:hover {
    background: #e0f2fe;
    color: #0284C7;
}

/* Chat Body */
.kirtika-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.kirtika-ai-body::-webkit-scrollbar {
    width: 3px;
}
.kirtika-ai-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

/* Message Bubbles - High Contrast & Crisp */
.kirtika-msg {
    display: flex;
    flex-direction: column;
    max-width: 92%;
    gap: 2px;
}

.kirtika-msg.bot {
    align-self: flex-start;
}

.kirtika-msg.user {
    align-self: flex-end;
}

.kirtika-bubble {
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
    font-weight: 400;
}

/* Dark Mode Bubble Colors - 100% High Contrast */
.kirtika-msg.bot .kirtika-bubble {
    background: #131e32;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 2px;
}

.kirtika-msg.bot .kirtika-bubble strong {
    color: #ffffff !important;
    font-weight: 600;
}

.kirtika-msg.bot .kirtika-bubble a {
    color: #38BDF8 !important;
    font-weight: 600;
    text-decoration: underline;
}

.kirtika-msg.user .kirtika-bubble {
    background: #0284C7;
    color: #ffffff !important;
    border-bottom-right-radius: 2px;
    font-weight: 500;
}

/* Light Mode Bubble Colors - 100% High Contrast */
html:not(.dark) .kirtika-msg.bot .kirtika-bubble {
    background: #f1f5f9;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
}

html:not(.dark) .kirtika-msg.bot .kirtika-bubble strong {
    color: #020617 !important;
    font-weight: 600;
}

html:not(.dark) .kirtika-msg.bot .kirtika-bubble a {
    color: #0284C7 !important;
    font-weight: 600;
    text-decoration: underline;
}

.kirtika-msg-time {
    font-size: 9px;
    opacity: 0.6;
    padding: 0 2px;
    color: #94a3b8;
}

/* Typing Indicator */
.kirtika-typing {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    border-radius: 10px;
    background: #131e32;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: fit-content;
}

html:not(.dark) .kirtika-typing {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.kirtika-typing span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #38BDF8;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.kirtika-typing span:nth-child(1) { animation-delay: -0.32s; }
.kirtika-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Action Buttons Grid */
.kirtika-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.kirtika-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.12s ease;
    background: rgba(56, 189, 248, 0.1);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    cursor: pointer;
    text-align: left;
}

html:not(.dark) .kirtika-action-btn {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.kirtika-action-btn.demo-btn {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
    border-color: rgba(245, 158, 11, 0.3);
}

html:not(.dark) .kirtika-action-btn.demo-btn {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.kirtika-action-btn:hover {
    background: #0284C7;
    color: #ffffff !important;
    border-color: transparent;
}

.kirtika-action-btn.demo-btn:hover {
    background: #d97706;
    color: #ffffff !important;
    border-color: transparent;
}

/* Auto-Reply Option Pills */
.kirtika-options-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}

.kirtika-opt-pill {
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 500;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.12s ease;
}

.kirtika-opt-pill:hover {
    background: #0284C7;
    color: #ffffff;
    border-color: #0284C7;
}

html:not(.dark) .kirtika-opt-pill {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}
html:not(.dark) .kirtika-opt-pill:hover {
    background: #0284C7;
    color: #ffffff;
    border-color: #0284C7;
}

/* Inline Phone Capture Box - Ultra Compact */
.kirtika-phone-card {
    background: #070c18;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    padding: 6px 8px;
    margin-top: 5px;
}

html:not(.dark) .kirtika-phone-card {
    background: #f8fafc;
    border-color: #93c5fd;
}

.kirtika-phone-input-wrap {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.kirtika-phone-input {
    flex: 1;
    background: #131e32;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    outline: none;
}

html:not(.dark) .kirtika-phone-input {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.kirtika-phone-submit-btn {
    background: #16a34a;
    color: #ffffff;
    font-weight: 600;
    font-size: 10.5px;
    padding: 4px 8px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.kirtika-phone-submit-btn:hover {
    background: #15803d;
}

/* Quick Replies Bar */
.kirtika-quick-replies {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 5px 10px 2px 10px;
    flex-shrink: 0;
}

.kirtika-quick-replies::-webkit-scrollbar {
    display: none;
}

.kirtika-chip {
    flex-shrink: 0;
    padding: 2.5px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: #131e32;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.12s ease;
}

.kirtika-chip:hover {
    background: #0284C7;
    color: #ffffff;
    border-color: #0284C7;
}

html:not(.dark) .kirtika-chip {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}
html:not(.dark) .kirtika-chip:hover {
    background: #0284C7;
    color: #ffffff;
    border-color: #0284C7;
}

/* Chat Input Footer */
.kirtika-ai-footer {
    padding: 6px 10px;
    background: #070c18;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

html:not(.dark) .kirtika-ai-footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

.kirtika-ai-input {
    flex: 1;
    background: #131e32;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 11.5px;
    outline: none;
    font-family: inherit;
}

.kirtika-ai-input:focus {
    border-color: #0284C7;
}

html:not(.dark) .kirtika-ai-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}
html:not(.dark) .kirtika-ai-input:focus {
    border-color: #0284C7;
}

.kirtika-icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
    background: transparent;
    color: #94a3b8;
}

.kirtika-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

html:not(.dark) .kirtika-icon-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.kirtika-send-btn {
    background: #0284C7;
    color: #ffffff !important;
}

.kirtika-send-btn:hover {
    background: #0369a1;
}

.kirtika-voice-active {
    background: #dc2626 !important;
    color: #ffffff !important;
}
