/* NOSDDPP - Chatbot Odik */

/* Plovoucí tlačítko */
.odik-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #22c55e;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9998;
    transition: all 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.odik-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(34,197,94,0.4);
}
.odik-toggle-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}
.odik-toggle-close {
    position: absolute;
    font-size: 1.75rem;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    line-height: 1;
}
.odik-toggle-active {
    background: #dc2626;
    border-color: #dc2626;
}
.odik-toggle-active .odik-toggle-avatar {
    opacity: 0;
}
.odik-toggle-active .odik-toggle-close {
    opacity: 1;
}

/* Chat okno */
.odik-chat {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 420px;
    max-height: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 9997;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}
.odik-chat-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.odik-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}
.odik-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    object-fit: cover;
}
.odik-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.odik-header-info strong {
    font-size: 1rem;
}
.odik-header-info span {
    font-size: 0.75rem;
    opacity: 0.85;
}
.odik-header-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}
.odik-header-close:hover {
    opacity: 1;
}

/* Zprávy */
.odik-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 360px;
    max-height: 440px;
    background: #f8fafc;
}

/* Zpráva */
.odik-msg {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    max-width: 85%;
}
.odik-msg-bot {
    align-self: flex-start;
}
.odik-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.odik-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.odik-msg-bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.odik-msg-bot .odik-msg-bubble {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}
.odik-msg-user .odik-msg-bubble {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing animace */
.odik-dots span {
    animation: odikBlink 1.4s infinite;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
}
.odik-dots span:nth-child(2) { animation-delay: 0.2s; }
.odik-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes odikBlink {
    0%, 20% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* Input oblast */
.odik-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
.odik-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.2s;
}
.odik-input:focus {
    border-color: #22c55e;
}
.odik-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}
.odik-send {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.odik-send:hover {
    background: #16a34a;
}
.odik-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* MOBILNÍ VERZE - celostránkový chat */
@media (max-width: 640px) {
    .odik-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 70px;
        height: 70px;
    }
    .odik-chat {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 9999;
    }
    .odik-messages {
        min-height: 0;
        max-height: none;
        flex: 1;
    }
    .odik-chat-open ~ .odik-toggle {
        z-index: 10000;
    }
}

/* Scrollbar v chatu */
.odik-messages::-webkit-scrollbar {
    width: 4px;
}
.odik-messages::-webkit-scrollbar-track {
    background: transparent;
}
.odik-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}
