/**
 * TechHilfe Hamburg - AI Chatbot Enhanced Styles
 */

/* Typing Indicator Animation */
.chat-typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    background: white;
    border-radius: 14px 14px 14px 4px;
    width: fit-content;
    margin: 6px 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: var(--primary, #0fb26b);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

/* Status Dot Pulse */
.status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translate(-50%, -50%);
    animation: statusPulse 2s infinite;
    opacity: 0.6;
}

@keyframes statusPulse {
    0% { width: 100%; height: 100%; opacity: 0.6; }
    100% { width: 300%; height: 300%; opacity: 0; }
}

/* Quick Replies Grid */
.chat-quick-replies-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.quick-btn {
    padding: 5px 12px;
    background: white;
    border: 1px solid rgba(15, 178, 107, 0.2);
    color: var(--primary, #0fb26b);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: var(--primary, #0fb26b);
    color: white;
    transform: translateY(-1px);
}

/* Bot Message Rich Text */
.chat-msg.bot p {
    margin-bottom: 6px;
    line-height: 1.5;
}

.chat-msg.bot p:last-child {
    margin-bottom: 0;
}

.chat-msg.bot strong {
    color: var(--primary, #0fb26b);
    font-weight: 700;
}

.chat-msg.bot ul {
    margin: 6px 0 10px 18px;
    list-style: disc;
}

.chat-msg.bot ol {
    margin: 6px 0 10px 18px;
}

.chat-msg.bot li {
    margin-bottom: 3px;
    font-size: 0.92rem;
}

.chat-msg.bot i {
    color: var(--primary, #0fb26b);
    margin-right: 3px;
    font-size: 0.9rem;
}

.chat-msg.bot code {
    background: rgba(15, 178, 107, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
    color: #1e293b;
}

.chat-msg.bot table {
    width: 100%;
    font-size: 0.82rem;
    margin: 8px 0;
    border-collapse: collapse;
}

.chat-msg.bot table td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget-btn {
        right: 14px !important;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 2100;
    }

    .chat-popup {
        right: 10px;
        left: 10px;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: none;
    }

    .back-to-top {
        right: 14px !important;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 480px) {
    .chat-popup {
        right: 8px;
        left: 8px;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: none;
        max-height: 70vh;
        border-radius: 14px;
    }

    .chat-body {
        height: 220px;
    }

    .chat-widget-btn {
        width: 52px;
        height: 52px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        z-index: 2100;
    }

    .back-to-top {
        right: 12px !important;
        bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    }
}