/* ==================== CHATBOT WIDGET STYLES ==================== */

/* Widget Button */
.chatbot-widget-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A8F6A 0%, #0d7a5a 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(10, 143, 106, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chatbot-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(10, 143, 106, 0.6);
}

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

.chatbot-widget-button svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-widget-button.active svg {
    transform: rotate(90deg);
}

/* Notification Badge */
.chatbot-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

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

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

/* Widget Container */
.chatbot-widget-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-widget-container.active {
    display: flex;
}

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

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

/* Widget Header */
.chatbot-widget-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(10, 143, 106, 0.1) 0%, rgba(10, 143, 106, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-widget-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-widget-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A8F6A 0%, #0d7a5a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(10, 143, 106, 0.3);
}

.chatbot-widget-avatar svg {
    width: 22px;
    height: 22px;
    color: white;
}

.chatbot-widget-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.chatbot-widget-info p {
    font-size: 12px;
    color: #0A8F6A;
    margin: 2px 0 0 0;
}

.chatbot-widget-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.chatbot-widget-close svg {
    width: 18px;
    height: 18px;
    color: #999;
}

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

.chatbot-header-action {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ef4444;
    /* Trash icon turns red on hover */
}

.chatbot-header-action svg {
    width: 16px;
    height: 16px;
}

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

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

.chatbot-widget-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.chatbot-widget-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chatbot-widget-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Message Bubbles */
.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%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.chatbot-message.assistant .chatbot-message-avatar {
    background: linear-gradient(135deg, #0A8F6A 0%, #0d7a5a 100%);
    color: white;
}

.chatbot-message.user .chatbot-message-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message.assistant .chatbot-message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
}

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

/* Typing Indicator */
.chatbot-typing-indicator {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: fit-content;
}

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

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Widget Input */
.chatbot-widget-input {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
}

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

.chatbot-widget-input textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    resize: none;
    max-height: 120px;
    transition: all 0.2s ease;
}

.chatbot-widget-input textarea:focus {
    outline: none;
    border-color: #0A8F6A;
    background: rgba(255, 255, 255, 0.08);
}

.chatbot-widget-input textarea::placeholder {
    color: #666;
}

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

.chatbot-send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(10, 143, 106, 0.4);
}

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

.chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-button svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* Welcome Screen */
.chatbot-welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    gap: 12px;
    background: rgba(10, 143, 106, 0.05);
    border: 1px solid rgba(10, 143, 106, 0.1);
    border-radius: 12px;
    margin-bottom: 16px;
}

.chatbot-welcome-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A8F6A 0%, #0d7a5a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(10, 143, 106, 0.3);
}

.chatbot-welcome-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}

.chatbot-welcome-screen h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.chatbot-welcome-screen p {
    font-size: 12px;
    color: #999;
    margin: 0;
    max-width: 320px;
    line-height: 1.5;
}

.chatbot-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    max-width: 340px;
    margin-top: 8px;
}

.chatbot-quick-action {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e5e5e5;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.chatbot-quick-action:hover {
    background: rgba(10, 143, 106, 0.1);
    border-color: #0A8F6A;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-widget-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 140px);
        right: 16px;
        bottom: 90px;
    }

    .chatbot-widget-button {
        bottom: 16px;
        right: 16px;
    }
}

/* Booking Button */
.chatbot-booking-button-container {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
}

.chatbot-booking-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0A8F6A 0%, #0d7a5a 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(10, 143, 106, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-booking-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 143, 106, 0.5);
    background: linear-gradient(135deg, #0d9f77 0%, #0e8a68 100%);
}

.chatbot-booking-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(10, 143, 106, 0.3);
}

.chatbot-booking-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.chatbot-booking-button span {
    white-space: nowrap;
}

/* Popup Tooltip */
.chatbot-popup-tooltip {
    position: fixed;
    bottom: 95px;
    right: 24px;
    background: linear-gradient(135deg, rgba(10, 143, 106, 0.98) 0%, rgba(13, 122, 90, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(10, 143, 106, 0.3);
    z-index: 9997;
    max-width: 280px;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-popup-tooltip.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: popup-pulse 4s ease-in-out infinite 0.3s;
}

@keyframes popup-pulse {

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

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

.chatbot-popup-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(10, 143, 106, 0.98);
}

.chatbot-popup-content {
    position: relative;
    padding: 14px 40px 14px 16px;
}

.chatbot-popup-content p {
    margin: 0;
    color: white;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.chatbot-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.chatbot-popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.chatbot-popup-close svg {
    width: 14px;
    height: 14px;
    color: white;
}

/* Responsive adjustments for popup */
@media (max-width: 480px) {
    .chatbot-popup-tooltip {
        right: 16px;
        bottom: 85px;
        max-width: calc(100vw - 100px);
    }

    .chatbot-popup-tooltip::before {
        right: 16px;
    }
}