/**
 * nett-premium-content — Profile Page Styles
 * Shortcode: [npc_profile]
 *
 * Design: card-based, theme-independent, mobile-first, RTL-ready.
 */

/* ── Layout ──────────────────────────────────────────────────────── */
.npc-profile-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 0 40px;
    font-family: inherit;
    color: #1f2937;
    box-sizing: border-box;
}

/* ── Shared card base ────────────────────────────────────────────── */
.npc-profile-card,
.npc-quota-card,
.npc-history-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    box-sizing: border-box;
}

/* ── Profile Card ────────────────────────────────────────────────── */
.npc-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.npc-profile-avatar {
    flex-shrink: 0;
}

.npc-avatar-img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    display: block;
    border: 3px solid #f3f4f6;
    object-fit: cover;
}

.npc-profile-info {
    flex: 1;
    min-width: 0;
}

.npc-profile-name {
    margin: 0 0 4px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    border: none;
    background: none;
}

.npc-profile-name::before,
.npc-profile-name::after { display: none; content: none; }

.npc-profile-email {
    margin: 0 0 10px;
    padding: 0;
    font-size: 14px;
    color: #6b7280;
}

/* ── User type badge ─────────────────────────────────────────────── */
.npc-user-type-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
}

.npc-user-type-badge.npc-type-free,
.npc-col-badge.npc-type-free       { background: #6b7280; }
.npc-user-type-badge.npc-type-basic,
.npc-col-badge.npc-type-basic      { background: #3b82f6; }
.npc-user-type-badge.npc-type-premium,
.npc-col-badge.npc-type-premium    { background: #e7b733; color: #7c5100; }
.npc-user-type-badge.npc-type-vip,
.npc-col-badge.npc-type-vip        { background: #7c3aed; }

/* ── Section title ───────────────────────────────────────────────── */
.npc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    border: none;
    background: none;
}

.npc-section-title::before,
.npc-section-title::after { display: none; content: none; }

.npc-section-title svg { flex-shrink: 0; color: #6b7280; }

/* ── Quota Stats Grid ────────────────────────────────────────────── */
.npc-quota-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.npc-stat-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.npc-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 6px;
}

.npc-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.npc-stat-value strong { color: #e7b733; }

.npc-profile-unlimited {
    color: #7c3aed;
    font-weight: 700;
}

/* ── Quota Progress Bar ──────────────────────────────────────────── */
.npc-quota-bar-wrap {
    position: relative;
    background: #f3f4f6;
    border-radius: 99px;
    height: 12px;
    overflow: hidden;
}

.npc-quota-bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #e7b733, #f59e0b);
    transition: width .5s ease;
    min-width: 4px;
}

/* Low quota: red bar */
.npc-quota-bar[data-pct="0"],
.npc-quota-bar[data-pct="5"],
.npc-quota-bar[data-pct="10"],
.npc-quota-bar[data-pct="15"],
.npc-quota-bar[data-pct="20"] {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.npc-quota-bar-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #374151;
    line-height: 1;
    pointer-events: none;
}

/* ── History Card ────────────────────────────────────────────────── */
.npc-history-empty {
    color: #9ca3af;
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}

.npc-history-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.npc-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 480px;
}

.npc-history-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9ca3af;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.npc-history-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.npc-history-table tr:last-child td { border-bottom: none; }

.npc-history-table tr:hover td { background: #fafafa; }

.npc-history-table a {
    color: #2563eb;
    text-decoration: none;
}
.npc-history-table a:hover { text-decoration: underline; }

.npc-col-cost {
    font-weight: 700;
    color: #ef4444;
    white-space: nowrap;
    text-align: center;
}

.npc-col-date {
    white-space: nowrap;
    font-size: 13px;
    color: #9ca3af;
}

/* ── Resource type tags ──────────────────────────────────────────── */
.npc-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.npc-type-tag--post   { background: #dbeafe; color: #1d4ed8; }
.npc-type-tag--widget { background: #ede9fe; color: #5b21b6; }

/* ── Login prompt ────────────────────────────────────────────────── */
.npc-profile-login-prompt {
    text-align: center;
    padding: 48px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    max-width: 420px;
    margin: 0 auto;
}

.npc-login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #fef3c7;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.npc-profile-login-prompt h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    background: none;
    border: none;
    padding: 0;
}
.npc-profile-login-prompt h3::before,
.npc-profile-login-prompt h3::after { display: none; content: none; }

.npc-profile-login-prompt p {
    margin: 0 0 20px;
    color: #6b7280;
    font-size: 14px;
}

.npc-login-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: #e7b733;
    color: #fff !important;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: filter .18s ease, transform .15s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.npc-login-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    text-decoration: none;
}

/* ── RTL ─────────────────────────────────────────────────────────── */
[dir="rtl"] .npc-profile-card { flex-direction: row-reverse; }
[dir="rtl"] .npc-history-table th,
[dir="rtl"] .npc-history-table td { text-align: right; }
[dir="rtl"] .npc-quota-bar { margin-right: 0; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .npc-profile-card { flex-direction: column; align-items: flex-start; gap: 14px; }
    .npc-quota-stats  { grid-template-columns: repeat(2, 1fr); }
    .npc-stat-item:last-child { grid-column: span 2; }
    .npc-profile-card,
    .npc-quota-card,
    .npc-history-card { padding: 16px; border-radius: 12px; }
}
