/**
 * Immobilien Chatbot Styles
 * Modernes, responsives Design für den Chatbot
 */

/* Container */
#immo-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Button */
.immo-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--immo-primary-color, #2c3e50);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.immo-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.immo-chatbot-button svg {
    width: 28px;
    height: 28px;
}

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

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

/* Chat Window */
.immo-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.immo-chatbot-window.active {
    display: flex;
}

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

/* Header */
.immo-chatbot-header {
    background: var(--immo-primary-color, #2c3e50);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.immo-chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.immo-chatbot-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.immo-chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.immo-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Messages Container */
.immo-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

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

.immo-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.immo-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* Message Bubbles */
.immo-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

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

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

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

.immo-chatbot-message.bot .immo-chatbot-message-content {
    background: var(--immo-secondary-color, #3498db);
    color: white;
    border-bottom-left-radius: 4px;
}

.immo-chatbot-message.user .immo-chatbot-message-content {
    background: #e9ecef;
    color: #2c3e50;
    border-bottom-right-radius: 4px;
}

.immo-chatbot-message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.immo-chatbot-message-content a:hover {
    opacity: 0.8;
}

/* Typing Indicator */
.immo-chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--immo-secondary-color, #3498db);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
}

.immo-chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Quick Replies */
.immo-chatbot-quick-replies {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.immo-chatbot-quick-replies::-webkit-scrollbar {
    height: 4px;
}

.immo-chatbot-quick-reply {
    padding: 8px 14px;
    background: white;
    border: 2px solid var(--immo-secondary-color, #3498db);
    color: var(--immo-secondary-color, #3498db);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 500;
}

.immo-chatbot-quick-reply:hover {
    background: var(--immo-secondary-color, #3498db);
    color: white;
    transform: translateY(-2px);
}

/* Input Area */
.immo-chatbot-input-area {
    display: flex;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.immo-chatbot-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.immo-chatbot-input:focus {
    border-color: var(--immo-secondary-color, #3498db);
}

.immo-chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--immo-secondary-color, #3498db);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.immo-chatbot-send:hover {
    background: var(--immo-primary-color, #2c3e50);
    transform: scale(1.05);
}

.immo-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.immo-chatbot-footer {
    padding: 8px 20px;
    background: #f8f9fa;
    text-align: center;
    font-size: 11px;
    color: #868e96;
    border-top: 1px solid #e9ecef;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #immo-chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .immo-chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .immo-chatbot-message-content {
        max-width: 85%;
    }
    
    .immo-chatbot-button {
        width: 56px;
        height: 56px;
    }
}

/* Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .immo-chatbot-window {
        width: 340px;
        height: 550px;
    }
}

/* Print verstecken */
@media print {
    #immo-chatbot-container {
        display: none !important;
    }
}
