/* ========================================================
   CHATBOT DOMINIC - ESTILOS WINDOWS 11 COPILOT
   Dominican Tour & Transportation
   ======================================================== */

/* Variables CSS */
:root {
    --chat-primary: #0078D4;
    --chat-primary-light: #00BCF2;
    --chat-bg: #F3F3F3;
    --chat-surface: #FFFFFF;
    --chat-text: #1A1A1A;
    --chat-text-secondary: #616161;
    --chat-border: #E0E0E0;
    --chat-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --chat-radius: 12px;
    --chat-radius-lg: 16px;
}

/* ========== BOTÓN FLOTANTE ========== */
#chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light) 100%);
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chatbot-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0, 120, 212, 0.5);
}

.chatbot-trigger-icon {
    width: 36px;
    height: 36px;
}

.chatbot-trigger-icon svg {
    width: 100%;
    height: 100%;
}

.chatbot-trigger-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light) 100%);
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* ========== CONTENEDOR PRINCIPAL ========== */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--chat-surface);
    border-radius: var(--chat-radius-lg);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
    /* Efecto Mica/Acrílico de Windows 11 */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#chatbot-container.chatbot-hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

/* ========== HEADER ========== */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light) 100%);
    color: white;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px;
}

.chatbot-avatar svg {
    width: 100%;
    height: 100%;
}

.chatbot-header-info {
    display: flex;
    flex-direction: column;
}

.chatbot-name {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-header-actions {
    display: flex;
    gap: 4px;
}

.chatbot-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========== ÁREA DE MENSAJES ========== */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Scrollbar estilo Windows 11 */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========== MENSAJE DE BIENVENIDA ========== */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
}

.welcome-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(0, 120, 212, 0.3));
}

.chatbot-welcome h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--chat-text);
    margin-bottom: 8px;
}

.chatbot-welcome p {
    font-size: 14px;
    color: var(--chat-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.welcome-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.suggestion-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--chat-text);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.suggestion-chip:hover {
    background: var(--chat-primary);
    color: white;
    border-color: var(--chat-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25);
}

/* ========== MENSAJES ========== */
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.bot {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-avatar.bot-avatar {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-avatar.bot-avatar svg {
    width: 20px;
    height: 20px;
}

.message-avatar.user-avatar {
    background: #6366F1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.message-content {
    padding: 12px 16px;
    border-radius: var(--chat-radius);
    line-height: 1.5;
    font-size: 14px;
}

.chat-message.bot .message-content {
    background: var(--chat-surface);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ========== INDICADOR DE ESCRITURA ========== */
.chatbot-typing {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--chat-bg);
    font-size: 13px;
    color: var(--chat-text-secondary);
}

.chatbot-typing.active {
    display: flex;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chat-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== INPUT CONTAINER ========== */
.chatbot-input-container {
    padding: 16px 20px;
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
}

.chatbot-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--chat-bg);
    border-radius: var(--chat-radius);
    padding: 8px 12px;
    border: 1px solid var(--chat-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input-wrapper:focus-within {
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

#chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--chat-text);
    resize: none;
    outline: none;
    max-height: 100px;
    line-height: 1.5;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

#chatbot-input::placeholder {
    color: var(--chat-text-secondary);
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-light) 100%);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.35);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-footer {
    text-align: center;
    font-size: 11px;
    color: var(--chat-text-secondary);
    margin-top: 10px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    #chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 90px;
        border-radius: var(--chat-radius);
    }
    
    #chatbot-trigger {
        width: 56px;
        height: 56px;
        right: 16px;
        bottom: 16px;
    }
    
    .suggestion-chip {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ========== ANIMACIONES DE ENTRADA ========== */
.chatbot-show {
    animation: chatbotShow 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes chatbotShow {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========== DARK MODE (opcional) ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --chat-bg: #202020;
        --chat-surface: #2D2D2D;
        --chat-text: #FFFFFF;
        --chat-text-secondary: #A0A0A0;
        --chat-border: #404040;
    }
    
    .chat-message.bot .message-content {
        background: #383838;
    }
}




/* ========== SWITCH DE IDIOMA DEL CHATBOT ========== */
.chatbot-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    margin-right: 6px;
}

.chatbot-lang-btn {
    border: none;
    background: transparent;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.chatbot-lang-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.chatbot-lang-btn.active {
    background: rgba(255, 255, 255, 0.28);
}

.chatbot-hidden-force {
    display: none !important;
}

@media (max-width: 480px) {
    .chatbot-lang-switch {
        margin-right: 4px;
    }

    .chatbot-lang-btn {
        padding: 5px 7px;
    }
}
