/* 
 * KickBot - CSS Styl pro AI Chatbot Widget (Kickboxuj.cz)
 * Design systém: #13B5EA (tyrkys/cyan), #1F2022 / #2B2D42 (tmavě šedá/antracit)
 */

/* Plovoucí spouštěcí tlačítko (Floating Action Button) - Hladký anti-aliased vzhled */
.kickbot-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #13B5EA 0%, #0994BF 100%);
    box-shadow: 0 6px 20px rgba(19, 181, 234, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
    outline: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.kickbot-fab:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 10px 25px rgba(19, 181, 234, 0.55);
}

.kickbot-fab img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Badge s upozorněním */
.kickbot-fab-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: #2ECC71;
    border: 2px solid #1F2022;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* Hlavní okno okna asistenta */
.kickbot-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    max-width: calc(100vw - 30px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background-color: #1F2022;
    border: 1px solid rgba(19, 181, 234, 0.3);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(19, 181, 234, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', 'Open Sans', system-ui, -apple-system, sans-serif;
}

.kickbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Skrytí plovoucího tlačítka FAB, když je okno chatu otevřené (aby nepřekrývalo tlačítko odeslat) */
.kickbot-window.active ~ .kickbot-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Hlavička okna s přehledným tlačítkem zavřít */
.kickbot-header {
    background: linear-gradient(135deg, #2B2D42 0%, #1F2022 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.kickbot-header-avatar {
    position: relative;
    width: 44px;
    height: 44px;
}

.kickbot-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #13B5EA;
    object-fit: cover;
}

.kickbot-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background-color: #2ECC71;
    border: 2px solid #1F2022;
    border-radius: 50%;
}

.kickbot-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kickbot-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #13B5EA;
    font-weight: 500;
}

/* Tlačítko zavřít okno (Křížek & Icon) s velkým dotykovým prostorem */
.kickbot-close-btn {
    background: none;
    border: none;
    color: #A0AEC0;
    font-size: 28px;
    cursor: pointer;
    padding: 6px 12px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    border-radius: 8px;
}

.kickbot-close-btn:hover,
.kickbot-close-btn:active {
    color: #13B5EA;
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.1);
}

/* Tělo konverzace */
.kickbot-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #17181A;
    scrollbar-width: thin;
    scrollbar-color: #2B2D42 #17181A;
}

/* Zprávy */
.kickbot-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: fadeInMsg 0.3s ease forwards;
}

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

.kickbot-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.kickbot-msg.bot {
    align-self: flex-start;
}

.kickbot-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.kickbot-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.kickbot-msg.user .kickbot-msg-bubble {
    background: linear-gradient(135deg, #13B5EA 0%, #0994BF 100%);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(19, 181, 234, 0.25);
}

.kickbot-msg.bot .kickbot-msg-bubble {
    background-color: #2B2D42;
    color: #E2E8F0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.kickbot-msg.bot .kickbot-msg-bubble a {
    color: #13B5EA;
    text-decoration: underline;
    font-weight: 600;
}

.kickbot-msg.bot .kickbot-msg-bubble ul, 
.kickbot-msg.bot .kickbot-msg-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.kickbot-msg.bot .kickbot-msg-bubble li {
    margin-bottom: 4px;
}

/* Rychlé návrhy dotazů (Chips) */
.kickbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kickbot-chip {
    background-color: rgba(19, 181, 234, 0.12);
    border: 1px solid rgba(19, 181, 234, 0.3);
    color: #13B5EA;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.kickbot-chip:hover {
    background-color: #13B5EA;
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* Animace psaní "KickBot píše..." */
.kickbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background-color: #2B2D42;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.kickbot-typing span {
    width: 7px;
    height: 7px;
    background-color: #13B5EA;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.kickbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.kickbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Vstupní formulář */
.kickbot-footer {
    padding: 12px 16px;
    background-color: #1F2022;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.kickbot-input {
    flex: 1;
    background-color: #2B2D42;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 10px 16px;
    color: #FFFFFF;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.kickbot-input:focus {
    border-color: #13B5EA;
}

.kickbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #13B5EA 0%, #0994BF 100%);
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.kickbot-send-btn:hover {
    transform: scale(1.05);
}

.kickbot-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Mobilní responzivita */
@media (max-width: 480px) {
    .kickbot-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .kickbot-fab {
        bottom: 18px;
        right: 18px;
    }
    .kickbot-window.active ~ .kickbot-fab {
        display: none !important;
    }
}
