﻿/* Base resets and typography */
#pcb-root, #pcb-root * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Global CSS color variables */
#pcb-root {
    --pcb-ink: #1b1d22;
    --pcb-paper: #fdfcfa;
    --pcb-accent: #2f5d50;
    --pcb-line: #e2e0db;
    --pcb-muted: #6b6f76;
}

/* Floating launcher bubble button */
#pcb-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--pcb-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    transition: transform .18s ease, box-shadow .18s ease;
}

    #pcb-bubble:hover {
        transform: translateY(-2px) scale(1.04);
    }

    #pcb-bubble svg {
        width: 26px;
        height: 26px;
    }

/* Unread messages badge */
.pcb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #e53e3e;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    border: 2px solid #ffffff;
}

/* Chat Panel Positioning */
#pcb-panel {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999;
    width: 370px !important;
    max-width: calc(100vw - 32px) !important;
    height: 600px;
    max-height: calc(100vh - 40px);
    background: var(--pcb-paper);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--pcb-line);
}

    #pcb-panel.open {
        display: flex;
        animation: pcb-rise .22s ease;
    }

@keyframes pcb-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header and action controls */
#pcb-header {
    background: var(--pcb-accent);
    color: white;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    cursor: move;
    user-select: none;
    min-height: 52px;
}

.pcb-drag-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcb-drag-icon {
    font-size: 16px;
    opacity: 0.6;
    cursor: grab;
}

#pcb-header-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

#pcb-header-sub {
    font-size: 11px;
    opacity: .8;
    margin-top: 1px;
}

.pcb-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pcb-icon-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    opacity: 0.85;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

    .pcb-icon-btn:hover {
        opacity: 1;
        background-color: rgba(255, 255, 255, 0.2);
    }

    .pcb-icon-btn svg {
        display: block;
        stroke: currentColor;
    }

/* Precheck form styling */
#pcb-precheck {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    #pcb-precheck p {
        font-size: 13px;
        color: var(--pcb-muted);
        margin: 0 0 4px;
    }

    #pcb-precheck input {
        border: 1px solid var(--pcb-line);
        border-radius: 10px;
        padding: 9px 12px;
        font-size: 13.5px;
        outline: none;
    }

        #pcb-precheck input:focus {
            border-color: var(--pcb-accent);
        }

    #pcb-precheck button {
        background: var(--pcb-accent);
        color: white;
        border: none;
        border-radius: 10px;
        padding: 10px;
        font-size: 13.5px;
        cursor: pointer;
        font-weight: 600;
    }

#pcb-skip {
    background: none !important;
    color: var(--pcb-muted) !important;
    font-weight: 400 !important;
    text-decoration: underline;
    cursor: pointer;
}

/* Messages container scroll area */
#pcb-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: radial-gradient(circle at 1px 1px, var(--pcb-line) 1px, transparent 0) 0 0/16px 16px, var(--pcb-paper);
}

/* Welcome banner card */
.pcb-welcome-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--pcb-line);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pcb-welcome-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.pcb-welcome-logo {
    background: var(--pcb-accent);
    color: #ffffff;
    font-weight: bold;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 8px;
    text-align: center;
}

.pcb-welcome-title {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--pcb-ink);
}

.pcb-welcome-sub {
    font-size: 11px;
    color: var(--pcb-muted);
}

.pcb-service-label {
    font-size: 11.5px;
    color: var(--pcb-muted);
    margin: 8px 0 6px;
}

/* Quick service grid buttons */
.pcb-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pcb-quick-btn {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 11px;
    font-weight: 500;
    color: var(--pcb-ink);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .pcb-quick-btn:hover {
        background: var(--pcb-accent);
        color: #ffffff;
        border-color: var(--pcb-accent);
    }

/* Banner image carousel */
.pcb-slider-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 6px;
    border: 1px solid var(--pcb-line);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.pcb-slider-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.pcb-slider-img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    transition: opacity 0.4s ease-in-out;
}

.pcb-slider-arrow {
    display: none !important;
}

.pcb-slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding-bottom: 2px;
}

.pcb-dot {
    width: 7px;
    height: 7px;
    background-color: #cbd5e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .pcb-dot.active {
        background-color: var(--pcb-accent);
        width: 18px;
        border-radius: 4px;
    }

/* Chat rows and message bubbles */
.pcb-row {
    display: flex;
}

    .pcb-row.user {
        justify-content: flex-end;
    }

.pcb-bubble-msg {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}

.pcb-row.bot .pcb-bubble-msg {
    background: white;
    border: 1px solid var(--pcb-line);
    color: var(--pcb-ink);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.pcb-row.user .pcb-bubble-msg {
    background: var(--pcb-accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.pcb-msg-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.75;
    text-align: right;
}

.pcb-row.user .pcb-msg-time {
    color: rgba(255, 255, 255, 0.9);
}

.pcb-row.bot .pcb-msg-time {
    color: #718096;
}

/* --- OPTIMIZED HEIGHT & COMPACT SUPPORT CARD STYLES --- */
.pcb-bubble-msg.support-card-bubble {
    width: 100% !important;
    max-width: 280px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.pcb-support-card {
    background: #ffffff;
    border: 1px solid #eef2f5;
    border-radius: 10px;
    padding: 6px 10px; /* Reduced vertical padding */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin: 0;
    width: 100%;
}

.pcb-support-header {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 3px;
    margin-bottom: 3px;
}

.pcb-support-title {
    font-weight: 700;
    font-size: 11px;
    color: var(--pcb-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcb-support-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0; /* Reduced height gap between rows */
    border-bottom: 1px dashed #f5f5f5;
}

    .pcb-support-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.pcb-support-icon-wrap {
    background: #e8f5e9;
    border-radius: 6px;
    width: 24px; /* Compact icon width */
    height: 24px; /* Compact icon height */
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pcb-support-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.pcb-support-label {
    font-size: 9.5px;
    color: var(--pcb-muted);
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 1px;
}

.pcb-support-value {
    font-size: 11.5px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.1;
    word-break: break-all;
}

    .pcb-support-value:hover {
        text-decoration: underline;
    }

.pcb-support-value-text {
    font-size: 10.5px;
    color: var(--pcb-ink);
    font-weight: 600;
    line-height: 1.1;
}

.pcb-support-closed {
    font-size: 9.5px;
    color: #e53e3e;
    font-weight: 600;
    margin-top: 0;
    line-height: 1;
}

.pcb-support-note {
    font-size: 8.5px;
    color: var(--pcb-muted);
    margin-top: 0;
    font-style: italic;
    line-height: 1;
}

/* Suggestion option chips */
.pcb-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.pcb-chip-btn {
    background: #ffffff;
    border: 1px solid var(--pcb-accent);
    color: var(--pcb-accent);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .pcb-chip-btn:hover {
        background: var(--pcb-accent);
        color: #ffffff;
    }

    .pcb-chip-btn:disabled,
    .pcb-chip-btn.disabled {
        opacity: 0.45 !important;
        cursor: not-allowed !important;
        background: #f0f0f0 !important;
        color: #888888 !important;
        border-color: #cccccc !important;
        pointer-events: none !important;
        box-shadow: none !important;
    }

/* Typing indicator animation */
.pcb-typing {
    display: flex;
    gap: 4px;
    padding: 10px 13px;
}

    .pcb-typing span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--pcb-muted);
        animation: pcb-bounce 1.2s infinite;
    }

        .pcb-typing span:nth-child(2) {
            animation-delay: .15s;
        }

        .pcb-typing span:nth-child(3) {
            animation-delay: .3s;
        }

@keyframes pcb-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: .5;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Autocomplete suggestion popup dropdown */
#pcb-suggestions {
    position: absolute;
    bottom: 55px;
    left: 12px;
    right: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.pcb-suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

    .pcb-suggestion-item:hover {
        background: #f5f5f5;
    }

    .pcb-suggestion-item.active {
        background-color: #e6f0fa !important;
        color: #1b5e20 !important;
        font-weight: 600;
        border-left: 3px solid var(--pcb-accent);
    }

/* Input bar area */
#pcb-inputbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--pcb-line);
    background: var(--pcb-paper);
    flex-shrink: 0;
    position: relative;
}

#pcb-input {
    flex: 1;
    border: 1px solid var(--pcb-line);
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13.5px;
    outline: none;
    background: white;
    color: var(--pcb-ink);
}

    #pcb-input:focus {
        border-color: var(--pcb-accent);
    }

#pcb-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--pcb-accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    #pcb-send:disabled {
        opacity: .5;
        cursor: default;
    }

    #pcb-send svg {
        width: 16px;
        height: 16px;
    }

/* Footer section */
#pcb-footer {
    text-align: center;
    font-size: 10px;
    color: var(--pcb-muted);
    padding: 3px 0 5px;
    background: var(--pcb-paper);
}

/* Dark mode theme styles */
#pcb-root.dark-theme #pcb-panel {
    background-color: #1a202c;
    color: #e2e8f0;
    border: 1px solid #2d3748;
}

#pcb-root.dark-theme #pcb-header {
    background-color: #2d3748;
    color: #ffffff;
}

#pcb-root.dark-theme #pcb-messages {
    background-color: #171923;
}

#pcb-root.dark-theme .pcb-welcome-card,
#pcb-root.dark-theme .pcb-slider-card {
    background-color: #2d3748;
    border-color: #4a5568;
}

#pcb-root.dark-theme .pcb-welcome-title {
    color: #ffffff;
}

#pcb-root.dark-theme .pcb-quick-btn {
    background-color: #1a202c;
    color: #e2e8f0;
    border-color: #4a5568;
}

    #pcb-root.dark-theme .pcb-quick-btn:hover {
        background-color: var(--pcb-accent);
        color: #ffffff;
    }

#pcb-root.dark-theme .pcb-row.bot .pcb-bubble-msg {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

#pcb-root.dark-theme .pcb-support-card {
    background: #2d3748;
    border-color: #4a5568;
}

#pcb-root.dark-theme .pcb-support-header {
    border-bottom-color: #4a5568;
}

#pcb-root.dark-theme .pcb-support-title {
    color: #68d391;
}

#pcb-root.dark-theme .pcb-support-icon-wrap {
    background: #1a202c;
}

#pcb-root.dark-theme .pcb-support-value {
    color: #63b3ed;
}

#pcb-root.dark-theme .pcb-support-value-text {
    color: #e2e8f0;
}

#pcb-root.dark-theme .pcb-support-label,
#pcb-root.dark-theme .pcb-support-note {
    color: #a0aec0;
}

#pcb-root.dark-theme .pcb-chip-btn {
    background: #2d3748;
    border-color: #68d391;
    color: #68d391;
}

    #pcb-root.dark-theme .pcb-chip-btn:hover {
        background: #68d391;
        color: #1a202c;
    }

#pcb-root.dark-theme #pcb-inputbar {
    background-color: #1a202c;
    border-top: 1px solid #2d3748;
}

#pcb-root.dark-theme #pcb-input {
    background-color: #2d3748;
    color: #ffffff;
    border: 1px solid #4a5568;
}

#pcb-root.dark-theme #pcb-suggestions {
    background-color: #2d3748;
    border: 1px solid #4a5568;
}

#pcb-root.dark-theme .pcb-suggestion-item {
    color: #e2e8f0;
    border-bottom: 1px solid #3a4a5e;
}

    #pcb-root.dark-theme .pcb-suggestion-item:hover {
        background-color: #4a5568;
    }

    #pcb-root.dark-theme .pcb-suggestion-item.active {
        background-color: #4a5568 !important;
        color: #ffffff !important;
        border-left: 3px solid #68d391;
    }

#pcb-root.dark-theme #pcb-footer {
    background-color: #1a202c;
    color: #a0aec0;
    border-top: 1px solid #2d3748;
}

#pcb-root.dark-theme .pcb-row.bot .pcb-msg-time {
    color: #a0aec0;
}
