/* Chatbot Widget Styles */

/* Floating Chat Button */
.chatbot-trigger {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(192, 57, 43, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(192, 57, 43, 0.5);
}

.chatbot-trigger svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-trigger .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 150px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

.chatbot-window.open {
    display: flex;
}

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

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-text p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-clear {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    opacity: 0.8;
}

.chatbot-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-close svg {
    width: 20px;
    height: 20px;
}

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

.chatbot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message.user {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-message.assistant {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chatbot-message.assistant p {
    margin: 0 0 8px;
}

.chatbot-message.assistant p:last-child {
    margin-bottom: 0;
}

.chatbot-message.assistant ul,
.chatbot-message.assistant ol {
    margin: 8px 0;
    padding-left: 20px;
}

.chatbot-message.assistant li {
    margin: 4px 0;
}

.chatbot-message.assistant code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #c0392b;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

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

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

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

.chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    max-height: 100px;
    min-height: 44px;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #c0392b;
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
}

.chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: 8px 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-quick-action {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.chatbot-quick-action:hover {
    background: #e0e0e0;
    color: #333;
}

/* Welcome Message */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
}

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

.chatbot-welcome p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        /* Prevent body scroll when chatbot is open */
        overflow: hidden;
    }
    
    /* Ensure messages container is the only scrollable area */
    .chatbot-window .chatbot-messages {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Prevent scroll on other elements */
    .chatbot-window .chatbot-header,
    .chatbot-window .chatbot-mode-selector,
    .chatbot-window .chatbot-input-container,
    .chatbot-window .chatbot-disclaimer,
    .chatbot-window .chatbot-quick-actions {
        flex-shrink: 0;
        overflow: hidden;
    }
    
    .chatbot-trigger {
        bottom: 110px; /* Positioned above booking button with comfortable spacing */
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Error Message */
.chatbot-error {
    background: #fee;
    color: #c0392b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin: 8px 0;
}

/* Disclaimer */
.chatbot-disclaimer {
    font-size: 11px;
    color: #999;
    text-align: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}


/* Mode Selector */
.chatbot-mode-selector {
    display: flex;
    padding: 8px 12px;
    gap: 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.chatbot-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #666;
}

.chatbot-mode-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
}

.chatbot-mode-btn.active {
    border-color: #c0392b;
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    color: white;
}

.chatbot-mode-btn .mode-icon {
    font-size: 16px;
}

.chatbot-mode-btn .mode-name {
    font-weight: 500;
}

/* Adjust messages container height when mode selector is present */
.chatbot-messages {
    flex: 1;
    min-height: 0;
}
