/* Navoto AI Chatbot - Premium Styles */

.navoto-hidden {
    display: none !important;
}

/* Launch Button */
.navoto-ai-launch-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999998;
}

.navoto-ai-launch-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

.navoto-ai-launch-btn svg {
    width: 22px;
    height: 22px;
}

.navoto-ai-inline-btn {
    position: relative;
    bottom: auto;
    right: auto;
    display: inline-flex;
    margin: 10px 0;
}

/* Modal Overlay */
.navoto-ai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: navotoFadeIn 0.4s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@keyframes navotoFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Content Box */
.navoto-ai-modal-content {
    background: #0f111a;
    width: 100%;
    max-width: 850px;
    height: 80vh;
    min-height: 550px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(99, 102, 241, 0.1);
    position: relative;
    display: flex;
    overflow: hidden;
    animation: navotoSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes navotoSlideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close Button */
.navoto-ai-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
}

.navoto-ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* Chat container */
#navoto-ai-app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    color: #e2e8f0;
    overflow: hidden;
    width: 100%;
    direction: ltr;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Messages Area */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 60px 40px 20px;
    display: flex;
    flex-direction: column;
    direction: ltr;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 40px;
}

.welcome-avatar {
    position: relative;
    margin-bottom: 30px;
}

.avatar-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
    animation: navotoPulse 3s infinite;
}

@keyframes navotoPulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 0.4;
    }
}

.avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(99, 102, 241, 0.5);
    position: relative;
    z-index: 1;
}

.navoto-n-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    background: linear-gradient(135deg, #0b5de8, #2f7dff);
    box-shadow: 0 12px 30px rgba(11, 93, 232, 0.45);
    font-family: 'Inter', sans-serif;
}

.welcome-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 32px;
    max-width: 450px;
    line-height: 1.6;
}

.navoto-ai-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 30px;
    width: 100%;
    max-width: 600px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: #fff !important;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn.meeting {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.action-btn.meeting:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.action-btn.price {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.action-btn.price:hover {
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    transform: translateY(-2px);
}

.action-btn.whatsapp {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.action-btn.whatsapp:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    transform: translateY(-2px);
}

.action-icon {
    width: 20px;
    height: 20px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
}

.starter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 700px;
    margin-top: 18px;
}

#navoto-ai-app-container .starter-options .starter-option-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 100px !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    transition: 0.3s !important;
    white-space: nowrap !important;
}

#navoto-ai-app-container .starter-options .starter-option-btn:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    transform: translateY(-2px) !important;
}

.chip {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.chip:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    transform: translateY(-2px);
}

/* Messages List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 16px;
    animation: navotoMessageIn 0.4s ease;
    max-width: 80%;
}

@keyframes navotoMessageIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    direction: ltr;
}

.message.user .message-content {
    align-items: flex-end;
}

.message-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 10px;
}

.message-sender {
    font-weight: 600;
    color: #94a3b8;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
    direction: ltr;
    unicode-bidi: plaintext;
    max-width: 100%;
}

.message.bot .message-bubble {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 4px;
    color: #f1f5f9;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-top-right-radius: 4px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

/* Typing indicator */
.typing-indicator {
    padding: 10px 40px 20px;
}

.typing-bubble {
    display: inline-flex;
    gap: 5px;
    padding: 14px 18px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    border-top-left-radius: 4px;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    animation: navotoTyping 1.4s infinite;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes navotoTyping {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
        background: #a5b4fc;
    }
}

/* Input Area */
.input-area {
    padding: 20px 30px 30px;
    background: rgba(15, 17, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background: #1e293b;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    padding: 12px 12px 12px 24px;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
    background: #1e293b;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    outline: none !important;
    color: #fff;
    font-size: 15px;
    resize: none;
    max-height: 150px;
    overflow-y: auto;
    padding: 6px 0;
}

.message-input::placeholder {
    color: #64748b;
}

.services-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
    flex-shrink: 0;
}

.services-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.services-btn svg {
    width: 18px;
    height: 18px;
}

.mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #64748b;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    flex-shrink: 0;
}

.mic-btn:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.mic-btn.recording {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: navotoPulse 1.5s infinite;
}

.mic-btn svg {
    width: 20px;
    height: 20px;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    flex-shrink: 0;
}

.send-btn:disabled {
    background: #334155;
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* -------------------------------------------------------------------------
   Mobile: full-width chat sheet, touch-friendly (desktop unchanged above)
   ------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .navoto-ai-modal-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        -webkit-overflow-scrolling: touch;
    }

    .navoto-ai-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: none;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        box-shadow: none;
        animation: navotoSlideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes navotoSlideUpMobile {
        from {
            transform: translateY(100%);
            opacity: 0.95;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .navoto-ai-close-btn {
        top: max(12px, env(safe-area-inset-top, 12px));
        right: max(12px, env(safe-area-inset-right, 12px));
        width: 44px;
        height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    #navoto-ai-app-container {
        min-height: 0;
        flex: 1;
    }

    .chat-area {
        min-height: 0;
    }

    .messages-container {
        flex: 1;
        min-height: 0;
        padding: max(52px, calc(env(safe-area-inset-top, 0px) + 44px)) max(14px, env(safe-area-inset-right, 14px)) 12px max(14px, env(safe-area-inset-left, 14px));
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    .welcome-screen {
        padding: 0 max(12px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
        justify-content: flex-start;
        padding-top: 8px;
    }

    .welcome-avatar {
        margin-bottom: 20px;
    }

    .avatar-img,
    .navoto-n-avatar {
        width: 80px;
        height: 80px;
        font-size: 44px;
    }

    .welcome-title {
        font-size: 22px;
        line-height: 1.25;
        padding: 0 4px;
    }

    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
        max-width: 100%;
        padding: 0 4px;
    }

    .navoto-ai-quick-actions {
        max-width: 100%;
        gap: 10px;
        margin-bottom: 20px;
        padding: 0 4px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }

    .suggestion-chips,
    .starter-options {
        max-width: 100%;
        gap: 8px;
        padding: 0 4px;
        justify-content: flex-start;
    }

    #navoto-ai-app-container .starter-options .starter-option-btn,
    .chip {
        white-space: normal !important;
        text-align: center;
        line-height: 1.35;
        padding: 10px 14px !important;
        font-size: 13px !important;
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
        max-width: 100%;
    }

    .messages-list {
        gap: 16px;
        padding-bottom: 8px;
    }

    .message {
        max-width: min(92%, calc(100vw - 28px));
        gap: 10px;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
    }

    .message-bubble {
        font-size: 15px;
        padding: 12px 14px;
        border-radius: 16px;
    }

    .message-meta {
        font-size: 11px;
    }

    .typing-indicator {
        padding: 8px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    }

    .input-area {
        padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        flex-shrink: 0;
    }

    /* Composer: full-width text field, action buttons on second row */
    .input-wrapper {
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        column-gap: 10px;
        row-gap: 12px;
        padding: 12px;
        border-radius: 22px;
    }

    .message-input {
        flex: 1 1 100%;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        align-self: stretch;
        font-size: 16px;
        max-height: 120px;
        min-height: 24px;
        padding: 8px 4px;
    }

    .input-wrapper .services-btn,
    .input-wrapper .mic-btn,
    .input-wrapper .send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex: 0 0 auto;
        -webkit-tap-highlight-color: transparent;
    }

    .navoto-ai-launch-btn {
        bottom: max(20px, env(safe-area-inset-bottom, 20px));
        right: max(16px, env(safe-area-inset-right, 16px));
        padding: 12px 18px;
        font-size: 14px;
    }

    .navoto-ai-inline-btn {
        margin: 8px 0;
    }
}

@media screen and (max-width: 380px) {
    .welcome-title {
        font-size: 20px;
    }

    #navoto-ai-app-container .starter-options .starter-option-btn,
    .chip {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .message {
        max-width: min(96%, calc(100vw - 20px));
    }
}