/**
 * ============================================================================
 * Portal Cloud 9 - Phone Contacts Styles
 * ============================================================================
 *
 * Styles for the seller phone contact and call tracking feature including:
 * - Phone number display and reveal button
 * - Call tracking stats cards and counters
 * - Top products and top sellers leaderboards
 * - Contact history table layout
 * - Message seller inline form
 * - Light and dark mode theme variables
 * - Mobile-responsive adjustments
 *
 * @package Portal_Cloud_9
 * @version 8.6.0
 * @author  Brian Agoi (Gradyzer)
 * @company Gradyzer
 * @license GPL-2.0+
 * ============================================================================
 */
/* ── Seller phone display shortcode widget ───────────────────────── */
.pc9-seller-phone-wrapper {
    margin: 20px 0;
    padding: 0;
}

/* ── Phone box card with icon and number ────────────────────────── */
.pc9-seller-phone-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.pc9-seller-phone-box:hover {
    border-color: rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(0, 0, 0, 0.08) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

/* ── Phone icon circle ──────────────────────────────────────────── */
.pc9-phone-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
}

/* ── Phone label and number text ────────────────────────────────── */
.pc9-phone-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc9-phone-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--p9-text-muted, #64748b);
}

.pc9-phone-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--p9-primary, #0ea5e9);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pc9-phone-number:hover {
    color: #0284c7;
    text-decoration: underline;
}

/* ── Login prompt for guests viewing phone ───────────────────────── */
.pc9-seller-phone-login {
    padding: 16px 20px;
    background: var(--p9-bg-muted, #f8fafc);
    border: 2px dashed var(--p9-border, #e2e8f0);
    border-radius: 12px;
    text-align: center;
}

.pc9-seller-phone-login p {
    margin: 0;
    color: var(--p9-text-muted, #64748b);
}

.pc9-seller-phone-login a {
    color: var(--p9-primary, #0ea5e9);
    text-decoration: none;
    font-weight: 600;
}

.pc9-seller-phone-login a:hover {
    text-decoration: underline;
}

/* ── Main phone contacts analytics tab wrapper ───────────────────── */
.pc9-phone-contacts-wrapper {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Summary statistics cards grid ──────────────────────────────── */
.pc9-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* ── Individual stat card ───────────────────────────────────────── */
.pc9-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--p9-card-bg, #fff);
    border: 1px solid var(--p9-border, #e2e8f0);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.pc9-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
}

/* ── Stat card icon ─────────────────────────────────────────────── */
.pc9-stat-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 24px;
    color: #fff;
}

.pc9-stat-total {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.pc9-stat-today {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.pc9-stat-week {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.pc9-stat-month {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.pc9-stat-users {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.pc9-stat-products {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.pc9-stat-content {
    flex: 1;
}

.pc9-stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--p9-text-muted, #64748b);
    margin-bottom: 4px;
}

.pc9-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--p9-text, #1e293b);
    line-height: 1;
}

.pc9-stat-animate {
    animation: pc9-countUp 0.6s ease-out;
}

/* ── Count-up animation for stat values ─────────────────────────── */
@keyframes pc9-countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Top products and top sellers leaderboards ───────────────────── */
.pc9-top-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* ── Individual leaderboard card ────────────────────────────────── */
.pc9-top-list-card {
    background: var(--p9-card-bg, #fff);
    border: 1px solid var(--p9-border, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
}

.pc9-top-list-card h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--p9-text, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc9-top-list-card h3 i {
    color: var(--p9-primary, #0ea5e9);
}

.pc9-top-list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Leaderboard item row ────────────────────────────────────────── */
.pc9-top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--p9-bg-muted, #f8fafc);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pc9-top-item:hover {
    background: rgba(14, 165, 233, 0.05);
    transform: translateX(4px);
}

/* ── Rank number badge ──────────────────────────────────────────── */
.pc9-top-rank {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 6px;
}

.pc9-top-item:nth-child(1) .pc9-top-rank {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.pc9-top-item:nth-child(2) .pc9-top-rank {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.pc9-top-item:nth-child(3) .pc9-top-rank {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

.pc9-top-info {
    flex: 1;
    min-width: 0;
}

.pc9-top-name {
    font-weight: 600;
    color: var(--p9-text, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc9-top-count {
    font-size: 13px;
    color: var(--p9-text-muted, #64748b);
}

/* ── Contact history filter bar ─────────────────────────────────── */
.pc9-contacts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--p9-card-bg, #fff);
    border: 1px solid var(--p9-border, #e2e8f0);
    border-radius: 12px;
}

.pc9-filter-group {
    flex: 1;
    min-width: 200px;
}

.pc9-search-input,
.pc9-filter-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--p9-border, #e2e8f0);
    border-radius: 999px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--p9-input-bg, #fff);
    color: var(--p9-text, #1e293b);
}



.pc9-search-input:focus,
.pc9-filter-input:focus {
    outline: none;
    border-color: var(--p9-primary, #0ea5e9);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ── Button components ──────────────────────────────────────────── */
.pc9-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.pc9-btn-primary {
    background: #1e90ff;
    color: #64748b !important;
    box-shadow: 0 2px 8px rgba(30, 144, 255, 0.3);
}

.pc9-btn-primary:hover {
    background: #0080ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.4);
}

.pc9-btn-secondary {
    background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.pc9-btn-secondary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #6b0f0f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.pc9-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}



.pc9-message-seller-btn {
    color: #64748b !important;
}


/* ── Contact history table ──────────────────────────────────────── */
.pc9-contacts-table-wrapper {
    background: var(--p9-card-bg, #fff);
    border: 1px solid var(--p9-border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.pc9-contacts-table {
    width: 100%;
    border-collapse: collapse;
}

.pc9-contacts-table thead {
    background: var(--p9-bg-muted, #f8fafc);
}

.pc9-contacts-table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--p9-text-muted, #64748b);
    border-bottom: 2px solid var(--p9-border, #e2e8f0);
}

.pc9-contacts-table td {
    padding: 16px;
    border-bottom: 1px solid var(--p9-border, #e2e8f0);
}

.pc9-contacts-table tbody tr {
    transition: background 0.2s ease;
}

.pc9-contacts-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.03);
}

.pc9-contact-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--p9-text-muted, #64748b);
}

.pc9-contact-date i {
    color: var(--p9-primary, #0ea5e9);
}

.pc9-contact-user,
.pc9-contact-seller,
.pc9-contact-product {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc9-contact-user strong,
.pc9-contact-seller strong {
    color: var(--p9-text, #1e293b);
    font-weight: 600;
}

.pc9-contact-user small,
.pc9-contact-seller small {
    font-size: 12px;
    color: var(--p9-text-muted, #64748b);
}

.pc9-contact-product a {
    color: var(--p9-primary, #0ea5e9);
    text-decoration: none;
    font-weight: 500;
}

.pc9-contact-product a:hover {
    text-decoration: underline;
}

.pc9-contact-phone {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc9-contact-phone i {
    color: var(--p9-primary, #0ea5e9);
}

.pc9-contact-phone a {
    color: var(--p9-text, #1e293b);
    text-decoration: none;
    font-weight: 600;
}

.pc9-contact-phone a:hover {
    color: var(--p9-primary, #0ea5e9);
}

.pc9-contact-actions {
    display: flex;
    gap: 8px;
}

/* ── Pagination controls ────────────────────────────────────────── */
.pc9-pagination {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.pc9-pagination-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc9-page-btn {
    min-width: 40px;
    padding: 10px 16px;
    border: 1px solid var(--p9-border, #e2e8f0);
    background: var(--p9-card-bg, #fff);
    color: var(--p9-text, #1e293b);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc9-page-btn:hover {
    border-color: var(--p9-primary, #0ea5e9);
    background: rgba(14, 165, 233, 0.05);
    color: var(--p9-primary, #0ea5e9);
}

.pc9-page-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border-color: transparent;
}

.pc9-page-ellipsis {
    padding: 10px 8px;
    color: var(--p9-text-muted, #64748b);
}

.pc9-page-numbers {
    display: flex;
    gap: 4px;
}

/* ── Contact detail and message modal ───────────────────────────── */
.pc9-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pc9-modal-content {
    background: var(--p9-card-bg, #fff);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto;
}

.pc9-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--p9-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pc9-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--p9-text, #1e293b);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pc9-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--p9-bg-muted, #f1f5f9);
    color: var(--p9-text, #1e293b);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc9-modal-close:hover {
    background: var(--p9-border, #e2e8f0);
    transform: rotate(90deg);
}

.pc9-modal-body {
    padding: 24px;
}

.pc9-modal-footer {
    padding: 24px;
    border-top: 1px solid var(--p9-border, #e2e8f0);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.pc9-modal-footer .pc9-btn-primary {
    color: #64748b !important;
}


.pc9-modal-footer .pc9-btn-secondary {
    color: #fff !important;
}

/* ── Message seller info box ────────────────────────────────────── */
.pc9-message-info {
    padding: 16px;
    background: var(--p9-bg-muted, #f8fafc);
    border-radius: 8px;
    margin-bottom: 24px;
}

.pc9-message-info p {
    margin: 8px 0;
    font-size: 14px;
}

/* ── Conversation thread inside modal ───────────────────────────── */
.pc9-conversation-wrapper {
    margin-bottom: 24px;
}

.pc9-conversation-wrapper h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--p9-text, #1e293b);
}

.pc9-conversation-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: var(--p9-bg-muted, #f8fafc);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pc9-message-item {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
}

.pc9-msg-sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.pc9-msg-received {
    align-self: flex-start;
    background: var(--p9-card-bg, #fff);
    border: 1px solid var(--p9-border, #e2e8f0);
    border-bottom-left-radius: 4px;
}

.pc9-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.pc9-msg-header strong {
    font-size: 13px;
    font-weight: 600;
}

.pc9-msg-time {
    font-size: 11px;
    opacity: 0.8;
}

.pc9-msg-body {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.pc9-msg-received .pc9-msg-body {
    color: var(--p9-text, #1e293b);
}

.pc9-no-messages,
.pc9-loading {
    text-align: center;
    padding: 32px 16px;
    color: var(--p9-text-muted, #64748b);
}

/* ── New message composer ───────────────────────────────────────── */
.pc9-new-message h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--p9-text, #1e293b);
}

.pc9-message-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--p9-border, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    background: var(--p9-input-bg, #fff);
    color: var(--p9-text, #1e293b);
}



.pc9-message-textarea:focus {
    outline: none;
    border-color: var(--p9-primary, #0ea5e9);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.pc9-stat-card,
.pc9-top-list-card,
.pc9-contacts-filters,
.pc9-contacts-table-wrapper,


.pc9-top-item,
.pc9-message-info,






/* ── Responsive: tablet ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .pc9-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pc9-top-lists {
        grid-template-columns: 1fr;
    }
    
    .pc9-contacts-table-wrapper {
        overflow-x: auto;
    }
    
    .pc9-contacts-table {
        min-width: 800px;
    }
    
    .pc9-contacts-filters {
        flex-direction: column;
    }
    
    .pc9-filter-group {
        min-width: 100%;
    }
}

/* ── Responsive: mobile phones ──────────────────────────────────── */
@media (max-width: 480px) {
    .pc9-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pc9-phone-contacts-wrapper {
        padding: 16px;
    }
}
/* ============================================
   PHONE CONTACTS TAB EXTRA STYLES
   ============================================ */
/* Loading Spinner */
.pc9-loader {
    border: 3px solid rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--p9-primary, #0ea5e9);
    width: 30px;
    height: 30px;
    animation: pc9-spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes pc9-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pc9-loading-row {
    text-align: center;
    padding: 40px 20px !important;
}

.pc9-loading-row span {
    color: var(--p9-text-muted, #64748b);
    font-size: 14px;
}

/* Empty State */
.pc9-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--p9-text-muted, #64748b);
}

.pc9-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.pc9-empty-state p {
    font-size: 16px;
    margin: 8px 0;
}

/* Utility classes (replaces inline styles) */
.p9-hint-text { font-size: 13px; color: var(--p9-text-muted, #64748b); margin-top: 12px; }
