/*
 * WP Marketplace Membership — Theme-Consistent Overrides
 * Plugin: wp-marketplace-membership
 *
 * The plugin renders the "Membership Overview" dashboard with wkmpms-*
 * markup but ships no matching stylesheet, so inside the My Account
 * content column the grid/flex containers collapse and the layout
 * distorts. These rules provide the missing layout and remap the
 * dashboard onto the parent theme's brand palette.
 *
 * Fully scoped to .wkmpms-dashboard-container — no bleed into the parent
 * theme or unrelated plugin templates. Sizing is by column width
 * (auto-fit grid) so the dashboard reflows to fit the account column.
 *
 * ── NamVendors brand palette ──────────────────────────────────────
 *   Brand Blue   #101f31  primary text · dark fills · progress · icons
 *   Brand Yellow #efa524  accent / CTA (Renew button)
 *   Dark Grey    #666c7a  muted / secondary text (labels, meta)
 *   Light Grey   #d3d6dc  borders · hairlines · dividers
 *   Success      #1c7c54  active status · used quota
 *   Surfaces     rgba(16,31,49,.04) — faint brand-Blue tint
 */

.wkmpms-dashboard-container {
    --wkmpms-blue: #101f31;
    --wkmpms-accent: #efa524;
    --wkmpms-muted: #666c7a;
    --wkmpms-border: #d3d6dc;
    --wkmpms-surface: rgba(16, 31, 49, 0.04);
    --wkmpms-radius: 14px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    color: var(--wkmpms-blue);
    font-size: 14px;
    line-height: 1.5;
}

.wkmpms-dashboard-container *,
.wkmpms-dashboard-container *::before,
.wkmpms-dashboard-container *::after {
    box-sizing: border-box;
}

/* ─── Header ───────────────────────────────────────────────────────
 * Scoped to the dashboard header only, so the theme's global h1/p
 * styles stay untouched and their inherited margins don't distort us.
 */
.wkmpms-dashboard-header {
    margin-bottom: 24px;
}

.wkmpms-dashboard-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.wkmpms-dashboard-header p {
    margin: 0;
    font-size: 14px;
    color: var(--wkmpms-muted);
}

/* ─── Layout ───────────────────────────────────────────────────────── */
.wkmpms-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.wkmpms-dashboard-row-middle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ─── Card ─────────────────────────────────────────────────────────── */
.wkmpms-card {
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevents grid/flex overflow inside narrow columns */
    background: #fff;
    border: 1px solid var(--wkmpms-border);
    border-radius: var(--wkmpms-radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(16, 31, 49, 0.06);
}

.wkmpms-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.wkmpms-card-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--wkmpms-surface);
    color: var(--wkmpms-blue);
}

.wkmpms-card-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.wkmpms-card-icon.status { background: rgba(28, 124, 84, 0.10); color: #1c7c54; }
.wkmpms-card-icon.expiry { background: rgba(239, 165, 36, 0.14); color: var(--wkmpms-accent); }

.wkmpms-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wkmpms-muted);
}

.wkmpms-card-title {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.wkmpms-card-desc {
    margin: 0 0 16px;
    color: var(--wkmpms-muted);
}

/* ─── Status badge ─────────────────────────────────────────────────── */
.wkmpms-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    background: var(--wkmpms-surface);
    color: var(--wkmpms-muted);
}

.wkmpms-badge-activate,
.wkmpms-badge-active { background: rgba(28, 124, 84, 0.12); color: #1c7c54; }
.wkmpms-badge-expired,
.wkmpms-badge-inactive { background: rgba(217, 46, 46, 0.12); color: #d92e2e; }

/* ─── Buttons ──────────────────────────────────────────────────────── */
.wkmpms-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.wkmpms-btn-primary {
    background: var(--wkmpms-accent);
    color: var(--wkmpms-blue);
}

.wkmpms-btn-primary:hover { opacity: 0.9; color: var(--wkmpms-blue); }

.wkmpms-btn-outline {
    background: #fff;
    color: var(--wkmpms-blue);
    border: 1px solid var(--wkmpms-blue);
}

.wkmpms-btn-outline:hover { background: var(--wkmpms-surface); color: var(--wkmpms-blue); }

.wkmpms-btn-text {
    color: var(--wkmpms-blue);
    font-weight: 600;
    text-decoration: none;
}

.wkmpms-btn-text:hover { text-decoration: underline; }

/* ─── Product Quota ────────────────────────────────────────────────── */
.wkmpms-quota-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
}

.wkmpms-quota-visual {
    position: relative;
    flex: 0 0 auto;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.wkmpms-quota-svg {
    transform: rotate(-90deg);
}

.wkmpms-quota-bg {
    fill: none;
    stroke: var(--wkmpms-surface);
    stroke-width: 14;
}

.wkmpms-quota-progress {
    fill: none;
    stroke: var(--wkmpms-blue);
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.wkmpms-quota-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wkmpms-quota-count {
    font-size: 26px;
    font-weight: 700;
}

.wkmpms-quota-sub {
    font-size: 12px;
    color: var(--wkmpms-muted);
}

.wkmpms-quota-info {
    flex: 1 1 220px;
    min-width: 0;
}

.wkmpms-quota-info h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.wkmpms-quota-status-text {
    margin-bottom: 4px;
}

.wkmpms-quota-bar-container {
    height: 8px;
    border-radius: 999px;
    background: var(--wkmpms-surface);
    overflow: hidden;
    margin-bottom: 16px;
}

.wkmpms-quota-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--wkmpms-blue);
    transition: width 0.6s ease;
}

.wkmpms-quota-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wkmpms-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.wkmpms-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ─── Expiry Timeline ──────────────────────────────────────────────── */
.wkmpms-timeline {
    position: relative;
    padding-left: 8px;
}

.wkmpms-timeline-item {
    position: relative;
    padding: 0 0 24px 26px;
    border-left: 2px solid var(--wkmpms-border);
}

.wkmpms-timeline-item:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.wkmpms-timeline-dot {
    position: absolute;
    left: -8px;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--wkmpms-border);
}

.wkmpms-timeline-item.active .wkmpms-timeline-dot {
    background: #1c7c54;
    border-color: #1c7c54;
}

.wkmpms-timeline-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2px;
}

.wkmpms-timeline-date {
    font-weight: 600;
}

.wkmpms-timeline-label {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* ─── Footer ───────────────────────────────────────────────────────── */
.wkmpms-dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    background: var(--wkmpms-surface);
    border: 1px solid var(--wkmpms-border);
    border-radius: var(--wkmpms-radius);
}

.wkmpms-footer-note {
    color: var(--wkmpms-muted);
    font-size: 13px;
}

/* ─── Responsive: narrow My Account column ─────────────────────────── */
@media (max-width: 640px) {
    .wkmpms-card { padding: 20px; }
    .wkmpms-quota-card { flex-direction: column; }
    .wkmpms-dashboard-footer { flex-direction: column; align-items: stretch; text-align: center; }
    .wkmpms-dashboard-footer .wkmpms-btn { width: 100%; }
}
