/**
 * Nexzoneo Chatbot Widget Styles
 * Dark theme with accent colors matching the main site
 */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

.chatbot-toggle .chatbot-icon,
.chatbot-toggle .chatbot-close-icon {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-toggle .chatbot-close-icon {
    display: none;
}

.chatbot-toggle.active .chatbot-icon {
    display: none;
}

.chatbot-toggle.active .chatbot-close-icon {
    display: block;
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

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

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

.chatbot-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

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

.chatbot-minimize svg {
    width: 20px;
    height: 20px;
    color: white;
}

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

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chatbot-message p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
}

.bot-message p {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

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

.user-message p {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-link {
    color: #5eead4;
    text-decoration: underline;
    transition: color 0.2s;
}

.chat-link:hover {
    color: #2dd4bf;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

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

.quick-action-btn {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: left;
}

.quick-action-btn:hover {
    background: rgba(20, 184, 166, 0.2);
    border-color: #14b8a6;
    transform: translateX(4px);
}

/* Input Container */
.chatbot-input-container {
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #ffffff !important;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    transition: all 0.2s;
    -webkit-text-fill-color: #ffffff !important;
}

.chatbot-input:focus {
    outline: none;
    border-color: #14b8a6;
    background: rgba(30, 41, 59, 1);
    color: #ffffff !important;
}

.chatbot-input::placeholder {
    color: #94a3b8;
}

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

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

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

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-window {
        bottom: 90px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: none;
        height: 500px;
    }
    
    .chatbot-message p {
        max-width: 85%;
    }
}

/* ── Feedback buttons ───────────────────────────────────────────────────── */

.chatbot-feedback {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    justify-content: flex-start;
}

.feedback-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 3px 7px;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-btn:hover {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
}

.feedback-btn.active.feedback-up {
    background: rgba(34,197,94,0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.feedback-btn.active.feedback-down {
    background: rgba(239,68,68,0.15);
    border-color: #ef4444;
    color: #ef4444;
}
