/* Ibiza Buggy Chatbot Native Styles */

#ibiza-chatbot-native-root {
    --primary: #ffc20a;
    --secondary: #111827;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a8b4;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --white: #ffffff;
    --emerald-500: #10b981;
    
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
}

#ibiza-chatbot-native-root * {
    box-sizing: border-box;
}

/* Floating Toggle Button */
.chatbot-toggle-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 194, 10, 0.4);
}

.chatbot-toggle-btn .online-indicator {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 12px;
    height: 12px;
    background-color: var(--emerald-500);
    border: 2px solid var(--white);
    border-radius: 50%;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--white);
    border-radius: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

.chatbot-window.hidden {
    display: none;
}

/* Header */
.chatbot-header {
    background-color: var(--primary);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--secondary);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.online-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--emerald-500);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.header-actions {
    display: flex;
    gap: 4px;
}

.header-actions button {
    background: transparent;
    border: none;
    color: var(--secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.header-actions button:hover {
    background: rgba(255,255,255,0.2);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background: var(--slate-50);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

/* Chat Bubbles */
.msg-container {
    display: flex;
    width: 100%;
}

.msg-container.bot { justify-content: flex-start; }
.msg-container.user { justify-content: flex-end; }

.msg-bubble {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.bot .msg-bubble {
    background: var(--white);
    color: var(--slate-800);
    border: 1px solid var(--slate-100);
    border-top-left-radius: 0;
}

.user .msg-bubble {
    background: var(--primary);
    color: var(--secondary);
    font-weight: 500;
    border-top-right-radius: 0;
}

/* CTA Links in Bubbles */
.msg-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--secondary);
    color: var(--white) !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: transform 0.2s, background 0.2s;
}

.msg-cta:hover {
    background: var(--slate-800);
    transform: translateY(-1px);
}

/* Buttons/Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: 1.25rem;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.option-btn:hover {
    transform: translateX(4px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.option-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background: var(--slate-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-600);
}

.option-btn:hover .option-icon {
    background: #fff9e6;
    color: var(--primary);
}

.option-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-800);
}

.option-desc {
    display: block;
    font-size: 11px;
    color: var(--slate-400);
}

/* Language Selection */
.lang-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lang-btn {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: 1.25rem;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.lang-flag { font-size: 24px; }
.lang-label { font-size: 14px; font-weight: 700; color: var(--slate-800); }

/* Footer & Input */
.chatbot-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--slate-100);
    background: var(--white);
}

.input-container {
    display: flex;
    gap: 8px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    padding: 4px 4px 4px 12px;
    transition: border-color 0.2s;
}

.input-container:focus-within {
    border-color: var(--primary);
}

.input-container input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 8px 0;
    outline: none !important;
}

#chatbot-send-btn {
    background: var(--secondary);
    color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.footer-branding {
    margin-top: 12px;
    font-size: 10px;
    color: var(--slate-400);
    text-align: center;
}

.footer-branding strong { color: var(--slate-600); }

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-slide-in {
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hidden { display: none !important; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: 1.25rem;
    width: fit-content;
    margin-bottom: 16px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--slate-400);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-4px); opacity: 1; }
}
