/* Vila Falo Chatbot Widget Styles */
.vila-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 10000;
    max-width: 380px;
    width: 380px;
    pointer-events: none; /* Allow clicks to pass through the container */
}

/* Re-enable pointer events for interactive elements */
.vila-chatbot .chatbot-toggle,
.vila-chatbot .chatbot-window {
    pointer-events: auto;
}

@media (max-width: 768px) {
    .vila-chatbot {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: none;
        width: auto;
        padding: 15px;
    }
    
    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .vila-chatbot {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: none;
        width: auto;
        padding: 10px;
    }
    
    .chatbot-toggle {
        bottom: 10px;
        right: 10px;
    }
}

/* Chat Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a6d4e 0%, #3a8e6a 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(42, 109, 78, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Ensure it stays in bottom right */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(42, 109, 78, 0.4);
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.chatbot-toggle:hover::before {
    left: 100%;
}

.chatbot-toggle-icon {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

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

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ef476f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Chat Window */
.chatbot-window {
    width: 100%;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(42, 109, 78, 0.1);
}

@media (max-width: 768px) {
    .chatbot-window {
        height: 70vh;
        max-height: 500px;
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        height: 65vh;
        max-height: 450px;
        border-radius: 12px;
    }
}

.chatbot-window.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #2a6d4e 0%, #3a8e6a 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7z'%3E%3C/path%3E%3C/svg%3E");
    z-index: 0;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

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

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(42, 109, 78, 0.3);
    border-radius: 3px;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chatbot-message.bot .chatbot-message-avatar {
    background: linear-gradient(135deg, #2a6d4e 0%, #3a8e6a 100%);
    color: white;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #e9ecef;
    color: #6c757d;
}

.chatbot-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #2a6d4e 0%, #3a8e6a 100%);
    color: white;
}

.chatbot-message-text {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.chatbot-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

/* Availability Display */
.availability-info {
    background: rgba(42, 109, 78, 0.05);
    border: 1px solid rgba(42, 109, 78, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
}

.availability-header {
    font-weight: 600;
    color: #2a6d4e;
    margin-bottom: 8px;
    font-size: 13px;
}

.availability-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(42, 109, 78, 0.1);
}

.availability-item:last-child {
    border-bottom: none;
}

.availability-room {
    font-size: 12px;
    font-weight: 500;
}

.availability-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.availability-status.available {
    background: #d1edff;
    color: #0969da;
}

.availability-status.unavailable {
    background: #ffccd5;
    color: #e63946;
}

/* Quick Questions */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-question {
    background: rgba(42, 109, 78, 0.1);
    border: 1px solid rgba(42, 109, 78, 0.2);
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2a6d4e;
}

.quick-question:hover {
    background: #2a6d4e;
    color: white;
    transform: translateY(-2px);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2a6d4e;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Chat Input */
.chatbot-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    max-height: 80px;
    min-height: 40px;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #2a6d4e;
    box-shadow: 0 0 0 3px rgba(42, 109, 78, 0.1);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a6d4e 0%, #3a8e6a 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(42, 109, 78, 0.3);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Loading States */
.chatbot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

.chatbot-error {
    background: #ffe6e6;
    color: #d63384;
    padding: 12px;
    border-radius: 12px;
    margin: 10px 0;
    font-size: 13px;
    text-align: center;
}

/* Welcome Message */
.chatbot-welcome {
    background: rgba(42, 109, 78, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    margin-bottom: 10px;
}

.chatbot-welcome h4 {
    margin: 0 0 8px 0;
    color: #2a6d4e;
    font-size: 16px;
}

.chatbot-welcome p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

/* Accessibility */
.chatbot-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .chatbot-header {
        padding: 15px;
    }
    
    .chatbot-messages {
        padding: 15px;
        gap: 12px;
    }
    
    .chatbot-input-container {
        padding: 15px;
    }
    
    .chatbot-message-content {
        max-width: 85%;
        padding: 10px 14px;
    }
    
    .quick-question {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .chatbot-title {
        font-size: 14px;
    }
    
    .chatbot-subtitle {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .chatbot-header {
        padding: 12px;
    }
    
    .chatbot-messages {
        padding: 12px;
        gap: 10px;
    }
    
    .chatbot-input-container {
        padding: 12px;
    }
    
    .chatbot-message-content {
        max-width: 90%;
        padding: 8px 12px;
    }
    
    .quick-question {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .chatbot-input {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .chatbot-send {
        width: 36px;
        height: 36px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-toggle-icon {
        font-size: 20px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chatbot-toggle {
        border: 2px solid white;
    }
    
    .chatbot-window {
        border: 2px solid #000;
    }
    
    .chatbot-message-content {
        border: 1px solid #ccc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .chatbot-toggle,
    .chatbot-message,
    .quick-question,
    .chatbot-send {
        transition: none;
        animation: none;
    }
    
    .chatbot-window.active {
        animation: none;
    }
}
