/* ============================================================
   PLD Platform — Frontend & Admin Styles
   ============================================================ */

/* ---------- BADGES ---------- */
.pld-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.pld-badge.pending  { background: #fef3c7; color: #92400e; }
.pld-badge.success  { background: #d1fae5; color: #065f46; }
.pld-badge.danger   { background: #fee2e2; color: #991b1b; }
.pld-badge.muted    { background: #f3f4f6; color: #6b7280; }

/* ---------- ADMIN DASHBOARD ---------- */
.pld-admin .pld-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0;
}
.pld-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}
.pld-stat-icon { font-size: 32px; margin-bottom: 8px; }
.pld-stat-value { font-size: 22px; font-weight: 700; color: #111; }
.pld-stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }
.pld-admin-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}
.pld-admin-section h2 { margin-top: 0; }

/* ---------- TOPUP PAGE (Frontend) ---------- */
.pld-topup-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 900px) {
    .pld-topup-wrapper { grid-template-columns: 1fr; }
    .pld-admin .pld-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Amount selector */
.pld-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}
.pld-amount-btn {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    transition: all .2s;
    color: var(--pld-text, #1d2327);
}
.pld-amount-btn:hover,
.pld-amount-btn.selected {
    border-color: var(--pld-accent, #6366f1);
    background: var(--pld-accent, #6366f1);
    color: #fff;
}
.pld-amount-btn.popular {
    border-color: #f59e0b;
    position: relative;
}
.pld-amount-btn.popular::after {
    content: '⭐';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 14px;
}

/* Custom amount input */
.pld-custom-amount {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    align-items: center;
}
.pld-custom-amount input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
}
.pld-custom-amount input:focus {
    border-color: var(--pld-accent, #6366f1);
    outline: none;
}
.pld-confirm-btn {
    padding: 10px 24px;
    background: var(--pld-accent, #6366f1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.pld-confirm-btn:hover { opacity: .85; }
.pld-confirm-btn:disabled { opacity: .5; cursor: not-allowed; }

/* QR Modal */
.pld-qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.pld-qr-modal.open { display: flex; }
.pld-qr-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: pldSlideUp .25s ease;
}
@keyframes pldSlideUp {
    from { opacity:0; transform: translateY(20px); }
    to   { opacity:1; transform: translateY(0); }
}
.pld-qr-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 22px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    background: none;
    border: none;
}
.pld-qr-image {
    width: 240px;
    height: 240px;
    border-radius: 8px;
    border: 3px solid #e5e7eb;
    margin: 12px auto;
    display: block;
}
.pld-qr-amount {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin: 8px 0;
}
.pld-qr-code {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 10px 16px;
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 8px 0;
    cursor: pointer;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pld-qr-code:hover { background: #e5e7eb; }
.pld-timer {
    font-size: 13px;
    color: #6b7280;
    margin: 8px 0 4px;
}
.pld-timer span { font-weight: 700; color: #111; }
.pld-status-bar {
    margin-top: 16px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.pld-status-bar.waiting { background: #fef3c7; color: #92400e; }
.pld-status-bar.success { background: #d1fae5; color: #065f46; }
.pld-status-bar.expired { background: #fee2e2; color: #991b1b; }

/* Wallet balance widget */
.pld-balance-widget {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    margin-bottom: 20px;
}
.pld-balance-label { font-size: 13px; opacity: .8; margin-bottom: 4px; }
.pld-balance-amount { font-size: 32px; font-weight: 700; }
.pld-balance-user { font-size: 13px; opacity: .7; margin-top: 6px; }

/* Transaction history */
.pld-txn-list { margin-top: 0; }
.pld-txn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.pld-txn-item:last-child { border-bottom: none; }
.pld-txn-type { font-size: 14px; font-weight: 600; }
.pld-txn-note { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.pld-txn-amount { font-size: 15px; font-weight: 700; }
.pld-txn-amount.credit { color: #059669; }
.pld-txn-amount.debit  { color: #dc2626; }

/* Membership cards */
.pld-membership-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 24px 0;
}
@media (max-width: 900px) {
    .pld-membership-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .pld-membership-grid { grid-template-columns: 1fr; }
}
.pld-plan-card {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    position: relative;
    background: #fff;
    transition: transform .2s, box-shadow .2s;
}
.pld-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.pld-plan-card.featured {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.pld-plan-card.featured::before {
    content: 'Phổ biến nhất';
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.pld-plan-icon { font-size: 40px; margin-bottom: 8px; }
.pld-plan-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pld-plan-price { font-size: 26px; font-weight: 800; }
.pld-plan-period { font-size: 13px; color: #6b7280; }
.pld-plan-btn {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid currentColor;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}

/* ============================================================
   MEMBERSHIP PAGE — DARK THEME
   ============================================================ */

/* Current membership banner */
.pld-current-membership {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, rgba(1,86,255,0.12) 0%, rgba(91,240,241,0.08) 100%);
    border: 1px solid rgba(1,86,255,0.3);
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.pld-cm-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.pld-cm-icon {
    font-size: 36px;
    line-height: 1;
}
.pld-cm-title {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
.pld-cm-plan {
    font-size: 20px;
    font-weight: 800;
}
.pld-cm-right {
    text-align: right;
}
.pld-cm-expires {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 6px;
}
.pld-cm-status-badge {
    display: inline-block;
    background: rgba(5,150,105,0.15);
    color: #34d399;
    border: 1px solid rgba(52,211,153,0.3);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Billing toggle */
.pld-billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 36px;
}
.pld-billing-label {
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    transition: color .2s;
}
.pld-billing-label.active { color: #f9fafb; }
.pld-save-badge {
    display: inline-block;
    background: linear-gradient(135deg, #059669, #34d399);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 4px;
    vertical-align: middle;
}
.pld-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}
.pld-toggle-switch input { opacity: 0; width: 0; height: 0; }
.pld-toggle-track {
    position: absolute;
    inset: 0;
    background: #374151;
    border-radius: 13px;
    transition: background .3s;
}
.pld-toggle-track::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform .3s;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.pld-toggle-switch input:checked + .pld-toggle-track {
    background: linear-gradient(135deg, #0156FF, #5BF0F1);
}
.pld-toggle-switch input:checked + .pld-toggle-track::before {
    transform: translateX(22px);
}

/* Plan cards grid */
.pld-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 1024px) { .pld-plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .pld-plans-grid { grid-template-columns: 1fr; } }

/* Dark plan card */
.pld-plan-card-dark {
    background: #111827;
    border: 1.5px solid #1f2937;
    border-radius: 20px;
    padding: 28px 22px 24px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.pld-plan-card-dark:hover {
    transform: translateY(-6px);
    border-color: var(--plan-color, #0156FF);
    box-shadow: 0 16px 48px rgba(1,86,255,0.18);
}
.pld-plan-card-dark.pld-plan-featured {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}
.pld-plan-card-dark.pld-plan-current {
    border-color: #34d399;
    background: linear-gradient(160deg, #111827 0%, #0a1a14 100%);
}

/* Featured / Current badges */
.pld-plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #ef7c10);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.pld-plan-current-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #059669, #34d399);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Card content */
.pld-pcd-icon {
    font-size: 48px;
    margin-bottom: 10px;
    line-height: 1;
}
.pld-pcd-name {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}
.pld-pcd-desc {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 18px;
    line-height: 1.5;
}
.pld-pcd-price-wrap {
    margin-bottom: 20px;
    min-height: 60px;
}
.pld-pcd-price {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    line-height: 1;
}
.pld-pcd-amount {
    font-size: 30px;
    font-weight: 900;
    color: #f9fafb;
}
.pld-pcd-currency {
    font-size: 16px;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 4px;
}
.pld-pcd-period {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    margin-left: 2px;
}

/* Features list */
.pld-pcd-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
    flex: 1;
}
.pld-pcd-features li {
    font-size: 13px;
    color: #d1d5db;
    padding: 5px 0;
    border-bottom: 1px solid #1f2937;
    line-height: 1.4;
}
.pld-pcd-features li:last-child { border-bottom: none; }

/* CTA buttons */
.pld-pcd-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
    margin-top: auto;
}
.pld-pcd-btn--buy {
    background: rgba(255,255,255,0.08);
    color: #f9fafb;
    border: 1.5px solid rgba(255,255,255,0.15);
}
.pld-pcd-btn--buy:hover {
    background: var(--plan-color, #0156FF);
    border-color: var(--plan-color, #0156FF);
    color: #fff;
    box-shadow: 0 6px 20px rgba(1,86,255,0.35);
    transform: translateY(-2px);
}
.pld-pcd-btn--featured {
    background: linear-gradient(135deg, #f59e0b, #ef7c10);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.pld-pcd-btn--featured:hover {
    background: linear-gradient(135deg, #fbbf24, #ef7c10);
    box-shadow: 0 8px 28px rgba(245,158,11,0.45);
    transform: translateY(-2px);
}
.pld-pcd-btn--current {
    background: rgba(52,211,153,0.1);
    color: #34d399;
    border: 1.5px solid rgba(52,211,153,0.25);
    cursor: not-allowed;
}

/* Balance row */
.pld-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}
.pld-balance-row-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pld-balance-row-amount {
    font-size: 20px;
    font-weight: 800;
    color: #5BF0F1;
}

/* FAQ section */
.pld-membership-faq {
    margin-bottom: 40px;
}
.pld-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 680px) { .pld-faq-grid { grid-template-columns: 1fr; } }
.pld-faq-item {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 18px 20px;
}
.pld-faq-q {
    font-size: 14px;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 8px;
}
.pld-faq-a {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.6;
}

/* Membership confirm modal */
.pld-membership-confirm-box {
    color: #111827;
}
.pld-membership-confirm-box h3 {
    color: #111827;
}

/* Confirm details table */
.pld-confirm-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}
.pld-confirm-detail-row:last-child { border-bottom: none; }
.pld-confirm-detail-label { color: #6b7280; }
.pld-confirm-detail-value { font-weight: 700; color: #111827; }

/* ============================================================
   USER DASHBOARD PAGE
   ============================================================ */

/* Dashboard 2-column grid */
.pld-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .pld-dashboard-grid { grid-template-columns: 1fr; }
    .pld-dashboard-sidebar { order: -1; }
}

/* Generic dashboard card */
.pld-dash-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 20px 24px;
}
.pld-dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1f2937;
}
.pld-dash-card-header h3 {
    font-size: 15px;
    margin: 0;
}

/* Stat row (3 stats) */
.pld-dash-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 640px) {
    .pld-dash-stat-row { grid-template-columns: 1fr; }
}
.pld-dash-stat {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.pld-dash-stat--wallet   { border-top: 3px solid #0156FF; }
.pld-dash-stat--membership { border-top: 3px solid #f59e0b; }
.pld-dash-stat--expires  { border-top: 3px solid #34d399; }
.pld-ds-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 4px;
}
.pld-ds-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pld-ds-value {
    font-size: 18px;
    font-weight: 800;
    color: #f9fafb;
    line-height: 1.2;
}
.pld-ds-action {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0156FF;
    text-decoration: none;
    transition: color .2s;
}
.pld-ds-action:hover { color: #5BF0F1; }

/* Quick links sidebar */
.pld-quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #d1d5db;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
}
.pld-quick-link:hover {
    background: rgba(1,86,255,0.1);
    border-color: rgba(1,86,255,0.3);
    color: #f9fafb;
}
.pld-quick-link--danger:hover {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.3);
    color: #fca5a5;
}
