/* Chatbot Styles - Ultra Modern Glassmorphism */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --chat-red: #e30b0e;
    --chat-red-gradient: linear-gradient(135deg, #e30b0e, #9a0709);
    --chat-glass-bg: rgba(20, 20, 20, 0.75);
    --chat-glass-border: rgba(227, 11, 14, 0.3);
}

/* Toggle Button (The Glowing Icon) */
.chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 30px;
    height: 65px;
    width: 65px;
    background: var(--chat-red-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(227, 11, 14, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10001;
    border: 2px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.chatbot-toggler.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.chatbot-toggler:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(227, 11, 14, 0.6);
}

.chatbot-toggler i {
    font-size: 1.8rem;
}

/* Main Chat Window */
.chatbot-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: rgba(20, 20, 20, 0.95);
    background-color: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--chat-glass-border);
    border-radius: 24px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(40px) scale(0.92);
    transform-origin: bottom right;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 10002;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(227, 11, 14, 0.05);
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
}

.show-chatbot .chatbot-container {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header Area */
.chatbot-header {
    background: #e30b0e;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative !important;
    /* Force relative to preventing overlapping */
    top: auto;
    left: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bot-info>i {
    font-size: 1.8rem;
    color: #fff;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
}

.status-indicator {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    background-color: #00ff88;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #00ff88;
    animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

.voice-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.voice-btn,
.close-btn {
    cursor: pointer;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.voice-btn:hover,
.close-btn:hover {
    color: var(--chat-red);
    transform: scale(1.15);
}

/* Chat Messages Area */
.chatbox {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    /* Poriadna medzera aby nápis nezavadzal */
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-red) transparent;
}

.chatbox::-webkit-scrollbar {
    width: 6px;
}

.chatbox::-webkit-scrollbar-thumb {
    background: rgba(227, 11, 14, 0.3);
    border-radius: 10px;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    list-style: none;
    max-width: 85%;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.incoming {
    align-self: flex-start;
}

.chat-message.outgoing {
    align-self: flex-end;
}

.chat-message span {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    font-weight: 400;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Incoming (MarsoBot) - Clean Glass */
.chat-message.incoming span {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.chat-message.incoming i {
    color: var(--chat-red);
    margin-right: 8px;
    font-size: 0.9rem;
    filter: drop-shadow(0 0 5px rgba(227, 11, 14, 0.5));
}

/* Outgoing (User) - Red Glass */
.chat-message.outgoing span {
    background: var(--chat-red-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 20px rgba(227, 11, 14, 0.3);
}

/* Input Area - Integrated Glass */
.chat-input {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-top: 1px solid var(--chat-glass-border);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-input textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 15px;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    height: 48px;
    font-family: inherit;
    transition: all 0.3s;
}

.chat-input textarea:focus {
    border-color: var(--chat-red);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input .voice-btn {
    color: rgba(255, 255, 255, 0.6);
}

.chat-input .voice-btn:hover {
    color: var(--chat-red);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }

    .chatbot-toggler {
        bottom: 25px;
        right: 25px;
    }
}