/* ═══════════════════════════════════════════════
   P2P TRADING ADDON — STYLES
   ═══════════════════════════════════════════════ */

/* Layout */
.p2p-wrap { padding: 0 0 40px; }
.p2p-page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}

/* Buttons */
.p2p-btn-outline {
    border: 1px solid rgba(148,163,184,0.3); color: #94a3b8;
    background: transparent; border-radius: 8px;
    transition: all .2s;
}
.p2p-btn-outline:hover { border-color: var(--site-color); color: var(--site-color); background: rgba(99,102,241,.08); }

/* Inputs / Selects / Textareas */
.p2p-input, .p2p-select, .p2p-textarea {
    background: #1e293b; border: 1px solid rgba(148,163,184,0.2);
    color: #e2e8f0; border-radius: 8px; padding: 10px 14px;
    font-size: 0.875rem; outline: none; transition: border-color .2s;
}
.p2p-input:focus, .p2p-select:focus, .p2p-textarea:focus {
    border-color: var(--site-color); box-shadow: none;
}
.p2p-select { appearance: none; cursor: pointer; }
.p2p-textarea { resize: vertical; min-height: 80px; }
.p2p-error { color: #f87171; font-size: 0.78rem; margin-top: 4px; }
.p2p-filter-label { font-size: 0.8rem; color: #94a3b8; margin-bottom: 6px; display: block; font-weight: 500; }

/* Tabs */
.p2p-type-tabs { display: flex; gap: 0; border-bottom: 1px solid rgba(148,163,184,0.15); margin-bottom: 20px; }
.p2p-type-tab {
    padding: 10px 24px; font-size: 0.9rem; font-weight: 600; color: #64748b;
    cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s;
    background: none; border-top: none; border-left: none; border-right: none;
}
.p2p-type-tab.active { color: var(--site-color); border-bottom-color: var(--site-color); }
.p2p-type-tab:hover:not(.active) { color: #94a3b8; }

/* Filters bar */
.p2p-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.p2p-filter-group { display: flex; flex-direction: column; }

/* Ad list */
.p2p-ad-list { background: #0f172a; border-radius: 12px; overflow: hidden; border: 1px solid rgba(148,163,184,0.1); }
.p2p-ad-header {
    display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.5fr 1.2fr 120px;
    padding: 10px 16px; background: #1e293b; font-size: 0.75rem;
    color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.p2p-ad-row {
    display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.5fr 1.2fr 120px;
    padding: 14px 16px; border-top: 1px solid rgba(148,163,184,0.08);
    align-items: center; transition: background .15s;
}
.p2p-ad-row:hover { background: rgba(255,255,255,.02); }
.p2p-ad-cell { font-size: 0.875rem; }

/* Trader info */
.p2p-trader { display: flex; align-items: center; gap: 10px; }
.p2p-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--site-color,#6366f1), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: #fff; flex-shrink: 0;
}
.p2p-price { font-size: 1.05rem; font-weight: 700; color: #10b981; }
.p2p-price--sell { color: #f87171; }
.p2p-method-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.72rem; background: rgba(148,163,184,0.1); color: #94a3b8;
    border: 1px solid rgba(148,163,184,0.15); margin: 1px;
}

/* Order/Place buttons */
.p2p-order-btn {
    padding: 8px 18px; background: #10b981; color: #fff; border: none;
    border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
    transition: background .2s; white-space: nowrap;
}
.p2p-order-btn:hover { background: #059669; }
.p2p-sell-btn { background: #ef4444; }
.p2p-sell-btn:hover { background: #dc2626; }

/* Empty state */
.p2p-empty {
    text-align: center; padding: 48px 20px; color: #475569;
}
.p2p-empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.p2p-empty p { font-size: 0.9rem; margin-bottom: 0; }

/* Type radio (buy/sell toggle) */
.p2p-type-radio {
    display: flex; align-items: center; gap: 6px; padding: 10px 18px;
    border: 1.5px solid rgba(148,163,184,0.2); border-radius: 8px; cursor: pointer;
    font-size: 0.88rem; color: #94a3b8; transition: all .2s; user-select: none;
}
.p2p-type-radio input { display: none; }
.p2p-type-radio.active { border-color: #10b981; color: #10b981; background: rgba(16,185,129,.08); }
.p2p-type-radio.sell.active { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.08); }

/* Type badge */
.p2p-type-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 6px; font-size: 0.72rem;
    font-weight: 700; letter-spacing: .05em;
}
.p2p-type-badge.buy  { background: rgba(16,185,129,.15); color: #10b981; }
.p2p-type-badge.sell { background: rgba(239,68,68,.15);  color: #ef4444; }

/* Status badges */
.p2p-status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.p2p-status-badge.pending   { background: rgba(234,179,8,.15);   color: #eab308; }
.p2p-status-badge.paid      { background: rgba(59,130,246,.15);  color: #3b82f6; }
.p2p-status-badge.released  { background: rgba(139,92,246,.15);  color: #8b5cf6; }
.p2p-status-badge.completed { background: rgba(16,185,129,.15);  color: #10b981; }
.p2p-status-badge.cancelled { background: rgba(239,68,68,.15);   color: #ef4444; }
.p2p-status-badge.disputed  { background: rgba(251,146,60,.15);  color: #fb923c; }
.p2p-status-badge.active    { background: rgba(16,185,129,.15);  color: #10b981; }
.p2p-status-badge.paused    { background: rgba(148,163,184,.15); color: #94a3b8; }
.p2p-status-badge.suspended { background: rgba(239,68,68,.15);   color: #ef4444; }
.p2p-status-badge.open      { background: rgba(239,68,68,.15);   color: #ef4444; }
.p2p-status-badge.reviewing { background: rgba(234,179,8,.15);   color: #eab308; }
.p2p-status-badge.resolved  { background: rgba(16,185,129,.15);  color: #10b981; }

/* My Ads card */
.p2p-my-ad-card {
    background: #0f172a; border: 1px solid rgba(148,163,184,0.1);
    border-radius: 12px; padding: 16px 20px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.p2p-my-ad-left  { display: flex; align-items: center; gap: 14px; flex: 1 1 180px; }
.p2p-my-ad-mid   { flex: 1 1 130px; }
.p2p-my-ad-right { flex: 0 0 auto; text-align: right; }
.p2p-my-ad-pair  { font-size: 1rem; font-weight: 700; color: #fff; margin: 0; }
.p2p-my-ad-price { font-size: 0.82rem; color: #94a3b8; margin: 2px 0 0; }

/* Order cards */
.p2p-order-card-link { text-decoration: none; }
.p2p-order-card {
    background: #0f172a; border: 1px solid rgba(148,163,184,0.1);
    border-radius: 12px; padding: 16px 20px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    transition: border-color .2s;
}
.p2p-order-card:hover { border-color: rgba(99,102,241,.35); }
.p2p-order-left  { display: flex; align-items: center; gap: 12px; flex: 1 1 160px; }
.p2p-order-mid   { flex: 1 1 120px; }
.p2p-order-right { flex: 0 0 auto; text-align: right; }
.p2p-order-no    { font-size: 0.82rem; color: #94a3b8; margin: 0; }
.p2p-order-pair  { font-size: 0.75rem; color: #64748b; margin: 2px 0 0; }
.p2p-order-amount { font-size: 1rem; font-weight: 700; color: #fff; margin: 0; }

/* Order detail rows */
.p2p-detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(148,163,184,0.08); font-size: 0.875rem;
}
.p2p-detail-row span { color: #94a3b8; }
.p2p-detail-row strong { color: #e2e8f0; }
.p2p-detail-row:last-child { border-bottom: none; }

/* Countdown */
.p2p-countdown {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 14px; background: rgba(234,179,8,.1); border-radius: 8px;
    color: #eab308; font-size: 0.875rem; font-weight: 600;
}

/* Chat */
.p2p-chat-card { display: flex; flex-direction: column; height: 520px; }
.p2p-chat-body {
    flex: 1 1 auto; overflow-y: auto; padding: 16px;
    background: #070e1a; display: flex; flex-direction: column; gap: 6px;
}
.p2p-chat-system {
    text-align: center; margin: 8px 0;
}
.p2p-chat-system span {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    background: rgba(148,163,184,0.1); color: #64748b; font-size: 0.75rem;
}
.p2p-chat-msg { display: flex; flex-direction: column; max-width: 75%; }
.p2p-chat-msg.mine   { align-self: flex-end; align-items: flex-end; }
.p2p-chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.p2p-chat-bubble {
    padding: 10px 14px; border-radius: 12px; font-size: 0.875rem;
    word-break: break-word; line-height: 1.5;
}
.p2p-chat-msg.mine   .p2p-chat-bubble { background: var(--site-color,#6366f1); color: #fff; border-radius: 12px 12px 2px 12px; }
.p2p-chat-msg.theirs .p2p-chat-bubble { background: #1e293b; color: #e2e8f0; border-radius: 12px 12px 12px 2px; }
.p2p-chat-img { max-width: 200px; border-radius: 8px; cursor: pointer; }
.p2p-chat-meta { font-size: 0.7rem; color: #475569; margin-top: 4px; display: flex; gap: 8px; }
.p2p-chat-input { padding: 12px 16px; border-top: 1px solid rgba(148,163,184,0.1); background: #0f172a; }
.p2p-upload-btn {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    background: #1e293b; border-radius: 8px; color: #94a3b8; cursor: pointer;
    transition: all .2s; flex-shrink: 0;
}
.p2p-upload-btn:hover { background: #334155; color: var(--site-color,#6366f1); }

/* Payment methods */
.p2p-pm-row {
    display: flex; align-items: center; gap: 14px; padding: 14px 20px;
    border-bottom: 1px solid rgba(148,163,184,0.08);
}
.p2p-pm-row:last-child { border-bottom: none; }
.p2p-pm-icon {
    width: 40px; height: 40px; background: rgba(99,102,241,.1);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: var(--site-color,#6366f1); font-size: 1.1rem; flex-shrink: 0;
}

/* Method grid checkboxes */
.p2p-method-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.p2p-method-check {
    display: flex; align-items: center; gap: 6px; padding: 8px 14px;
    border: 1.5px solid rgba(148,163,184,0.2); border-radius: 8px; cursor: pointer;
    font-size: 0.83rem; color: #94a3b8; transition: all .2s; user-select: none;
}
.p2p-method-check input { display: none; }
.p2p-method-check.checked { border-color: var(--site-color,#6366f1); color: var(--site-color,#6366f1); background: rgba(99,102,241,.08); }

/* Modal */
.p2p-modal .modal-content { background: #0f172a; border: 1px solid rgba(148,163,184,0.15); border-radius: 14px; }
.p2p-modal .modal-header { border-bottom: 1px solid rgba(148,163,184,0.1); }
.p2p-modal .modal-footer { border-top: 1px solid rgba(148,163,184,0.1); }

/* Evidence thumbs */
.p2p-evidence-thumb { display: block; text-align: center; text-decoration: none; color: #94a3b8; }
.p2p-evidence-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(148,163,184,0.2); }

/* Dispute note */
.p2p-dispute-note {
    background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2);
    border-radius: 8px; padding: 10px 14px;
}

/* Admin stat cards */
.p2p-stat-card { background: #1e293b; border: none; border-radius: 12px; }
.p2p-stat-label { font-size: 0.78rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.p2p-stat-val { font-size: 1.5rem; font-weight: 700; color: #e2e8f0; margin-bottom: 4px; }
.p2p-stat-sub { font-size: 0.78rem; color: #64748b; margin: 0; }

/* Responsive */
@media (max-width: 991px) {
    .p2p-ad-header { display: none; }
    .p2p-ad-row { grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 767px) {
    .p2p-my-ad-card { flex-direction: column; align-items: flex-start; }
    .p2p-my-ad-right { text-align: left; }
    .p2p-order-card { flex-direction: column; align-items: flex-start; }
    .p2p-order-right { text-align: left; }
    .p2p-chat-card { height: 420px; }
}
@media (max-width: 575px) {
    .p2p-chat-msg { max-width: 90%; }
    .p2p-filters { flex-direction: column; }
    .p2p-filter-group { width: 100%; }
    .p2p-type-tabs { overflow-x: auto; }
}
