/**
 * ValueSpace Billing Page Styles
 *
 * All CSS in this file is scoped to the Billing & Usage admin page.
 * Loaded exclusively via the valuespace_page_valuespace-billing hook.
 *
 * @package ValueSpace
 */

/* =============================================================
   PAGE LAYOUT
   ============================================================= */

/* Outer wrap — same approach as events .wrap */
.vasp-billing-wrap h1 {
    margin-bottom: 20px;
}

/* Each section = matches .vasp-connection-card sizing */
.vasp-billing-section {
    max-width: 850px;
    margin: 20px 0 0 0;
    padding: 30px 36px 36px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    box-sizing: border-box;
}

/* =============================================================
   SECTION 1 — CURRENT SUBSCRIPTION
   Mirrors the plan-details block in SubscriptionPage.razor
   ============================================================= */

.vasp-billing-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #646970;
    margin: 0 0 16px 0;
    letter-spacing: 0.05em;
}

.vasp-subscription-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

/* Stack name / price / description with consistent vertical rhythm.
   gap on the flex column is immune to WP admin margin overrides. */
.vasp-subscription-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Plan name + interval badge on one line */
.vasp-plan-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;  /* extra breathing room below name row vs price */
}

.vasp-plan-display-name {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    color: #1d2327;
    margin: 0;
}

/* Interval badge */
.vasp-plan-interval-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
}

.vasp-plan-interval-badge.vasp-monthly {
    background: #f0f0f1;
    color: #3c434a;
}

.vasp-plan-interval-badge.vasp-yearly {
    background: #f0f0f1;
    color: #3c434a;
}

/* Price row */
.vasp-plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
}

.vasp-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
}

.vasp-price-frequency {
    font-size: 14px;
    color: #646970;
}

/* Plan description — use padding-top, not margin: WP admin resets all <p> margins to 0 */
.vasp-plan-description {
    font-size: 13px;
    color: #646970;
    line-height: 1.5;
    margin: 0;
    padding-top: 8px;
}

.vasp-next-billing {
    font-size: 13px;
    color: #646970;
    margin: 0;
}

.vasp-subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.vasp-billing-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbe6;
    border: 1px solid #f0e1a8;
    border-radius: 4px;
    padding: 12px 14px;
}

.vasp-billing-tip .dashicons {
    color: #c9a600;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}

.vasp-billing-tip p {
    margin: 0;
    font-size: 13px;
    color: #3c434a;
    line-height: 1.5;
}

/* =============================================================
   SECTION 2 — USAGE SUMMARY
   ============================================================= */

.vasp-section-heading {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 20px 0;
}

/* Trial notice */
.vasp-trial-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff8e1;
    border: 1px solid #f2e3b3;
    border-radius: 4px;
    padding: 10px 14px;
    color: #7a5600;
    font-size: 13px;
    margin-bottom: 24px;
}

.vasp-trial-notice .dashicons {
    color: #dba617;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Hero counter */
.vasp-usage-hero {
    margin-bottom: 24px;
}

.vasp-usage-hero-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    color: #1d2327;
}

.vasp-usage-hero-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #646970;
    margin-top: 6px;
    letter-spacing: 0.05em;
}

/* Breakdown rows */
.vasp-usage-breakdown {
    border-top: 1px solid #f0f0f1;
    padding-top: 16px;
}

.vasp-usage-row {
    margin-bottom: 16px;
}

.vasp-usage-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.vasp-usage-row-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #50575e;
    letter-spacing: 0.04em;
}

.vasp-usage-row-badge {
    font-size: 12px;
    color: #646970;
}

.vasp-usage-row-counts {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 14px;
    margin-bottom: 8px;
}

.vasp-usage-used {
    font-weight: 700;
    color: #1d2327;
}

.vasp-usage-of {
    color: #646970;
}

.vasp-usage-remaining {
    margin-left: auto;
    color: #646970;
    font-size: 13px;
}

/* Expiry footnote */
.vasp-usage-expiry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.vasp-usage-expiry .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.vasp-usage-expiry-soon {
    color: #d97706;
    font-weight: 500;
}

.vasp-usage-expiry-soon .dashicons {
    color: #d97706;
}

/* CTA */
.vasp-usage-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f1;
}

/* Progress bar */
.vasp-usage-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.vasp-usage-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--wp-admin-theme-color, #2271b1);
    transition: width 0.4s ease;
    min-width: 0;
}

.vasp-usage-bar-fill.vasp-usage-bar-warning {
    background: #dba617 !important;
}

.vasp-usage-bar-fill.vasp-usage-bar-danger {
    background: #d63638 !important;
}



/* Responsive */
@media screen and (max-width: 782px) {
    .vasp-subscription-row {
        flex-direction: column;
    }

    .vasp-subscription-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .vasp-usage-row-counts {
        flex-wrap: wrap;
    }

    .vasp-usage-remaining {
        margin-left: 0;
    }
}

/* =============================================================
   EMPTY STATES & NOTICES
   ============================================================= */


.vasp-billing-notice {
    margin-top: 20px;
}

.vasp-billing-connect-btn {
    margin-left: 10px;
}

/* Zero Credits Empty State */
.vasp-usage-empty-state {
    text-align: center;
    padding: 2em 0;
}

.vasp-usage-empty-state .vasp-empty-state-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d63638;
    margin-bottom: 15px;
}

.vasp-usage-empty-state .vasp-empty-state-title {
    margin-top: 0;
    font-size: 1.2em;
}

.vasp-usage-empty-state .vasp-empty-state-desc {
    color: #646970;
    margin-bottom: 1.5em;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================================
   CURRENT SUBSCRIPTION — Plan header display
   Mirrors the plan-details block in SubscriptionPage.razor
   ============================================================= */

/* Stack name / price / description with consistent vertical rhythm */
.vasp-subscription-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;  /* uniform gap between every sibling — immune to WP margin overrides */
}

/* Plan name row: name + interval badge on the same line */
.vasp-plan-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vasp-plan-display-name {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    color: #1d2327;
    margin: 0;
}

/* Interval badge — Monthly (indigo) / Yearly (green) */
.vasp-plan-interval-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
}

.vasp-plan-interval-badge.vasp-monthly {
    background: #f0f0f1;
    color: #3c434a;
}

.vasp-plan-interval-badge.vasp-yearly {
    background: #f0f0f1;
    color: #3c434a;
}

/* Price row */
.vasp-plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
}

.vasp-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
}

.vasp-price-frequency {
    font-size: 14px;
    color: #646970;
}

/* Plan description */
.vasp-plan-description {
    font-size: 13px;
    color: #646970;
    line-height: 1.5;
    margin: 0;
}
