/* ========================================
   CoastalNomad - Chatbot Styles
   ======================================== */

/* Chatbot Button */
.chatbot-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
    border: none;
    animation: pulse-glow 2s ease-in-out infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6);
}

.chatbot-button i {
    font-size: 2rem;
    color: white;
}

.chatbot-button.active {
    background: linear-gradient(135deg, #FF6B6B 0%, #E74C3C 100%);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 8px 40px rgba(37, 211, 102, 0.8);
    }
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #FF6B6B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border: 3px solid white;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    height: 650px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 16px 64px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

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

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

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

.chatbot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}

.chatbot-status {
    display: flex;
    flex-direction: column;
}

.chatbot-name {
    font-weight: 700;
    font-size: 1.125rem;
}

.chatbot-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    opacity: 0.95;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.25rem;
    transition: 0.3s ease;
}

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

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

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

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

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

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.chat-message.bot .message-bubble {
    background: white;
    color: #2D3748;
    border-bottom-left-radius: 4px;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #0077CC 0%, #00A6A6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #A0AEC0;
    margin-top: 4px;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: white;
    border: 2px solid #E2E8F0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    color: #2D3748;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-reply-btn:hover {
    background: #0077CC;
    color: white;
    border-color: #0077CC;
    transform: translateX(4px);
}

.quick-reply-btn i {
    font-size: 1.125rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

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

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

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

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

/* Property Card in Chat */
.chat-property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 8px;
}

.chat-property-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

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

.chat-property-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 4px;
    color: #2D3748;
}

.chat-property-location {
    font-size: 0.8125rem;
    color: #718096;
    margin-bottom: 8px;
}

.chat-property-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0077CC;
}

.chat-property-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #0077CC 0%, #00A6A6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}

.chat-property-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 204, 0.3);
}

/* Calendar Widget */
.chat-calendar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-month {
    font-weight: 700;
    color: #2D3748;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #F7FAFC;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.calendar-nav-btn:hover {
    background: #EDF2F7;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s ease;
}

.calendar-day.header {
    font-weight: 600;
    color: #718096;
    cursor: default;
}

.calendar-day.disabled {
    color: #CBD5E0;
    cursor: not-allowed;
}

.calendar-day:not(.header):not(.disabled):hover {
    background: #EDF2F7;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #0077CC 0%, #00A6A6 100%);
    color: white;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.time-slot {
    padding: 10px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
}

.time-slot:hover {
    border-color: #0077CC;
    background: #F7FAFC;
}

.time-slot.selected {
    background: linear-gradient(135deg, #0077CC 0%, #00A6A6 100%);
    color: white;
    border-color: transparent;
}

/* Chatbot Input */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #E2E8F0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 24px;
    font-size: 0.9375rem;
    outline: none;
    transition: 0.3s ease;
    font-family: inherit;
}

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

.chatbot-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077CC 0%, #00A6A6 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s ease;
    color: white;
    font-size: 1.25rem;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
}

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

/* Admin Panel Toggle */
.admin-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transition: 0.3s ease;
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .chatbot-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .admin-toggle {
        bottom: 90px;
        left: 20px;
        font-size: 0.875rem;
        padding: 10px 20px;
    }
}