/* Royal AI Assistant Widget CSS */
:root {
    --ai-navy: #0F1B2D;
    --ai-red: #E31E24;
    --ai-white: #FFFFFF;
    --ai-light-bg: #F5F6F8;
    --ai-border: #E5E7EB;
    --ai-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Floating Action Button */
.royal-chat-widget-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--ai-navy);
    color: var(--ai-white);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ai-shadow);
    z-index: 2147483647 !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.royal-chat-widget-btn:hover {
    transform: scale(1.1);
}

.royal-chat-widget-btn i {
    font-size: 24px;
}

.royal-chat-notification {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    /* Green for Online */
    border-radius: 50%;
    border: 2px solid var(--ai-white);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Chat Window */
.royal-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: var(--ai-white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483647 !important;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid var(--ai-border);
}

.royal-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.royal-chat-header {
    background: linear-gradient(135deg, var(--ai-navy) 0%, #1a2b42 100%);
    color: var(--ai-white);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--ai-red);
}

.royal-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.royal-chat-avatar {
    width: 38px;
    height: 38px;
    background: var(--ai-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid white;
}

.royal-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.royal-chat-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.royal-chat-info span {
    font-size: 0.75rem;
    opacity: 0.8;
}

.royal-chat-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.2rem;
}

.royal-chat-close:hover {
    color: white;
}

/* Body */
.royal-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: var(--ai-light-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Messages */
.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.chat-message.bot {
    background-color: var(--ai-white);
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-message.user {
    background-color: var(--ai-navy);
    color: var(--ai-white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-timestamp {
    font-size: 0.65rem;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

/* Input Area */
.royal-chat-footer {
    padding: 12px;
    background: var(--ai-white);
    border-top: 1px solid var(--ai-border);
    display: flex;
    gap: 8px;
}

.royal-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--ai-border);
    border-radius: 20px;
    background: var(--ai-light-bg);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.royal-chat-input:focus {
    border-color: var(--ai-navy);
    background: white;
}

.royal-chat-send {
    width: 40px;
    height: 40px;
    background: var(--ai-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.royal-chat-send:active {
    transform: scale(0.95);
}

/* Options / Suggested Actions */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chat-option-btn {
    background: white;
    border: 1px solid var(--ai-red);
    color: var(--ai-red);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background: var(--ai-red);
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 8px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .royal-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* Language Switcher */
.lang-dropdown-container {
    position: relative;
    display: inline-block;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(26, 43, 75, 0.2);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--rts-navy);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: #f8fafc;
    border-color: var(--rts-navy);
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: white;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 1001;
}

.lang-dropdown-container:hover .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-item:hover {
    background: #f1f5f9;
}

.lang-flag {
    font-size: 1.2rem;
}

.lang-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
}

/* RTL Support Overrides */
[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-cta-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .trust-strip {
    flex-direction: row-reverse;
}