/* MikroAirOS Web Chat Widget */

/* Chat Toggle Button */
.mikroairos-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mikroairos-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.mikroairos-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.mikroairos-chat-toggle.active .chat-icon {
    display: none;
}

.mikroairos-chat-toggle:not(.active) .close-icon {
    display: none;
}

/* Chat Container */
.mikroairos-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    z-index: 99998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mikroairos-chat-container.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

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

/* Chat Header */
.mikroairos-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mikroairos-chat-header .avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.mikroairos-chat-header .info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.mikroairos-chat-header .info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

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

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

.mikroairos-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Message Bubbles */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    align-self: flex-start;
    background: #f0f2f5;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

.chat-message.error {
    background: #fee2e2;
    color: #dc2626;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.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% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* Input Area */
.mikroairos-chat-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.mikroairos-chat-input textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 12px 18px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    min-height: 44px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.mikroairos-chat-input textarea:focus {
    outline: none;
    border-color: #667eea;
}

.mikroairos-chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mikroairos-chat-input button:hover:not(:disabled) {
    transform: scale(1.05);
}

.mikroairos-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mikroairos-chat-input button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Phone Input for Guests */
.phone-prompt {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
}

.phone-prompt p {
    margin: 0 0 12px;
    color: #666;
    font-size: 13px;
}

.phone-prompt input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 10px;
}

.phone-prompt button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.phone-prompt .skip-link {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .mikroairos-chat-container {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .mikroairos-chat-toggle {
        bottom: 15px;
        right: 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mikroairos-chat-container {
        background: rgba(30, 30, 40, 0.95);
    }

    .chat-message.bot {
        background: #2a2a3a;
        color: #e0e0e0;
    }

    .mikroairos-chat-input {
        background: #1a1a2e;
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .mikroairos-chat-input textarea {
        background: #2a2a3a;
        border-color: #3a3a4a;
        color: #e0e0e0;
    }

    .phone-prompt {
        background: #2a2a3a;
    }

    .phone-prompt p {
        color: #aaa;
    }

    .phone-prompt input {
        background: #1a1a2e;
        border-color: #3a3a4a;
        color: #e0e0e0;
    }
}