/* ===== NikaVet AI Chatbot Widget ===== */

/* Toggle Button */
#nikavet-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.nv-chat-toggle-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    box-shadow: 0 6px 24px rgba(76, 175, 80, 0.4), 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.nv-chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.5), 0 4px 12px rgba(0,0,0,0.15);
}

.nv-chat-toggle-btn:active {
    transform: scale(0.95);
}

.nv-chat-icon {
    font-size: 28px;
    transition: all 0.3s ease;
}

.nv-chat-close-icon {
    font-size: 22px;
    color: white;
    font-weight: 700;
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
    transition: all 0.3s ease;
}

#nikavet-chat-toggle.nv-open .nv-chat-icon {
    opacity: 0;
    transform: rotate(90deg);
}

#nikavet-chat-toggle.nv-open .nv-chat-close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Pulse animation */
.nv-chat-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(76, 175, 80, 0.6);
    animation: nvPulse 2s ease-out infinite;
}

#nikavet-chat-toggle.nv-open .nv-chat-pulse {
    display: none;
}

@keyframes nvPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Tooltip */
.nv-chat-tooltip {
    position: absolute;
    right: 76px;
    bottom: 14px;
    background: white;
    color: #2C3E50;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
}

.nv-chat-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: white;
}

.nv-chat-tooltip.nv-show {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Window */
.nv-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-height: 600px;
    background: white !important;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Inter', sans-serif;
}

.nv-chat-window.nv-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.nv-chat-header {
    background: linear-gradient(135deg, #4CAF50, #43A047);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

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

.nv-chat-title {
    font-weight: 700;
    font-size: 15px;
}

.nv-chat-subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.nv-chat-header-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nv-chat-header-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Messages Area */
.nv-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 300px;
    max-height: 420px;
    scroll-behavior: smooth;
}

.nv-chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.nv-chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Welcome Screen */
.nv-chat-welcome {
    text-align: center;
    padding: 20px 0;
}

.nv-chat-welcome h4 {
    font-size: 20px;
    color: #2C3E50;
    margin-bottom: 8px;
}

.nv-chat-welcome p {
    color: #7F8C8D;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.nv-chat-phones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.nv-chat-phone-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #E8F5E9;
    color: #2E7D32 !important;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: all 0.2s;
}

.nv-chat-phone-link:hover {
    background: #C8E6C9;
    color: #1B5E20 !important;
    transform: translateY(-1px);
}

.nv-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.nv-quick-btn {
    background: #F8F9FA;
    border: 1px solid #E8E8E8;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #2C3E50;
    cursor: pointer;
    transition: all 0.2s;
}

.nv-quick-btn:hover {
    background: #E8F5E9;
    border-color: #4CAF50;
    color: #2E7D32;
}

/* Chat Messages */
.nv-chat-message {
    margin-bottom: 16px;
    animation: nvMessageIn 0.3s ease;
}

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

.nv-message-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.nv-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8F5E9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

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

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

.nv-user .nv-message-content {
    background: linear-gradient(135deg, #4CAF50, #43A047);
    color: white;
    border-bottom-right-radius: 4px;
}

.nv-assistant .nv-message-content {
    background: #F1F3F4;
    color: #2C3E50;
    border-bottom-left-radius: 4px;
}

/* Inline phone links in messages */
.nv-inline-phone {
    color: #2E7D32 !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
}

.nv-assistant .nv-inline-phone {
    color: #2E7D32 !important;
}

.nv-user .nv-inline-phone {
    color: #C8E6C9 !important;
}

/* Typing indicator */
.nv-typing-dots {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

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

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

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

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

/* Input Area */
.nv-chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid #EEEEEE;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #FAFAFA;
    flex-shrink: 0;
}

.nv-chat-input {
    flex: 1;
    border: 2px solid #E8E8E8;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}

.nv-chat-input:focus {
    border-color: #4CAF50;
}

.nv-chat-input::placeholder {
    color: #BDC3C7;
}

.nv-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #43A047);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nv-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.nv-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .nv-chat-window {
        width: calc(100% - 16px);
        right: 8px;
        bottom: 80px;
        max-height: calc(100vh - 120px);
        border-radius: 16px;
    }

    #nikavet-chat-toggle {
        bottom: 16px;
        right: 16px;
    }

    .nv-chat-toggle-btn {
        width: 56px;
        height: 56px;
    }

    .nv-chat-icon {
        font-size: 24px;
    }

    .nv-chat-tooltip {
        display: none;
    }

    .nv-chat-messages {
        min-height: 250px;
        max-height: calc(100vh - 280px);
    }
}

@media (max-width: 360px) {
    .nv-quick-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}
