/* Tek AI Chatbot Styles */
:root {
    --chat-width: 350px;
    --chat-height: 500px;
    --chat-accent: var(--accent-color, #06b6d4);
    --chat-bg-dark: rgba(15, 23, 42, 0.85);
    /* Glass dark */
    --chat-bg-light: rgba(255, 255, 255, 0.95);
    /* Glass light */
    --chat-text-dark: #f8fafc;
    --chat-text-light: #1e293b;
}

/* Container */
.tek-chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button (FAB) */
.tek-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-accent), #3b82f6);
    color: white;
    border: none;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tek-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.6);
}

.tek-chat-toggle .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f172a;
    animation: bounce 2s infinite;
}

/* Chat Window */
.tek-chat-window {
    width: var(--chat-width);
    height: var(--chat-height);
    background: var(--chat-bg-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);

    /* Animation state: Hidden */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Header */
.tek-chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tek-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tek-chat-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
}

.tek-chat-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--chat-text-dark);
}

.tek-chat-info .status-text {
    font-size: 12px;
    color: #10b981;
    /* Green */
}

.tek-chat-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.2s;
}

.tek-chat-close:hover {
    color: white;
}

/* Body */
.tek-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.tek-chat-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-left-radius: 2px;
    animation: slideInLeft 0.3s ease;
}

.user-message .message-content {
    background: var(--chat-accent);
    color: white;
    border-bottom-right-radius: 2px;
    animation: slideInRight 0.3s ease;
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 5px;
}

/* Footer & Input */
.tek-chat-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.tek-chat-form {
    display: flex;
    gap: 10px;
    position: relative;
}

#tek-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

#tek-chat-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--chat-accent);
}

.tek-chat-send {
    background: transparent;
    border: none;
    color: var(--chat-accent);
    cursor: pointer;
    font-size: 20px;
    padding: 0 10px;
    transition: transform 0.2s;
}

.tek-chat-send:hover {
    transform: scale(1.1);
    color: white;
}

.tek-chat-disclaimer {
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 8px;
}

/* Light Mode Overrides */
[data-theme="light"] .tek-chat-window {
    background: var(--chat-bg-light);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tek-chat-info h3 {
    color: var(--chat-text-light);
}

[data-theme="light"] .bot-message .message-content {
    background: #f1f5f9;
    color: #334155;
}

[data-theme="light"] .tek-chat-close {
    color: #64748b;
}

[data-theme="light"] #tek-chat-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

/* Animations */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }

    60% {
        transform: translateY(-3px);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
/* Responsive - increased breakpoint to cover all mobile/tablet sizes */
@media (max-width: 768px) {
    .tek-chat-window {
        width: calc(100vw - 40px);
        bottom: 180px !important;
        /* Force move up */
        right: 20px;
    }

    .tek-chatbot-container {
        right: 20px !important;
        bottom: 140px !important;
        /* ~90px nav + 50px buffer */
    }
}