/* ─── Perfect Clinic Chatbot – Styles ─────────────────────────────────────── */

#pcc-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    /* Chatbot nesmie ovplyvniť šírku/layout stránky */
    width: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
}
#pcc-chatbot * {
    pointer-events: auto;
    box-sizing: border-box;
}

/* ─── Bubble tlačidlo ─── */
#pcc-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--pcc-color, #b8860b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    position: fixed;
    bottom: 24px;
    right: 24px;
    user-select: none;
}
#pcc-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.32);
}
#pcc-bubble-icon, #pcc-bubble-close {
    font-size: 26px;
    line-height: 1;
    color: #fff;
}
#pcc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: pcc-pulse 1.5s infinite;
}
@keyframes pcc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(229,57,53,.6); }
    70%  { box-shadow: 0 0 0 8px rgba(229,57,53,0); }
    100% { box-shadow: 0 0 0 0 rgba(229,57,53,0); }
}

/* ─── Chat okno ─── */
#pcc-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    max-height: 540px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pcc-fadeIn 0.25s ease;
    /* Zabráni roztiahnutiu stránky doprava */
    max-width: calc(100vw - 16px);
}
@keyframes pcc-fadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Header ─── */
#pcc-header {
    background: var(--pcc-color, #b8860b);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
#pcc-avatar {
    font-size: 28px;
    line-height: 1;
}
#pcc-header-name {
    font-weight: 700;
    font-size: 15px;
    flex: 1;
}
#pcc-header-status {
    font-size: 11px;
    opacity: 0.85;
    display: block;
    margin-top: 2px;
}
#pcc-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}
#pcc-close-btn:hover { opacity: 1; }

/* ─── Správy ─── */
#pcc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f8f8;
    min-height: 280px;
    max-height: 380px;
    scroll-behavior: smooth;
}
.pcc-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: pcc-msgIn 0.2s ease;
}
@keyframes pcc-msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pcc-msg.bot { align-self: flex-start; }
.pcc-msg.user { align-self: flex-end; }

.pcc-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}
.pcc-msg.bot .pcc-msg-bubble {
    background: #fff;
    color: #222;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.pcc-msg.user .pcc-msg-bubble {
    background: var(--pcc-color, #b8860b);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.pcc-msg-time {
    font-size: 11px;
    color: #aaa;
    margin-top: 3px;
    padding: 0 4px;
}
.pcc-msg.user .pcc-msg-time { text-align: right; }

/* ─── Typing indicator ─── */
#pcc-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
#pcc-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #bbb;
    display: inline-block;
    animation: pcc-bounce 1.2s infinite;
}
#pcc-typing span:nth-child(2) { animation-delay: 0.2s; }
#pcc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pcc-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-5px); }
}

/* ─── Input ─── */
#pcc-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eee;
}
#pcc-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.15s;
    line-height: 1.4;
}
#pcc-input:focus { border-color: var(--pcc-color, #b8860b); }
#pcc-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pcc-color, #b8860b);
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s, transform 0.15s;
}
#pcc-send:hover { opacity: 0.88; transform: scale(1.07); }
#pcc-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ─── Footer ─── */
#pcc-footer {
    text-align: center;
    font-size: 10px;
    color: #bbb;
    padding: 6px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
    #pcc-chatbot {
        bottom: 12px;
        right: 12px;
    }
    #pcc-bubble {
        width: 50px;
        height: 50px;
        bottom: 12px;
        right: 12px;
    }
    #pcc-bubble-icon, #pcc-bubble-close {
        font-size: 20px;
    }
    #pcc-window {
        position: fixed;
        bottom: 70px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        max-height: 35vh;
        border-radius: 12px;
    }
    #pcc-messages {
        min-height: 60px;
        max-height: calc(35vh - 110px);
        padding: 8px;
        font-size: 12px;
        gap: 6px;
    }
    .pcc-msg-bubble {
        font-size: 12px;
        padding: 7px 10px;
    }
    .pcc-msg-time {
        font-size: 10px;
    }
    #pcc-header {
        padding: 8px 10px;
    }
    #pcc-avatar {
        font-size: 18px;
    }
    #pcc-header-name {
        font-size: 13px;
    }
    #pcc-header-status {
        font-size: 10px;
    }
    #pcc-input-area {
        padding: 6px 8px;
    }
    #pcc-input {
        font-size: 12px;
        padding: 6px 10px;
    }
    #pcc-send {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    #pcc-footer {
        font-size: 9px;
        padding: 4px;
    }
}
