/**
 * JKPE — Portal-side styles
 * All selectors are scoped to .jkpe-* to avoid theme bleed.
 */

:root {
    --jkpe-blue-deep:    #1b3f8b;
    --jkpe-blue:         #2369b1;
    --jkpe-blue-accent:  #2da5de;
    --jkpe-active:       #27ae60;
    --jkpe-expiring:     #f39c12;
    --jkpe-critical:     #e74c3c;
    --jkpe-on-hold:      #9b59b6;
    --jkpe-pending:      #95a5a6;
    --jkpe-text:         #2c3e50;
    --jkpe-muted:        #5a6475;
    --jkpe-border:       #e1e7ef;
    --jkpe-bg-light:     #f5f8fc;
    --jkpe-radius:       10px;
    --jkpe-radius-sm:    6px;
    --jkpe-shadow:       0 2px 8px rgba(20, 50, 100, 0.06);
    --jkpe-shadow-hov:   0 4px 14px rgba(20, 50, 100, 0.12);
}

/* ══════════════════════════════════════════════════════
   COUNTDOWN WIDGET
══════════════════════════════════════════════════════ */
.jkpe-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 22px 18px;
    border-radius: var(--jkpe-radius);
    border: 1px solid var(--jkpe-border);
    background: #fff;
    box-shadow: var(--jkpe-shadow);
    text-align: center;
    line-height: 1.2;
    /* Defeat theme typography bleed */
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    color: var(--jkpe-text);
}
.jkpe-countdown-number {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    color: var(--jkpe-blue-deep);
    margin: 0;
}
.jkpe-countdown-label {
    font-size: 13px;
    color: var(--jkpe-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin: 0;
}
.jkpe-countdown-message {
    font-size: 18px;
    font-weight: 700;
    color: var(--jkpe-blue-deep);
    margin: 0;
}
.jkpe-countdown-date {
    font-size: 12px;
    color: var(--jkpe-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--jkpe-border);
    width: 100%;
    font-weight: 500;
}

/* Tier color overrides */
.jkpe-countdown.jkpe-tier-active {
    border-left: 4px solid var(--jkpe-active);
}
.jkpe-countdown.jkpe-tier-active .jkpe-countdown-number {
    color: var(--jkpe-active);
}
.jkpe-countdown.jkpe-tier-expiring {
    border-left: 4px solid var(--jkpe-expiring);
    background: #fff8ec;
}
.jkpe-countdown.jkpe-tier-expiring .jkpe-countdown-number {
    color: var(--jkpe-expiring);
}
.jkpe-countdown.jkpe-tier-critical {
    border-left: 4px solid var(--jkpe-critical);
    background: #fdecea;
}
.jkpe-countdown.jkpe-tier-critical .jkpe-countdown-number,
.jkpe-countdown.jkpe-tier-critical .jkpe-countdown-message {
    color: var(--jkpe-critical);
}
.jkpe-countdown.jkpe-tier-on_hold {
    border-left: 4px solid var(--jkpe-on-hold);
}
.jkpe-countdown.jkpe-tier-expired,
.jkpe-countdown.jkpe-tier-none {
    border-left: 4px solid var(--jkpe-pending);
    background: var(--jkpe-bg-light);
}
.jkpe-countdown.jkpe-empty-state {
    border-left: 4px solid var(--jkpe-pending);
}

/* ══════════════════════════════════════════════════════
   RENEW BUTTON

   v1.1.0: rendered as a plain <a> element with data-tier
   carrying the urgency tier. No wrapping <div> any more.
══════════════════════════════════════════════════════ */
.jkpe-renew-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--jkpe-radius-sm);
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    background: var(--jkpe-blue);
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    /* Defeat theme button bleed */
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(35, 105, 177, 0.25);
}
.jkpe-renew-btn:hover {
    background: var(--jkpe-blue-deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 105, 177, 0.35);
    color: #fff !important;
    text-decoration: none;
}
.jkpe-renew-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(35, 105, 177, 0.20);
}
.jkpe-renew-btn-empty {
    background: var(--jkpe-blue-accent);
}
.jkpe-renew-btn-empty:hover {
    background: var(--jkpe-blue);
}

/* Critical tier — give the button urgency. Uses the data-tier attribute
   that the shortcode now writes directly on the link element. */
.jkpe-renew-btn[data-tier="critical"] {
    background: var(--jkpe-critical);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.30);
}
.jkpe-renew-btn[data-tier="critical"]:hover {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.40);
}

/* ══════════════════════════════════════════════════════
   STATUS BADGE
══════════════════════════════════════════════════════ */
.jkpe-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    background: var(--jkpe-bg-light);
    color: var(--jkpe-muted);
    border: 1px solid var(--jkpe-border);
    /* Defeat theme bleed */
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.jkpe-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    display: inline-block;
}
.jkpe-badge-compact {
    padding: 3px 9px;
    font-size: 11px;
}
.jkpe-badge-active {
    background: rgba(39, 174, 96, 0.10);
    color: var(--jkpe-active);
    border-color: rgba(39, 174, 96, 0.25);
}
.jkpe-badge-expiring {
    background: rgba(243, 156, 18, 0.12);
    color: var(--jkpe-expiring);
    border-color: rgba(243, 156, 18, 0.30);
}
.jkpe-badge-critical {
    background: rgba(231, 76, 60, 0.12);
    color: var(--jkpe-critical);
    border-color: rgba(231, 76, 60, 0.30);
    animation: jkpePulse 2s ease-in-out infinite;
}
.jkpe-badge-on_hold {
    background: rgba(155, 89, 182, 0.10);
    color: var(--jkpe-on-hold);
    border-color: rgba(155, 89, 182, 0.25);
}
.jkpe-badge-pending,
.jkpe-badge-expired,
.jkpe-badge-none {
    background: var(--jkpe-bg-light);
    color: var(--jkpe-muted);
}
@keyframes jkpePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.3); }
    50%      { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* ══════════════════════════════════════════════════════
   RENEWAL STRIP (v1.2.0)
   Compact horizontal alternative to the stacked
   countdown+badge+button. Designed for the home page.
══════════════════════════════════════════════════════ */
.jkpe-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #f4f9f6;
    border: 1px solid #d0e6dc;
    border-left: 3px solid var(--jkpe-active);
    border-radius: 8px;
    padding: 12px 16px;
    /* Defeat theme bleed */
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    color: var(--jkpe-text);
    line-height: 1.4;
}

.jkpe-strip-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #d4f1e0;
    color: #0F6E56;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    line-height: 1;
}
.jkpe-strip-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.jkpe-strip-msg {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--jkpe-text);
}
.jkpe-strip-msg strong {
    color: #0F6E56;
    font-weight: 600;
}
.jkpe-strip-date {
    color: var(--jkpe-muted);
    font-size: 12px;
    font-weight: 400;
}

.jkpe-strip-btn {
    display: inline-flex;
    align-items: center;
    background: var(--jkpe-blue-deep);
    color: #fff !important;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease;
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
}
.jkpe-strip-btn:hover {
    background: var(--jkpe-blue);
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none;
}
.jkpe-strip-btn:active {
    transform: translateY(0);
}

/* ── Tier color shifts: quiet → loud as renewal approaches ── */
.jkpe-strip.jkpe-strip-tier-active {
    background: #f4f9f6;
    border-color: #d0e6dc;
    border-left-color: #0F6E56;
}
.jkpe-strip.jkpe-strip-tier-active .jkpe-strip-pill {
    background: #d4f1e0;
    color: #0F6E56;
}
.jkpe-strip.jkpe-strip-tier-active .jkpe-strip-msg strong {
    color: #0F6E56;
}

.jkpe-strip.jkpe-strip-tier-expiring {
    background: #fdf6e9;
    border-color: #f4dca8;
    border-left-color: #BA7517;
}
.jkpe-strip.jkpe-strip-tier-expiring .jkpe-strip-pill {
    background: #FAEEDA;
    color: #854F0B;
}
.jkpe-strip.jkpe-strip-tier-expiring .jkpe-strip-msg strong {
    color: #854F0B;
}

.jkpe-strip.jkpe-strip-tier-critical {
    background: #fcecec;
    border-color: #f3c5c5;
    border-left-color: #A32D2D;
}
.jkpe-strip.jkpe-strip-tier-critical .jkpe-strip-pill {
    background: #FCEBEB;
    color: #A32D2D;
}
.jkpe-strip.jkpe-strip-tier-critical .jkpe-strip-msg strong {
    color: #A32D2D;
}

.jkpe-strip.jkpe-strip-tier-on_hold,
.jkpe-strip.jkpe-strip-tier-expired,
.jkpe-strip.jkpe-strip-tier-pending {
    background: var(--jkpe-bg-light);
    border-color: var(--jkpe-border);
    border-left-color: var(--jkpe-pending);
}
.jkpe-strip.jkpe-strip-tier-on_hold .jkpe-strip-pill,
.jkpe-strip.jkpe-strip-tier-expired .jkpe-strip-pill,
.jkpe-strip.jkpe-strip-tier-pending .jkpe-strip-pill {
    background: #fff;
    color: var(--jkpe-muted);
}

/* ── No-plan empty state: dashed, neutral, tighter ── */
.jkpe-strip.jkpe-strip-no-plan {
    background: var(--jkpe-bg-light);
    border: 1px dashed #c5d3ea;
    border-left: 1px dashed #c5d3ea;
}
.jkpe-strip.jkpe-strip-no-plan .jkpe-strip-msg {
    color: var(--jkpe-muted);
}

/* Mobile — stack into rows when the row gets narrow */
@media (max-width: 480px) {
    .jkpe-strip {
        flex-wrap: wrap;
        gap: 8px;
    }
    .jkpe-strip-msg {
        flex-basis: 100%;
        order: 3;
    }
    .jkpe-strip-btn {
        margin-left: auto;
    }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .jkpe-countdown-number { font-size: 44px; }
}
