﻿/* ==========================================================================
   PK CMS v1.0 — Live Chat Widget (Sprint F-010)
   Complete Chat UI Stylesheet
   ========================================================================== */

:root {
    --z-chat-widget: 9000;
    --z-chat-button: 9001;
    --z-chat-notification: 9002;
    --z-chat-tooltip: 9003;
}

/* 1. Floating Chat Button */
.pk-chat-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: var(--z-chat-button);
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.4);
    transition: all var(--duration-normal) var(--ease-default);
}
.pk-chat-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(30, 58, 95, 0.55);
}
.pk-chat-button:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 3px;
}
.pk-chat-button:active { transform: scale(0.96); }
.pk-chat-button .pk-chat-icon {
    transition: transform var(--duration-normal) var(--ease-default);
}
.pk-chat-button.is-active .pk-chat-icon { transform: rotate(180deg); }

.pk-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background-color: var(--color-accent, #e74c3c);
    color: var(--text-white);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-body);
    opacity: 0;
    transform: scale(0);
    transition: all var(--duration-normal) var(--ease-default);
}
.pk-chat-badge.is-visible { opacity: 1; transform: scale(1); }

.pk-chat-button-pulse {
    position: absolute;
    inset: -6px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    opacity: 0;
    z-index: -1;
    animation: chatPulse 2.5s ease-out infinite;
    pointer-events: none;
}
.pk-chat-button.is-active .pk-chat-button-pulse { animation: none; opacity: 0; }
@keyframes chatPulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.6); opacity: 0; }
}

.pk-chat-button-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--gray-800);
    color: var(--text-white);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-default);
    pointer-events: none;
    box-shadow: var(--shadow-md);
}
.pk-chat-button-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid var(--gray-800);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}
.pk-chat-button:hover .pk-chat-button-label { opacity: 1; visibility: visible; }

/* 2. Chat Widget Container */
.pk-chat-widget {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 400px;
    max-height: 620px;
    border-radius: var(--radius-xl);
    background-color: var(--bg-body);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: var(--z-chat-widget);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all var(--duration-normal) var(--ease-default);
}
.pk-chat-widget.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.pk-chat-widget.is-minimized { max-height: 64px; overflow: hidden; }
.pk-chat-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 1;
}

/* 3. Chat Header */
.pk-chat-header {
    background: var(--gradient-primary);
    color: var(--text-white);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.pk-chat-header-info { flex: 1; min-width: 0; }
.pk-chat-header-company {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2px;
}
.pk-chat-header-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.pk-chat-header-name {
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pk-chat-header-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}
.pk-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.pk-chat-status-dot.is-online { background-color: #27ae60; box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3); }
.pk-chat-status-dot.is-offline { background-color: var(--gray-400); }
.pk-chat-status-dot.is-away { background-color: var(--color-warning); }
.pk-chat-header-actions { display: flex; align-items: center; gap: 0.25rem; }
.pk-chat-header-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: background var(--duration-fast) var(--ease-default);
}
.pk-chat-header-btn:hover { background: rgba(255, 255, 255, 0.2); }
.pk-chat-header-btn:focus-visible { outline: 2px solid var(--text-white); outline-offset: 1px; }

/* 4. Chat Body */
.pk-chat-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; min-height: 0; }
.pk-chat-body-panel { display: none; flex-direction: column; flex: 1; min-height: 0; }
.pk-chat-body-panel.is-active { display: flex; }

/* 5. Welcome Popup */
.pk-chat-welcome {
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--bg-body) 100%);
}
.pk-chat-welcome-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.25);
    position: relative;
}
.pk-chat-welcome-avatar .pk-chat-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border: 3px solid var(--bg-body);
}
.pk-chat-welcome-name { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
.pk-chat-welcome-role { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1rem; }
.pk-chat-welcome-message {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}
.pk-chat-welcome-start {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--duration-normal) var(--ease-default);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}
.pk-chat-welcome-start:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30, 58, 95, 0.4); }
.pk-chat-welcome-start:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-welcome-alt { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); }
.pk-chat-welcome-alt-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.pk-chat-welcome-alt-actions { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.pk-chat-welcome-alt-btn {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-200);
    background-color: var(--bg-body);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-welcome-alt-btn:hover { border-color: var(--color-primary); color: var(--color-primary); background-color: rgba(30, 58, 95, 0.04); }

/* 6. Conversation Area */
.pk-chat-conversation {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: var(--gray-50);
    scroll-behavior: smooth;
}
.pk-chat-conversation::-webkit-scrollbar { width: 4px; }
.pk-chat-conversation::-webkit-scrollbar-track { background: transparent; }
.pk-chat-conversation::-webkit-scrollbar-thumb { background-color: var(--gray-300); border-radius: var(--radius-full); }

.pk-chat-date-sep {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.pk-chat-date-sep::before,
.pk-chat-date-sep::after { content: ''; flex: 1; height: 1px; background-color: var(--gray-200); }
.pk-chat-date-sep span { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.05em; }

.pk-chat-msg {
    display: flex;
    gap: 0.5rem;
    max-width: 85%;
    animation: msgSlideIn 0.3s var(--ease-out) forwards;
}
@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.pk-chat-msg.is-agent { align-self: flex-start; }
.pk-chat-msg.is-visitor { align-self: flex-end; flex-direction: row-reverse; }

.pk-chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}
.pk-chat-msg.is-visitor .pk-chat-msg-avatar { background-color: var(--gray-300); color: var(--gray-600); }
.pk-chat-msg-content { display: flex; flex-direction: column; gap: 0.25rem; }

.pk-chat-msg-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.55;
    word-wrap: break-word;
}
.pk-chat-msg.is-agent .pk-chat-msg-bubble {
    background-color: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}
.pk-chat-msg.is-visitor .pk-chat-msg-bubble {
    background: var(--gradient-primary);
    color: var(--text-white);
    border-bottom-right-radius: var(--radius-sm);
}

.pk-chat-msg-meta { display: flex; align-items: center; gap: 0.375rem; font-size: 0.6875rem; color: var(--text-light); }
.pk-chat-msg.is-visitor .pk-chat-msg-meta { justify-content: flex-end; }
.pk-chat-msg-time { font-weight: 500; }
.pk-chat-msg-status { display: flex; align-items: center; }
.pk-chat-msg-status i { font-size: 0.625rem; }
.pk-chat-msg-status i.is-read { color: var(--color-info); }

/* Typing Indicator */
.pk-chat-typing { display: none; align-self: flex-start; padding: 0 0.5rem; }
.pk-chat-typing.is-visible { display: flex; }
.pk-chat-typing-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-body);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    box-shadow: var(--shadow-xs);
}
.pk-chat-typing-text { font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }
.pk-chat-typing-dots { display: flex; gap: 3px; }
.pk-chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--gray-400);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.pk-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.pk-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* 7. Quick Replies */
.pk-chat-quick-replies {
    padding: 0.75rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}
.pk-chat-quick-reply {
    padding: 0.4375rem 0.875rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-primary);
    background-color: var(--bg-body);
    color: var(--color-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-quick-reply:hover {
    background-color: var(--color-primary);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.pk-chat-quick-reply:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }

/* 8. Chat Input Area */
.pk-chat-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-200);
    background-color: var(--bg-body);
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}
.pk-chat-input-tools { display: flex; gap: 0.125rem; }
.pk-chat-input-tool {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-input-tool:hover { background-color: var(--gray-100); color: var(--color-primary); }
.pk-chat-input-tool:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 1px; }
.pk-chat-input-wrapper { flex: 1; position: relative; }
.pk-chat-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--gray-50);
    resize: none;
    max-height: 96px;
    min-height: 38px;
    line-height: 1.4;
    transition: border-color var(--duration-fast) var(--ease-default), background-color var(--duration-fast) var(--ease-default);
}
.pk-chat-input::placeholder { color: var(--gray-400); }
.pk-chat-input:focus { outline: none; border-color: var(--color-primary); background-color: var(--bg-body); }
.pk-chat-send {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    flex-shrink: 0;
    transition: all var(--duration-fast) var(--ease-default);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}
.pk-chat-send:hover { transform: scale(1.05); box-shadow: 0 3px 12px rgba(30, 58, 95, 0.35); }
.pk-chat-send:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-send:active { transform: scale(0.95); }

/* 9. Offline Message Form */
.pk-chat-offline {
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    background-color: var(--gray-50);
}
.pk-chat-offline-header { text-align: center; margin-bottom: 1.25rem; }
.pk-chat-offline-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--color-warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem;
}
.pk-chat-offline-header h4 { font-size: 1rem; color: var(--text-primary); margin-bottom: 0.375rem; }
.pk-chat-offline-header p { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0; }
.pk-chat-offline-form { display: flex; flex-direction: column; gap: 0.875rem; }
.pk-chat-offline-field { display: flex; flex-direction: column; gap: 0.375rem; }
.pk-chat-offline-field label { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.pk-chat-offline-field label .pk-required { color: var(--color-danger); }
.pk-chat-offline-field input,
.pk-chat-offline-field select,
.pk-chat-offline-field textarea {
    padding: 0.625rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    transition: border-color var(--duration-fast) var(--ease-default);
}
.pk-chat-offline-field input:focus,
.pk-chat-offline-field select:focus,
.pk-chat-offline-field textarea:focus { outline: none; border-color: var(--color-primary); }
.pk-chat-offline-field textarea { resize: vertical; min-height: 80px; }
.pk-chat-offline-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--duration-normal) var(--ease-default);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}
.pk-chat-offline-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(30, 58, 95, 0.35); }
.pk-chat-offline-submit:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-offline-success { text-align: center; padding: 2rem 1rem; display: none; }
.pk-chat-offline-success.is-visible { display: block; }
.pk-chat-offline-success-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}
.pk-chat-offline-success h4 { color: var(--text-heading); margin-bottom: 0.5rem; }
.pk-chat-offline-success p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0; }

/* 10. Agent Profile Card */
.pk-chat-agent-panel { padding: 1.5rem 1.25rem; overflow-y: auto; flex: 1; background-color: var(--gray-50); }
.pk-chat-agent-card { background-color: var(--bg-body); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.pk-chat-agent-card-header { background: var(--gradient-primary); padding: 1.5rem; text-align: center; position: relative; }
.pk-chat-agent-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 0.75rem;
    position: relative;
}
.pk-chat-agent-card-avatar .pk-chat-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border: 3px solid var(--color-primary);
}
.pk-chat-agent-card-name { font-size: 1.125rem; font-weight: 600; color: var(--text-white); margin-bottom: 0.25rem; }
.pk-chat-agent-card-designation { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.7); }
.pk-chat-agent-card-body { padding: 1.25rem; }
.pk-chat-agent-card-bio { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1.25rem; text-align: center; }
.pk-chat-agent-card-detail { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--gray-100); }
.pk-chat-agent-card-detail:last-child { border-bottom: none; }
.pk-chat-agent-card-detail i {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background-color: var(--gray-100);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.pk-chat-agent-card-detail-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1px; }
.pk-chat-agent-card-detail-value { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }

/* 11. Business Hours */
.pk-chat-business-hours { padding: 1.25rem; }
.pk-chat-business-hours h5 { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.875rem; display: flex; align-items: center; gap: 0.5rem; }
.pk-chat-business-hours h5 i { color: var(--color-secondary); }
.pk-chat-hours-list { display: flex; flex-direction: column; gap: 0.375rem; }
.pk-chat-hours-row { display: flex; justify-content: space-between; align-items: center; padding: 0.375rem 0; font-size: 0.8125rem; }
.pk-chat-hours-day { color: var(--text-secondary); font-weight: 500; }
.pk-chat-hours-time { color: var(--text-muted); }
.pk-chat-hours-row.is-current { background-color: rgba(30, 58, 95, 0.04); border-radius: var(--radius-md); padding: 0.5rem 0.625rem; margin: 0 -0.625rem; }
.pk-chat-hours-row.is-current .pk-chat-hours-day { color: var(--color-primary); font-weight: 600; }
.pk-chat-hours-row.is-current .pk-chat-hours-time { color: var(--color-primary); font-weight: 600; }
.pk-chat-hours-status { margin-top: 1rem; padding: 0.75rem; border-radius: var(--radius-md); text-align: center; font-size: 0.8125rem; font-weight: 600; }
.pk-chat-hours-status.is-open { background-color: rgba(39, 174, 96, 0.08); color: var(--color-success); }
.pk-chat-hours-status.is-closed { background-color: rgba(231, 76, 60, 0.08); color: var(--color-danger); }

/* 12. Chat History */
.pk-chat-history-panel { padding: 1.25rem; overflow-y: auto; flex: 1; background-color: var(--gray-50); }
.pk-chat-history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.pk-chat-history-header h5 { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.pk-chat-history-list { display: flex; flex-direction: column; gap: 0.625rem; }
.pk-chat-history-item {
    background-color: var(--bg-body);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-history-item:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.pk-chat-history-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.375rem; }
.pk-chat-history-item-agent { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.pk-chat-history-item-date { font-size: 0.6875rem; color: var(--text-muted); }
.pk-chat-history-item-preview { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.pk-chat-history-empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.pk-chat-history-empty i { font-size: 2rem; color: var(--gray-300); margin-bottom: 0.75rem; display: block; }
.pk-chat-history-empty p { font-size: 0.875rem; margin-bottom: 0; }

/* 13. Feedback / Satisfaction Survey */
.pk-chat-feedback-panel { padding: 1.5rem 1.25rem; overflow-y: auto; flex: 1; background-color: var(--gray-50); text-align: center; }
.pk-chat-feedback-title { font-size: 1.0625rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.375rem; }
.pk-chat-feedback-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.pk-chat-star-rating { display: flex; justify-content: center; gap: 0.375rem; margin-bottom: 1.25rem; }
.pk-chat-star {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: none;
    border: 2px solid var(--gray-200);
    color: var(--gray-300);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-star:hover { border-color: var(--color-secondary); color: var(--color-secondary); transform: scale(1.1); }
.pk-chat-star.is-active { background-color: var(--color-secondary); border-color: var(--color-secondary); color: var(--gray-900); }
.pk-chat-star:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-emoji-rating { display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.pk-chat-emoji {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: none;
    border: 2px solid var(--gray-200);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-emoji:hover { transform: scale(1.15); }
.pk-chat-emoji.is-active { border-color: var(--color-primary); background-color: rgba(30, 58, 95, 0.06); }
.pk-chat-emoji:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-feedback-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 1rem;
    transition: border-color var(--duration-fast) var(--ease-default);
}
.pk-chat-feedback-textarea::placeholder { color: var(--gray-400); }
.pk-chat-feedback-textarea:focus { outline: none; border-color: var(--color-primary); }
.pk-chat-feedback-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-default);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}
.pk-chat-feedback-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(30, 58, 95, 0.35); }
.pk-chat-feedback-submit:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-feedback-success { display: none; padding: 2rem 1rem; }
.pk-chat-feedback-success.is-visible { display: block; }
.pk-chat-feedback-success-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}
.pk-chat-feedback-success h4 { color: var(--text-heading); margin-bottom: 0.5rem; }
.pk-chat-feedback-success p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0; }

/* 14. Contact Alternatives */
.pk-chat-contact-alt { padding: 1.25rem; border-top: 1px solid var(--gray-200); background-color: var(--bg-body); }
.pk-chat-contact-alt-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; text-align: center; }
.pk-chat-contact-alt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pk-chat-contact-alt-btn {
    padding: 0.625rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background-color: var(--bg-body);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-contact-alt-btn i { font-size: 0.875rem; }
.pk-chat-contact-alt-btn:hover { border-color: var(--color-primary); color: var(--color-primary); background-color: rgba(30, 58, 95, 0.03); transform: translateY(-1px); }
.pk-chat-contact-alt-btn:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.pk-chat-contact-alt-btn.is-phone i { color: var(--color-success); }
.pk-chat-contact-alt-btn.is-whatsapp i { color: #25d366; }
.pk-chat-contact-alt-btn.is-email i { color: var(--color-info); }
.pk-chat-contact-alt-btn.is-appointment i { color: var(--color-secondary); }

/* 15. Privacy Notice */
.pk-chat-privacy { padding: 0.625rem 1.25rem; background-color: var(--gray-50); border-top: 1px solid var(--gray-100); text-align: center; }
.pk-chat-privacy-text { font-size: 0.6875rem; color: var(--text-light); line-height: 1.5; margin-bottom: 0; }
.pk-chat-privacy-text a { color: var(--color-primary); text-decoration: underline; font-weight: 500; }
.pk-chat-privacy-text a:hover { color: var(--color-secondary); }

/* 16. Notification Toast */
.pk-chat-toast {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 320px;
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    z-index: var(--z-chat-notification);
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all var(--duration-normal) var(--ease-default);
}
.pk-chat-toast.is-visible { opacity: 1; visibility: visible; transform: translateX(0); }
.pk-chat-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.pk-chat-toast-icon.is-info { background-color: rgba(52, 152, 219, 0.1); color: var(--color-info); }
.pk-chat-toast-icon.is-success { background-color: rgba(39, 174, 96, 0.1); color: var(--color-success); }
.pk-chat-toast-icon.is-warning { background-color: rgba(243, 156, 18, 0.1); color: var(--color-warning); }
.pk-chat-toast-icon.is-error { background-color: rgba(231, 76, 60, 0.1); color: var(--color-danger); }
.pk-chat-toast-content { flex: 1; min-width: 0; }
.pk-chat-toast-title { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.125rem; }
.pk-chat-toast-message { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0; line-height: 1.4; }
.pk-chat-toast-close {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-toast-close:hover { background-color: var(--gray-100); color: var(--text-primary); }

/* 17. File Attachment UI */
.pk-chat-attachment-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(30, 58, 95, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.pk-chat-attachment-overlay.is-visible { display: flex; }
.pk-chat-attachment-dropzone {
    width: calc(100% - 2rem);
    padding: 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-white);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.pk-chat-attachment-dropzone:hover { border-color: rgba(255, 255, 255, 0.5); background-color: rgba(255, 255, 255, 0.05); }
.pk-chat-attachment-dropzone i { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.7; }
.pk-chat-attachment-dropzone p { color: rgba(255, 255, 255, 0.7); font-size: 0.875rem; margin-bottom: 0.5rem; }
.pk-chat-attachment-dropzone small { color: rgba(255, 255, 255, 0.4); font-size: 0.75rem; }
.pk-chat-attachment-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}
.pk-chat-attachment-close:hover { background: rgba(255, 255, 255, 0.25); }

/* 18. Navigation Tabs */
.pk-chat-nav { display: flex; border-bottom: 1px solid var(--gray-200); background-color: var(--bg-body); padding: 0 0.5rem; flex-shrink: 0; }
.pk-chat-nav-btn {
    flex: 1;
    padding: 0.625rem 0.5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    position: relative;
    transition: color var(--duration-fast) var(--ease-default);
}
.pk-chat-nav-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background-color: transparent;
    border-radius: 1px;
    transition: background-color var(--duration-fast) var(--ease-default);
}
.pk-chat-nav-btn:hover { color: var(--text-primary); }
.pk-chat-nav-btn.is-active { color: var(--color-primary); font-weight: 600; }
.pk-chat-nav-btn.is-active::after { background-color: var(--color-primary); }
.pk-chat-nav-btn i { font-size: 0.875rem; }

/* 19. Responsive */
@media (max-width: 768px) {
    .pk-chat-widget { width: 360px; right: 1rem; bottom: 5.5rem; }
    .pk-chat-button { width: 58px; height: 58px; font-size: 1.375rem; bottom: 1rem; right: 1rem; }
    .pk-chat-toast { right: 1rem; width: 280px; bottom: 5.5rem; }
}
@media (max-width: 480px) {
    .pk-chat-widget {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        transform: translateY(100%);
    }
    .pk-chat-widget.is-open { transform: translateY(0); }
    .pk-chat-widget.is-minimized { max-height: 64px; }
    .pk-chat-button { bottom: 1rem; right: 1rem; width: 56px; height: 56px; }
    .pk-chat-toast { width: calc(100% - 2rem); right: 1rem; }
    .pk-chat-button-label { display: none; }
}
