/* M&D Dienstleistungen GmbH - Chatbot Styling */
/* Glasmorphismus-Design passend zur Website */

:root {
    --primary: #005c99;
    --secondary: #00a8a8;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.15);
}

/* === CHATBOT BUTTON === */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 9999;
    transition: all 0.3s ease;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

.chatbot-button.active {
    transform: rotate(180deg);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.chatbot-badge.hidden {
    display: none;
}

/* === PROAKTIVE BEGRÜSSUNG === */
.chatbot-greeting {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.4s ease;
}

.chatbot-greeting.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    animation: slideUp 0.4s ease;
}

.greeting-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.greeting-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.greeting-content p {
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.5;
}

.greeting-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.greeting-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 92, 153, 0.3);
}

/* === CHATBOT FENSTER === */
.chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9998;
}

.chatbot-window.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    animation: slideUp 0.3s ease;
}

/* === HEADER === */
.chatbot-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px 16px 0 0;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.chatbot-title h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: breathe 2s infinite;
}

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

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

/* === MESSAGES === */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 92, 153, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 92, 153, 0.5);
}

/* === MESSAGE BUBBLES === */
.message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    justify-content: flex-start;
}

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

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

.message.bot .message-content {
    background: rgba(0, 92, 153, 0.1);
    color: #333;
    border-bottom-left-radius: 4px;
}

.message.bot .message-content a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.message.bot .message-content a:hover {
    text-decoration: underline;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

/* === TYPING INDICATOR === */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(0, 92, 153, 0.5);
    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;
}

/* === QUICK REPLIES === */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    animation: fadeIn 0.4s ease;
}

.quick-reply-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 92, 153, 0.2);
}

/* === FOOTER / INPUT === */
.chatbot-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 16px 16px;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(0, 92, 153, 0.2);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.chatbot-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 92, 153, 0.1);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 92, 153, 0.3);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .chatbot-window {
        right: 20px;
        left: 20px;
        width: calc(100% - 40px);
        bottom: 100px;
    }
    
    .chatbot-button {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-greeting {
        right: 20px;
        left: 20px;
        width: calc(100% - 40px);
        bottom: 100px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    .message-content {
        max-width: 85%;
        font-size: 13px;
    }
}