/* ============================================
   CHATBOT STYLES - No API Key Required
   Modern, Beautiful AI Chat Interface
   ============================================ */

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    backdrop-filter: blur(20px);
}

.chatbot-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerShimmer 8s linear infinite;
}

@keyframes headerShimmer {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    z-index: 1;
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {

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

    50% {
        transform: scale(1.05);
    }
}

.chatbot-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.chatbot-name {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.chatbot-status {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: statusPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px #4ade80;
}

@keyframes statusPulse {

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

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

.chatbot-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Message Styles */
.chat-message {
    display: flex;
    gap: 12px;
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chat-message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.chat-message.user .message-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.message-content {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.chat-message.bot .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 6px;
    display: block;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typingBounce {

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

    30% {
        transform: translateY(-8px);
    }
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply-btn {
    padding: 8px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input::placeholder {
    color: var(--text-muted);
}

.chatbot-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.chatbot-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.chatbot-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

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

/* Floating Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 9998;
    box-shadow:
        0 8px 30px rgba(var(--primary-rgb), 0.4),
        0 0 0 0 rgba(var(--primary-rgb), 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floatButton 3s ease-in-out infinite;
}

@keyframes floatButton {

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

    50% {
        transform: translateY(-5px);
    }
}

.chatbot-toggle:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow:
        0 12px 40px rgba(var(--primary-rgb), 0.5),
        0 0 0 8px rgba(var(--primary-rgb), 0.1);
}

.chatbot-toggle.active {
    transform: rotate(180deg);
}

.chatbot-toggle .toggle-icon {
    transition: all 0.4s ease;
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes badgePop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Welcome Message Card */
.welcome-card {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 10px;
}

.welcome-card h4 {
    color: var(--primary);
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.welcome-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Suggestions Grid */
.suggestions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.suggestion-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.suggestion-item:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.suggestion-item span.icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.suggestion-item span.text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark/Light Theme Adjustments */
[data-theme="light"] .chatbot-container {
    background: var(--bg-primary);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chatbot-header {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

[data-theme="light"] .chatbot-name,
[data-theme="light"] .chatbot-status {
    color: white;
}

[data-theme="light"] .chat-messages {
    background: var(--bg-secondary);
}

[data-theme="light"] .chat-message.user .message-content {
    background: var(--primary-500);
    color: white;
}

[data-theme="light"] .chat-message.bot .message-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .chat-input-wrapper {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
}

[data-theme="light"] .chat-input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="light"] .chat-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .chat-input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .send-button {
    background: var(--gradient-primary);
}

[data-theme="light"] .typing-indicator span {
    background: var(--text-muted);
}

[data-theme="light"] .currency-selector {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

[data-theme="light"] .currency-selector:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .currency-selector:focus {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .currency-selector option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .currency-notice span:last-child {
    color: var(--text-muted);
}

[data-theme="light"] .welcome-card {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="light"] .welcome-card h3 {
    color: var(--text-primary);
}

[data-theme="light"] .welcome-card p {
    color: var(--text-muted);
}

[data-theme="light"] .suggestion-chip {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .suggestion-chip:hover {
    background: var(--primary-100);
    border-color: var(--primary-400);
    color: var(--primary-700);
}

/* Currency Selector Styles */
.currency-selector-wrapper {
    position: relative;
    z-index: 1;
    margin-right: 8px;
}

.currency-selector {
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 32px 8px 12px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 110px;
}

.currency-selector:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.currency-selector:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.currency-selector option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}

.currency-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.9rem;
}

/* Currency Notice in Welcome Card */
.currency-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.2);
}

.currency-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.currency-notice span:last-child {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile adjustments for currency selector */
@media (max-width: 480px) {
    .currency-selector {
        min-width: 90px;
        padding: 6px 28px 6px 10px;
        font-size: 0.8rem;
    }

    .chatbot-header {
        padding: 16px;
        gap: 10px;
    }

    .chatbot-name {
        font-size: 1rem;
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}