/* Základní wrapper chatu */
#ztk-chat-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Černá kulatá spouštěcí ikona */
#ztk-chat-trigger {
    width: 60px;
    height: 60px;
    background: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
#ztk-chat-trigger:hover {
    transform: scale(1.05);
}

/* Chatové okno (Zaoblení 24px podle image_b4a4c6.jpg) */
#ztk-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 400px;
    height: 664px;
    background-color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: bottom right;
}
#ztk-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Hlavička okna */
#ztk-chat-header {
    background: #ffffff;
    color: #000000;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
}
.ztk-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ztk-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ztk-header-avatar img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}
.ztk-chat-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
}
.ztk-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
#ztk-chat-clear-btn, #ztk-chat-close-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}
#ztk-chat-clear-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}
#ztk-chat-close-btn:hover {
    opacity: 1;
}

/* Oblast zpráv */
#ztk-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#ztk-chat-messages::-webkit-scrollbar {
    width: 5px;
}
#ztk-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
}

/* Bubliny zpráv */
.ztk-msg-row {
    display: flex;
    max-width: 85%;
    animation: fadeInMsg 0.2s ease forwards;
}
.ztk-msg-row.user {
    align-self: flex-end;
}
.ztk-msg-row.bot {
    align-self: flex-start;
}
.ztk-msg {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.45;
    word-wrap: break-word;
}
.ztk-msg-row.user .ztk-msg {
    background-color: #000000;
    color: #ffffff;
}
.ztk-msg-row.bot .ztk-msg {
    background-color: #f1f1f1;
    color: #1a202c;
}

/* Formátování textu a Markdown */
.ztk-msg h1, .ztk-msg h2, .ztk-msg h3 {
    font-size: 15px;
    margin: 12px 0 6px 0;
    font-weight: 700;
}
.ztk-msg p {
    margin: 0 0 8px 0;
}
.ztk-msg p:last-child {
    margin-bottom: 0;
}
.ztk-msg ul {
    margin: 6px 0 6px 18px;
    padding: 0;
}
.ztk-msg li {
    margin-bottom: 4px;
}

/* Vstupní oblast */
#ztk-chat-input-container {
    padding: 12px 24px 16px 24px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#ztk-chat-input-area {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    padding: 4px 6px 4px 16px;
    background: #ffffff;
    border-radius: 24px;
    position: relative;
}
#ztk-chat-input-area:focus-within {
    border-color: #cbd5e0;
}
#ztk-chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
    color: #1a202c;
    background: transparent;
}
#ztk-chat-input::placeholder {
    color: #a0aec0;
}

/* Ikony v poli vstupu */
.ztk-input-icons {
    display: flex;
    align-items: center;
    padding-right: 4px;
}
#ztk-chat-send {
    width: 28px;
    height: 28px;
    background: #f7fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
#ztk-chat-send:hover {
    background: #edf2f7;
}

/* Powered by link */
.ztk-powered-by {
    text-align: center;
    font-size: 12px;
}
.ztk-powered-by a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s;
}
.ztk-powered-by a:hover {
    color: #718096;
}

/* Načítání */
.loading-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
}
.loading-dots span {
    width: 6px;
    height: 6px;
    background-color: #a0aec0;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Mobilní zobrazení */
@media (max-width: 450px) {
    #ztk-chat-wrapper { bottom: 0; right: 0; }
    #ztk-chat-trigger { bottom: 20px; right: 20px; position: fixed; }
    #ztk-chat-window {
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        width: 100%; height: 100%; border-radius: 0;
        transform: translateY(100%);
    }
    #ztk-chat-window.open { transform: translateY(0); }
}
