/*
 * PerfectCar Dashboard — Modern SaaS UI (Responsive & Animated)
 * File: /wp-content/themes/hello-elementor-child/inc/pc-dashboard.css
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600&family=Saira:wght@600;700;800&display=swap');

/* ─── RESET SCOPE & FIX OVERFLOW ─── */
.pc-db { all: unset; display: block; }
.pc-db, .pc-db *, .pc-db *::before, .pc-db *::after { box-sizing: border-box !important; }

/* ─── CSS VARS ─── */
.pc-db {
    --g-primary:  #016b61;
    --g-primary-hover: #003f3a;
    --g-accent:   #c0d108;
    --g-text:     #111827;
    --g-muted:    #6b7280;
    --g-border:   #e5e7eb; 
    --g-bg:       #f8fafc;
    --g-white:    #ffffff;
    --g-red:      #ef4444;
    font-family: 'Roboto', sans-serif;
    background: var(--g-bg);
    min-height: 100vh;
    padding: 40px 20px 80px;
    max-width: 100vw;
    overflow-x: hidden; /* Hard stop on horizontal scrolling */
}

/* ─── KEYFRAME ANIMATIONS ─── */
@keyframes pcCardEnter {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pcFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ─── LAYOUT ─── */
.pc-db-inner {
    max-width: var(--e-global-content-width, 1280px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
    min-width: 0; /* Critical for keeping grid inside bounds */
}

/* ─── SIDEBAR (Desktop) ─── */
.pc-db-sidebar {
    background: var(--g-white);
    border-radius: 16px;
    padding: 24px 16px;
    position: sticky;
    top: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.03);
    border: 1px solid var(--g-border);
    animation: pcCardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    min-width: 0; /* Prevents stretching */
}
.pc-db-user-card {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--g-border);
    margin-bottom: 16px;
}
.pc-db-user-card img {
    width: 72px; height: 72px;
    border-radius: 50%; object-fit: cover;
    border: 3px solid #f0fdf4;
    display: block; margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.pc-db-user-name {
    font-family: 'Saira', sans-serif;
    font-size: 18px; font-weight: 800; color: var(--g-text); margin-bottom: 2px;
}
.pc-db-user-email { font-size: 12px; color: var(--g-muted); font-weight: 500; word-break: break-all; }

.pc-db-nav-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--g-muted) !important;
    font-size: 14px !important; font-weight: 600 !important;
    text-decoration: none !important;
    transition: all .2s ease;
    margin-bottom: 4px;
    font-family: 'Roboto', sans-serif !important;
}
.pc-db-nav-link i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; transition: transform .2s; }
.pc-db-nav-link:hover { background: #f9fafb !important; color: var(--g-text) !important; }
.pc-db-nav-link:hover i { transform: translateX(3px); }
.pc-db-nav-link.active { background: #f0fdf4 !important; color: var(--g-primary) !important; }
.pc-db-nav-link.active i { color: var(--g-primary); }

.pc-db-logout {
    color: var(--g-red) !important;
    margin-top: 16px;
    border-top: 1px solid var(--g-border);
    padding-top: 16px;
    border-radius: 0;
}
.pc-db-logout:hover { background: #fef2f2 !important; color: var(--g-red) !important; }

/* ─── MAIN CONTENT ─── */
.pc-db-main { 
    min-width: 0; /* Prevents CSS Grid blowout */
}
.pc-db-page-title {
    font-family: 'Saira', sans-serif;
    font-size: 32px; font-weight: 800; color: var(--g-text);
    margin: 0 0 4px; line-height: 1.2;
    animation: pcFadeIn 0.5s ease-out both;
}
.pc-db-welcome { 
    font-size: 14px; color: var(--g-muted); margin-bottom: 28px; 
    animation: pcFadeIn 0.5s ease-out 0.1s both;
}
.pc-db-welcome strong { color: var(--g-text); font-weight: 700; }

/* ─── STAT CARDS (Animated) ─── */
.pc-db-cards.pc-db-cards {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
}
.pc-db-card.pc-db-card {
    background: #fff !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.03) !important; 
    border: 1px solid #f1f5f9 !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
    text-decoration: none !important;
    cursor: default;
    animation: pcCardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* Stagger the card entrances */
.pc-db-card:nth-child(1) { animation-delay: 0.05s; }
.pc-db-card:nth-child(2) { animation-delay: 0.10s; }
.pc-db-card:nth-child(3) { animation-delay: 0.15s; }
.pc-db-card:nth-child(4) { animation-delay: 0.20s; }
.pc-db-card:nth-child(5) { animation-delay: 0.25s; }
.pc-db-card:nth-child(6) { animation-delay: 0.30s; }

.pc-db-card.clickable { cursor: pointer; }

/* Premium Hover Physics */
.pc-db-card.pc-db-card:hover { 
    transform: translateY(-2px) scale(1.01) !important; 
    box-shadow: 0 6px 16px rgba(1, 107, 97, 0.08) !important; 
    border-color: #cbd5e1 !important; 
    z-index: 2;
}
.pc-db-card-icon-wrap.pc-db-card-icon-wrap {
    width: 36px !important; height: 36px !important;
    border-radius: 8px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 16px !important; flex-shrink: 0 !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pc-db-card:hover .pc-db-card-icon-wrap {
    transform: scale(1.05) rotate(3deg);
}

/* Colors for icons */
.c1 .pc-db-card-icon-wrap { background: #f0fdf4; color: #059669; }
.c2 .pc-db-card-icon-wrap { background: #eff6ff; color: #2563eb; }
.c3 .pc-db-card-icon-wrap { background: #fef3c7; color: #d97706; }
.c4 .pc-db-card-icon-wrap { background: #f3e8ff; color: #7e22ce; }
.c5 .pc-db-card-icon-wrap { background: #f3f4f6; color: #4b5563; }
.c-open .pc-db-card-icon-wrap { background: #ecfdf5; color: #047857; }
.c-restricted .pc-db-card-icon-wrap { background: #fef2f2; color: #dc2626; }
.c-ads .pc-db-card-icon-wrap { background: #e0f2fe; color: #0369a1; }


.pc-db-card-info { flex: 1; min-width: 0; }
.pc-db-card-value.pc-db-card-value {
    font-family: 'Saira', sans-serif !important;
    font-size: 20px !important; font-weight: 800 !important; color: #111827 !important;
    line-height: 1.1 !important; margin-bottom: 2px !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
}
.pc-db-card-value.sm { font-size: 14px; margin-top: 2px; }
.pc-db-card-label.pc-db-card-label {
    font-size: 10px !important; color: #6b7280 !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: .5px !important;
}
.pc-db-card-sub { font-size: 10px; color: #9ca3af; margin-top: 2px; }

/* ─── NOTIFICATIONS BOX ─── */
.pc-db-box {
    background: var(--g-white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.03);
    border: 1px solid var(--g-border);
    overflow: hidden;
    /* fill-mode is "backwards", not "both": holds the 0% (hidden) state
       during the animation-delay so there's no flash before it plays, but
       does NOT hold the 100% keyframe's `transform` after it finishes.
       That matters beyond just this animation — any element with a
       non-"none" computed transform becomes a new containing block for
       position:fixed descendants, so a lingering transform: translateY(0)
       here was silently confining every fixed-position modal opened from
       inside a .pc-db-box (both the used-cars and rental-cars edit
       modals) to this card's own clipped (overflow:hidden) box instead of
       the real viewport — the actual cause of the modal-cropping bug
       reported across many previous rounds. */
    animation: pcCardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s backwards;
}
.pc-db-box-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--g-border);
    display: flex; justify-content: space-between; align-items: center;
    background: #fafafa;
    flex-wrap: wrap; gap: 12px;
}
.pc-db-box-head h3 {
    font-family: 'Saira', sans-serif;
    font-size: 18px; font-weight: 800; color: var(--g-text);
    margin: 0; display: flex; align-items: center; gap: 10px;
}
.pc-db-box-head h3 i { color: var(--g-primary); }

/* ─── NOTIFICATIONS LIST ─── */
.pc-notif-list { display: flex; flex-direction: column; }
.pc-notif-item {
    padding: 20px 24px;
    border-bottom: 1px solid var(--g-border);
    display: flex; gap: 16px; align-items: flex-start;
    transition: background .2s;
}
.pc-notif-item:last-child { border-bottom: none; }
.pc-notif-item:hover { background: #f9fafb; }
.pc-notif-item.unread { background: #f0fdf4; border-left: 4px solid var(--g-primary); padding-left: 20px; }

.pc-notif-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: #e5e7eb; color: #6b7280;
    display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.pc-notif-item.unread .pc-notif-icon { background: #d1fae5; color: #059669; }

.pc-notif-content { 
    flex: 1; 
    min-width: 0; /* Forces Flexbox to allow text wrapping */
}
.pc-notif-title { 
    font-size: 15px; font-weight: 700; color: var(--g-text); 
    margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; 
    white-space: normal; overflow-wrap: break-word; word-break: break-word;
}
.pc-notif-msg { 
    font-size: 13px; color: #4b5563; line-height: 1.6; margin-bottom: 8px; 
    white-space: normal; overflow-wrap: break-word; word-break: break-word;
}
.pc-notif-time { font-size: 11px; color: #9ca3af; font-weight: 500; display: flex; align-items: center; gap: 4px; }

.pc-notif-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ─── BADGES ─── */
.pc-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.pc-badge.green  { background: #d1fae5; color: #065f46; }
.pc-badge.amber  { background: #fef3c7; color: #92400e; }
.pc-badge.red    { background: #fee2e2; color: #991b1b; }

/* ─── BUTTONS ─── */
.pc-db-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 700;
    cursor: pointer; border: none; text-decoration: none !important;
    transition: all .2s; font-family: 'Roboto', sans-serif; white-space: nowrap;
}
.pc-db-btn.primary { background: var(--g-primary); color: #fff !important; }
.pc-db-btn.primary:hover { background: var(--g-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(1,107,97,.2); }
.pc-db-btn.outline { background: transparent; color: var(--g-primary) !important; border: 2px solid var(--g-primary); }
.pc-db-btn.outline:hover { background: #f0fdf4; }
.pc-db-btn.sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }

/* ─── ALERTS ─── */
.pc-db-alert {
    padding: 16px 20px; border-radius: 12px; font-size: 14px;
    display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,.02); flex-wrap: wrap;
}
.pc-db-alert.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.pc-db-alert i { font-size: 20px; }

/* ─── EMPTY STATE ─── */
.pc-db-empty { text-align: center; padding: 60px 20px; color: var(--g-muted); }
.pc-db-empty > i { font-size: 48px; color: #e5e7eb; display: block; margin-bottom: 16px; }
.pc-db-empty p { font-size: 15px; margin: 0; font-weight: 500; }

/* ==========================================================================
   MOBILE RESPONSIVE (App-like UI)
   ========================================================================== */
@media (max-width: 1200px) {
    .pc-db-cards.pc-db-cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 900px) {
    .pc-db-cards.pc-db-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
    .pc-db.pc-db {
        padding: 16px 12px 60px 12px;
        overflow-x: hidden;
    }
    
    .pc-db .pc-db-inner {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        box-sizing: border-box;
    }
    
    .pc-db .pc-db-sidebar {
        position: relative;
        top: 0;
        padding: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,.04);
        margin-bottom: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .pc-db-user-card {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 16px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    .pc-db-user-card img { width: 56px; height: 56px; margin: 0; border-width: 2px; }
    .pc-db-user-name { font-size: 16px; margin-bottom: 0; }
    
    
   
    /* FIX: Scrollable Navigation Tabs */
    .pc-db-nav {
        display: flex;
        flex-wrap: nowrap; /* Forces items into a single line */
        overflow-x: auto;  /* Enables horizontal scrolling */
        gap: 10px;
        padding-bottom: 8px; /* Room for touch target */
        -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
        width: 100%;
        scrollbar-width: thin !important;
        scrollbar-color: var(--g-primary) #f3f4f6 !important;
    }
    .pc-db-nav::-webkit-scrollbar {
        display: block !important;
        height: 4px !important;
    }
    .pc-db-nav::-webkit-scrollbar-track {
        background: #f3f4f6 !important;
        border-radius: 10px !important;
    }
    .pc-db-nav::-webkit-scrollbar-thumb {
        background: var(--g-primary) !important;
        border-radius: 10px !important;
    }
    
    .pc-db-nav-link {
        flex-shrink: 0; /* CRITICAL: Prevents tabs from squishing */
        flex-direction: row;
        white-space: nowrap; /* Prevents text wrapping inside tabs */
        padding: 10px 18px;
        border-radius: 30px; 
        background: #f9fafb !important;
        border: 1px solid var(--g-border);
        margin-bottom: 0;
        font-size: 13px !important;
    }
    .pc-db-nav-link:hover i { transform: none; }
    .pc-db-nav-link.active { background: var(--g-primary) !important; border-color: var(--g-primary); color: #fff !important; }
    .pc-db-nav-link.active i { color: #fff !important; }
    
    .pc-db-logout {
        margin-top: 0 !important;
        border-top: 1px solid #fecaca !important;
        padding-top: 10px !important;
        background: #fef2f2 !important;
        border-radius: 30px !important;
    }
    
    .pc-db.pc-db .pc-db-inner .pc-db-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .pc-db .pc-db-box, .pc-db .pc-modern-box {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Responsive Tables styling and layouts */
    .pc-db .pc-table-responsive, .pc-db .pc-table-wrap {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .pc-db .pc-db-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0 !important;
    }
    .pc-db .pc-db-table th {
        background: #fafafa !important;
        color: var(--g-muted) !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        font-size: 11px !important;
        letter-spacing: 0.5px !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid var(--g-border) !important;
        text-align: left !important;
        white-space: nowrap !important;
    }
    .pc-db .pc-db-table td {
        padding: 12px 16px !important;
        border-bottom: 1px solid var(--g-border) !important;
        color: var(--g-text) !important;
        font-size: 13px !important;
        vertical-align: middle !important;
        background: #fff !important;
        white-space: nowrap !important;
    }
    .pc-db .pc-db-table tr:last-child td {
        border-bottom: none !important;
    }
    
    /* Mobile Notifs */
    .pc-notif-item { 
        padding: 16px; 
        flex-direction: column; 
        gap: 12px; 
    }
    .pc-notif-item.unread { padding-left: 16px; border-left-width: 4px; }
    .pc-notif-icon { width: 32px; height: 32px; font-size: 14px; }
    .pc-db-box-head { padding: 16px; }
}

@media (max-width: 600px) {
    .pc-db-cards.pc-db-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .pc-db-card.pc-db-card { padding: 10px 12px !important; gap: 8px !important; }
    .pc-db-card-icon-wrap.pc-db-card-icon-wrap { width: 32px !important; height: 32px !important; font-size: 14px !important; }
    .pc-db-card-value.pc-db-card-value { font-size: 18px !important; }
    .pc-db-page-title { font-size: 26px; }
    
    .pc-notif-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .pc-notif-actions .pc-db-btn { width: 100%; justify-content: center; }
    .pc-db-box-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pc-db-box-head .pc-db-btn { width: 100%; justify-content: center; }
}

/* ─── CHAT SYSTEM ─── */
.pc-chat-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--g-white);
    border: 1px solid var(--g-border);
    border-radius: 12px;
    height: 600px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.02);
}

.pc-chat-sidebar {
    border-right: 1px solid var(--g-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.pc-chat-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--g-border);
}

.pc-chat-sidebar-header h2 {
    font-family: 'Saira', sans-serif;
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: var(--g-text);
}

.pc-chat-filters {
    display: flex;
    gap: 8px;
}

.pc-chat-filter-btn {
    border: 1px solid var(--g-border);
    background: #fff;
    color: var(--g-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.pc-chat-filter-btn.active {
    background: #f0fdf4;
    border-color: var(--g-primary);
    color: var(--g-primary);
}

.pc-chat-list {
    flex: 1;
    overflow-y: auto;
}

.pc-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.pc-chat-item:hover {
    background: #f8fafc;
}

.pc-chat-item.active {
    background: #f1f5f9 !important;
    border-left: 4px solid #64748b;
    padding-left: 16px;
}

.pc-chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.pc-chat-avatar-wrap img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.pc-chat-item-info {
    flex: 1;
    min-width: 0;
}

.pc-chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.pc-chat-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--g-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-chat-item-date {
    font-size: 11px;
    color: var(--g-muted);
}

.pc-chat-item-ad {
    font-size: 12px;
    color: var(--g-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.pc-chat-item-msg {
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-chat-item.unread .pc-chat-item-msg {
    font-weight: 600;
    color: var(--g-text);
}

.pc-chat-item-badge {
    position: absolute;
    right: 20px;
    bottom: 14px;
    background: var(--g-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Main (Right Side) */
.pc-chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f8fafc;
}

.pc-chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--g-muted);
}

.pc-chat-empty-icon {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.pc-chat-empty-state h3 {
    font-family: 'Saira', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--g-text);
    margin: 0 0 8px 0;
}

.pc-chat-empty-state p {
    font-size: 13px;
    margin: 0;
}

.pc-chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.pc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--g-border);
    background: #fff;
}

.pc-chat-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pc-chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.pc-chat-header-user h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--g-text);
}

.pc-chat-header-user span {
    font-size: 11px;
    color: var(--g-primary);
    font-weight: 500;
}

.pc-chat-ad-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--g-border);
    padding: 6px 12px;
    border-radius: 8px;
    max-width: 320px;
}

.pc-chat-ad-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

.pc-chat-ad-info {
    min-width: 0;
    flex: 1;
}

.pc-chat-ad-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--g-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-chat-ad-price {
    font-size: 11px;
    font-weight: 600;
    color: var(--g-primary);
}

.pc-chat-view-ad-btn {
    font-size: 11px;
    font-weight: 700;
    color: #fff !important;
    background: var(--g-primary);
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none !important;
    white-space: nowrap;
}

.pc-chat-view-ad-btn:hover {
    background: var(--g-primary-hover);
}

.pc-chat-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pc-chat-msg-row {
    display: flex;
    width: 100%;
}

.pc-chat-msg-row.sent {
    justify-content: flex-end;
}

.pc-chat-msg-row.received {
    justify-content: flex-start;
}

.pc-chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    word-break: break-word;
}

.pc-chat-msg-row.sent .pc-chat-bubble {
    background: #dcfce7;
    color: #14532d;
    border-top-right-radius: 0;
}

.pc-chat-msg-row.received .pc-chat-bubble {
    background: #ffffff;
    color: var(--g-text);
    border-top-left-radius: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.pc-chat-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 9px;
    color: var(--g-muted);
    margin-top: 4px;
}

.pc-chat-msg-row.sent .pc-chat-msg-meta {
    color: #166534;
}

/* Quick Options Section */
.pc-chat-quick-options {
    background: #fff;
    border-top: 1px solid var(--g-border);
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-chat-quick-section {
    display: flex;
    flex-direction: column;
}

.pc-chat-quick-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--g-muted);
    cursor: pointer;
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pc-chat-quick-items {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.pc-chat-quick-items::-webkit-scrollbar {
    display: none;
}

.pc-chat-quick-pill {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: var(--g-text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.pc-chat-quick-pill:hover {
    background: var(--g-primary) !important;
    color: #fff !important;
    border-color: var(--g-primary) !important;
}

/* Chat Footer / Input Form */
.pc-chat-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--g-border);
    background: #fff;
}

.pc-chat-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--g-border);
    border-radius: 24px;
    padding: 4px 6px 4px 14px;
}

.pc-chat-attachment-btn {
    font-size: 18px;
    color: var(--g-muted);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.pc-chat-attachment-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: -10px;
    background: #fff;
    border: 1px solid var(--g-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

.pc-chat-attachment-menu.open {
    display: block;
}

.pc-chat-attachment-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--g-text);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.pc-chat-attachment-menu button:hover {
    background: #f3f4f6;
}

#pcChatMessageInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 13px;
    color: var(--g-text);
}

.pc-chat-send-btn {
    background: var(--g-primary);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

.pc-chat-send-btn:hover {
    background: var(--g-primary-hover);
}

.pc-chat-file-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-chat-file-preview {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

.pc-chat-location-msg {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pc-chat-location-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--g-primary);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Specificity boosters for Quick Options, Back Button, and Attachment menus to override reset.css */
.pc-db .pc-chat-quick-toggle.pc-chat-quick-toggle {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--g-muted) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 6px 0 !important;
    cursor: pointer !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#quickQuestionsSec button.pc-chat-quick-toggle,
#quickQuestionsSec button.pc-chat-quick-toggle *,
#quickOffersSec button.pc-chat-quick-toggle,
#quickOffersSec button.pc-chat-quick-toggle * {
    color: var(--g-muted) !important;
    background: transparent !important;
    background-color: transparent !important;
}

#quickQuestionsSec button.pc-chat-quick-toggle:hover,
#quickQuestionsSec button.pc-chat-quick-toggle:hover *,
#quickQuestionsSec button.pc-chat-quick-toggle:focus,
#quickQuestionsSec button.pc-chat-quick-toggle:focus *,
#quickOffersSec button.pc-chat-quick-toggle:hover,
#quickOffersSec button.pc-chat-quick-toggle:hover *,
#quickOffersSec button.pc-chat-quick-toggle:focus,
#quickOffersSec button.pc-chat-quick-toggle:focus * {
    color: #016b61 !important;
    background: transparent !important;
    background-color: transparent !important;
}

.pc-db .pc-chat-attachment-menu button {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: var(--g-text) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.pc-db .pc-chat-attachment-menu button:hover {
    background: #f3f4f6 !important;
    background-color: #f3f4f6 !important;
    color: var(--g-primary) !important;
}

.pc-db button.pc-chat-window-back-btn.pc-chat-window-back-btn {
    display: none !important;
    background: #f3f4f6 !important;
    border: 1px solid var(--g-border) !important;
    border-radius: 8px !important;
    width: 32px !important;
    height: 32px !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--g-muted) !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin-right: 8px !important;
    transition: all 0.2s ease !important;
}

.pc-db button.pc-chat-window-back-btn.pc-chat-window-back-btn:hover {
    background: #e5e7eb !important;
    color: var(--g-text) !important;
}

/* Mobile Responsiveness for Chat */
@media (max-width: 768px) {
    .pc-chat-container {
        grid-template-columns: 1fr;
        height: 600px !important;
    }
    
    .pc-chat-sidebar {
        display: flex;
    }
    
    .pc-chat-sidebar.chat-active {
        display: none;
    }
    
    .pc-chat-main {
        display: none;
    }
    
    .pc-chat-main.chat-active {
        display: flex;
    }
    
    .pc-db button.pc-chat-window-back-btn.pc-chat-window-back-btn {
        display: inline-flex !important;
    }
    
    .pc-chat-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 8px 12px !important;
    }
    
    .pc-chat-header-user {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .pc-chat-ad-preview {
        max-width: 100% !important;
        width: 100% !important;
        justify-content: space-between !important;
        background: #f8fafc !important;
        border: 1px solid var(--g-border) !important;
        padding: 6px 10px !important;
    }
    
    .pc-chat-body {
        padding: 12px !important;
    }
}