/* ===== CHAT CSS ===== */
/* Chat panel and message styles */

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 65vh;
    background: var(--bg-overlay);
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 101;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

.chat-panel.visible {
    transform: translateY(0);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn svg {
    width: 16px;
    height: 16px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 150px;
    max-height: 45vh;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.message.them {
    background: var(--surface);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.me {
    background: var(--accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.preview {
    opacity: 0.6;
    font-style: italic;
    border: 1px dashed var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    transition: bottom 0.2s;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--surface);
    border: none;
    border-radius: 20px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send svg {
    width: 18px;
    height: 18px;
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid var(--border);
}

.quick-replies::-webkit-scrollbar {
    display: none;
}

.quick-reply-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.quick-reply-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Filter Panel */
.filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 90%;
    background: var(--bg-overlay);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

.filter-panel.visible {
    transform: translateX(0);
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
}

.filter-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.filter-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.filter-input::placeholder {
    color: var(--text-tertiary);
}

.filter-apply {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}