/* NASR Smart Bot Styles — Themed & Visible */

#nasr-chat-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 999999;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

#nasr-chat-toggle:hover {
    transform: scale(1.1) translateY(-5px);
}

#nasr-chat-toggle img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

#nasr-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: var(--color-bg-card, white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.2));
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    font-family: var(--font-body, 'Inter', sans-serif);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
    transition: background-color var(--theme-transition, 0.3s), color var(--theme-transition, 0.3s);
}

#nasr-chat-widget.open {
    display: flex;
    animation: slideUp 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    background: linear-gradient(135deg, var(--color-primary, #0F172A) 0%, #1e1e2f 100%);
    color: white !important;
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-secondary, #C5A039);
}

.chat-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: white !important;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    letter-spacing: 0.5px;
}

#nasr-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#nasr-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#nasr-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--color-bg-light, #f8fafc);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    background: var(--color-secondary, #C5A039);
    color: white !important;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(197, 160, 57, 0.25);
}

.chat-message.bot {
    background: var(--color-bg-card, white);
    color: var(--color-text, #1e293b) !important;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border, #e2e8f0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-message.bot a {
    color: var(--color-secondary, #C5A039) !important;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.chat-message.bot .btn-contact {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--color-secondary, #C5A039);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(197, 160, 57, 0.3);
    text-align: center;
}

.chat-message.bot .btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(197, 160, 57, 0.4);
    background: #b08d30;
}

.chat-input-area {
    padding: 20px;
    background: var(--color-bg-card, white);
    border-top: 1px solid var(--glass-border, #e2e8f0);
    display: flex;
    gap: 12px;
    align-items: center;
}

#nasr-chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--glass-border, #e2e8f0);
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-body, 'Inter', sans-serif);
    outline: none;
    transition: all 0.2s;
    background: var(--color-bg-light, #f8fafc);
    color: var(--color-text, #1e293b);
}

#nasr-chat-input:focus {
    border-color: var(--color-secondary, #C5A039);
    box-shadow: 0 0 0 3px rgba(197, 160, 57, 0.1);
    background: var(--color-bg-card, white);
}

#nasr-chat-send {
    padding: 12px 22px;
    background: var(--color-secondary, #C5A039);
    color: white !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(197, 160, 57, 0.2);
}

#nasr-chat-send:hover {
    background: var(--color-primary, #0F172A);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, 0.3);
}

/* Dark Mode Overrides — Ensuring visibility and theme match */
html.dark-mode #nasr-chat-toggle,
body.dark-mode #nasr-chat-toggle {
    background: transparent;
    box-shadow: none;
}

html.dark-mode #nasr-chat-toggle:hover,
body.dark-mode #nasr-chat-toggle:hover {
    box-shadow: none;
}

html.dark-mode #nasr-chat-widget,
body.dark-mode #nasr-chat-widget {
    border-color: rgba(255, 255, 255, 0.1);
    background: #0f172a;
}

html.dark-mode .chat-header,
body.dark-mode .chat-header {
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    border-bottom-color: var(--color-secondary, #06B6D4);
}

html.dark-mode #nasr-chat-messages,
body.dark-mode #nasr-chat-messages {
    background: #020617;
}

html.dark-mode .chat-message.bot,
body.dark-mode .chat-message.bot {
    background: #1e293b;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .chat-message.user,
body.dark-mode .chat-message.user {
    background: var(--color-secondary, #06B6D4);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

html.dark-mode .chat-message.bot .btn-contact,
body.dark-mode .chat-message.bot .btn-contact {
    background: var(--color-secondary, #06B6D4);
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.4);
}

html.dark-mode #nasr-chat-input,
body.dark-mode #nasr-chat-input {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

html.dark-mode #nasr-chat-send,
body.dark-mode #nasr-chat-send {
    background: var(--color-secondary, #06B6D4);
}

html.dark-mode #nasr-chat-send:hover,
body.dark-mode #nasr-chat-send:hover {
    background: white;
    color: #06B6D4 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #nasr-chat-widget {
        width: calc(100% - 30px);
        height: min(600px, calc(100% - 140px));
        right: 15px;
        bottom: 95px;
    }

    #nasr-chat-toggle {
        right: 20px;
        bottom: 20px;
        width: 60px;
        height: 60px;
    }
}