/**
 * Chatbot Styles
 * 
 * @author Shiva Sharan Shrestha (shivasharanshrestha.com.np)
 * @license MIT
 */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    font-family: 'Inter', sans-serif;
}

/* Chatbot Launcher Button */
.chatbot-launcher {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    color: white;
    font-size: 22px;
    position: relative;
    z-index: 999;
}

.chatbot-launcher:hover {
    transform: scale(1.08);
}

/* Mobile - Responsive sizing */
@media (max-width: 480px) {
    .chatbot-launcher {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-launcher {
        width: 52px;
        height: 52px;
        font-size: 21px;
        bottom: 15px;
        right: 15px;
    }
}

.chatbot-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Red notification dot on launcher */
.chatbot-launcher::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    top: -2px;
    right: -2px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
    }
}

.chatbot-launcher.open {
    display: none;
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: 95vw;
    height: 600px;
    max-height: 75vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    z-index: 1000;
}

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

/* Mobile Responsive - Small phones */
@media (max-width: 480px) {
    .chatbot-container {
        width: 100vw;
        max-width: 100vw;
        height: 70vh;
        max-height: 70vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 12px 12px 0 0;
    }
}

/* Tablet Responsive */
@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-container {
        width: 420px;
        max-width: 90vw;
        height: 550px;
        max-height: 70vh;
        bottom: 70px;
        right: 15px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .chatbot-container {
        width: 420px;
        max-width: 95vw;
        height: 620px;
        max-height: 80vh;
    }
}

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

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

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

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
}

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

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
     /* Mobile responsive messages padding */
     @media (max-width: 480px) {
         .chatbot-messages {
             padding: 15px;
             gap: 10px;
         }
     }

.chat-message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

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

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
    background: #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: #10b981;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.chat-option-btn {
    background: white;
    border: 1.5px solid #10b981;
    color: #10b981;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.chat-option-btn:hover {
    background: #f0fdf4;
    border-color: #059669;
}

.chat-option-btn:active {
    background: #10b981;
    color: white;
}

/* Contact Form */
.chat-contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.chat-contact-form input,
.chat-contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
}

.chat-contact-form input::placeholder,
.chat-contact-form textarea::placeholder {
    color: #9ca3af;
}

.chat-contact-form input:focus,
.chat-contact-form textarea:focus {
    outline: none;
    border-color: #10b981;
    background: #f0fdf4;
}

.chat-submit-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.chat-submit-btn:hover {
    background: #059669;
}

.chat-submit-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Property Card in Chat */
.chat-property-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-property-card:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.chat-property-img {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 32px;
}

.chat-property-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-property-info {
    padding: 10px;
}

.chat-property-title {
    font-weight: 600;
    font-size: 12px;
    color: #1f2937;
    margin: 0 0 4px 0;
    height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chat-property-price {
    color: #10b981;
    font-weight: 700;
    font-size: 13px;
    margin: 4px 0;
}

.chat-property-details {
    font-size: 11px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.chat-property-select {
    background: #f3f4f6;
    border: none;
    padding: 8px;
    border-radius: 6px;
    color: #10b981;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.chat-property-select:hover {
    background: #e0f2f1;
    border-color: #10b981;
}

/* Chatbot Input Area */
.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    background: white;
    min-height: 60px;
    flex-shrink: 0;
}

/* Text Input Field for Property ID */
.chat-text-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-text-input input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.chat-text-input input::placeholder {
    color: #9ca3af;
}

.chat-text-input input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chat-send-btn {
    padding: 12px 18px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.chat-send-btn:active {
    transform: translateY(0);
}

    /* Mobile responsive input styling */
    @media (max-width: 480px) {
        .chatbot-input-area {
            padding: 12px;
            min-height: 55px;
        }
    
        .chat-text-input {
            gap: 6px;
        }
    
        .chat-text-input input {
            padding: 10px 12px;
            font-size: 13px;
        }
    
        .chat-send-btn {
            padding: 10px 14px;
            font-size: 12px;
            min-width: 50px;
        }
    }

/* Loading indicator */
.chat-loading {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-loading span {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.chat-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 70vh;
        max-height: 600px;
    }
    
    .chat-bubble {
        max-width: 90%;
    }
}
