/* START TRADING POST STYLES */

/* ── Layout ───────────────────────────────────────────── */
.tp-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.tp-header {
    text-align: center;
    margin-bottom: 16px;
}

.tp-search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.tp-search-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 14px;
}

.tp-table-wrap {
    overflow-x: auto;
    max-width: 700px;
    margin: 0 auto;
}

/* ── Tables ───────────────────────────────────────────── */
.tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tp-table th {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.tp-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.tp-row {
    cursor: pointer;
    transition: background 0.15s;
}

.tp-row:hover {
    background: var(--bg-hover);
}

.tp-price {
    font-weight: 600;
    color: var(--primary);
}

.tp-vol {
    color: var(--text-muted);
    font-size: 12px;
}

.tp-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 16px;
}

/* ── Icons ────────────────────────────────────────────── */
.tp-item-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 6px;
    image-rendering: pixelated;
}

.tp-item-icon-lg {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

/* ── Item Page ────────────────────────────────────────── */
.tp-item-header {
    max-width: 700px;
    margin: 0 auto 16px;
}

.tp-item-title {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin: 12px 0;
}

.tp-guide-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.tp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 8px 14px;
    min-width: 80px;
}

.tp-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tp-stat-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
}

.tp-order-section {
    display: flex;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.tp-order-book {
    flex: 1 1 280px;
}

.tp-order-book h3 {
    margin: 12px 0 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tp-post-form {
    flex: 1 1 260px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
}

.tp-post-form h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

/* ── Buy/Sell Colors ──────────────────────────────────── */
.tp-buy-price {
    color: #4caf50 !important;
    font-weight: 600;
}

.tp-sell-price {
    color: #f44336 !important;
    font-weight: 600;
}

.tp-buy-label {
    background: #4caf5022;
    color: #4caf50;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
}

.tp-sell-label {
    background: #f4433622;
    color: #f44336;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
}

/* ── Order Form ───────────────────────────────────────── */
.tp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.tp-tab {
    flex: 1;
    padding: 6px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}

.tp-tab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-secondary);
}

.tp-form-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-form-fields label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.tp-input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text);
    font-size: 14px;
}

.tp-total {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 0;
}

/* ── My Listings ──────────────────────────────────────── */
.tp-listings-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.tp-listing-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-listing-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-listing-info {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
}

.tp-listing-stats {
    font-size: 13px;
    color: var(--text-muted);
}

.tp-collect-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 8px 10px;
}

/* ── Status Labels ────────────────────────────────────── */
.tp-status-active {
    color: #4caf50;
    font-size: 12px;
    font-weight: 600;
}

.tp-status-partial {
    color: #ff9800;
    font-size: 12px;
    font-weight: 600;
}

.tp-status-done {
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Trade Offers ─────────────────────────────────────── */
.tp-offers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.tp-offer-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tp-offer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.tp-offer-msg {
    font-style: italic;
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.tp-offer-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-section-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.tp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tp-item-pill {
    background: var(--bg-tertiary);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tp-pill-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

.tp-offer-actions {
    display: flex;
    gap: 8px;
}

.tp-offer-meta {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

/* ── Send Offer Modal ─────────────────────────────────── */
.tp-offer-section {
    margin-bottom: 16px;
}

.tp-offer-section h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text);
}

.tp-select-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.tp-select-item > span:first-of-type {
    flex: 1;
}

.tp-qty-input {
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 13px;
}

/* ── Player Profile ───────────────────────────────────── */
.tp-profile-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ── Badge ────────────────────────────────────────────── */
.tp-badge {
    display: inline-block;
    background: var(--danger, #f44336);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    margin-left: 4px;
    vertical-align: middle;
}

/* END TRADING POST STYLES */
