#ai-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: Arial, sans-serif;
    z-index: 9999;
}

/* Bublina */
#ai-button {
    width: 60px;
    height: 60px;
    background: #c41329;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: 0.2s;
}

#ai-button:hover {
    transform: scale(1.1);
}

.ai-button-bubble {
    position: relative;
    width: 28px;
    height: 22px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    pointer-events: none;
}

.ai-button-bubble::after {
    content: "";
    position: absolute;
    left: 4px;
    bottom: -4px;
    width: 10px;
    height: 10px;
    background: white;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ai-button-dot {
    width: 4px;
    height: 4px;
    background: #c41329;
    border-radius: 50%;
}

/* Okno */
#ai-window {
    width: 420px;
    height: 620px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

/* Hlavička */
#ai-header {
    background: #c41329;
    color: white;
    padding: 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

/* Tělo */
#ai-body {
    padding: 12px;
    height: 100%;
    overflow-y: auto;
}

/* === Messenger / WhatsApp styl bublin === */

.ai-message {
    padding: 10px 14px;
    border-radius: 18px;
    margin-bottom: 10px;
    max-width: 98%;
    font-size: 15px;
    line-height: 1.4;
    display: inline-block;
}

/* AI bublina */
.ai-bot {
    background: #f1f0f0;
    color: #111;
    border-bottom-left-radius: 4px;
}
.ai-bot a {
    color: #71bf44;
    text-decoration: none;
}
.ai-bot a:hover {
    color: #c41329;
}

/* Uživatelská bublina */
.ai-user {
    background: #c41329;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

/* === Loading bublina (tři tečky) === */

.ai-loading {
    width: 46px;
    height: 26px;
    background: #f1f0f0;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
}

.ai-loading span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: aiBlink 1.4s infinite both;
}

.ai-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes aiBlink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* Quick volby */
#ai-quick {
    margin: 10px 0;
}

.ai-chip {
    background: #f1f1f1;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    margin: 4px;
    cursor: pointer;
}

/* Input */
#ai-input-area {
    display: flex;
    border-top: 1px solid #ddd;
}

#ai-input {
    flex: 1;
    padding: 10px;
    border: none;
}

#ai-send {
    width: 50px;
    background: #c41329;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#ai-send:disabled {
    background: #a8a8a8;
    color: #f2f2f2;
    cursor: not-allowed;
}

#ai-send[aria-busy="true"] {
    background: #a8a8a8;
    color: #f2f2f2;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    #ai-widget {
        right: 8px;
        bottom: 8px;
    }

    #ai-window {
        width: calc(100vw - 16px);
        max-width: 420px;
        height: 72vh;
        max-height: 560px;
    }
}
