/**
 * GPLT My Account - subscription-styles.css
 *
 * Covers:   The Subscriptions page (subscription cards, past subscriptions) and, since 40.33.0, View
 *   subscription. The confirm modal's markup and script live in templates/.../subscription-actions-modal.php
 *   (styled in style.css, "MODAL").
 * Loads on: The subscriptions and view-subscription endpoints only.
 * 40.33.0 (2026-10-06): the rules for YITH's own view-subscription page and its tables ("YITH VIEW SUBSCRIPTION
 *   PAGE", "YITH DEFAULT TABLE OVERRIDES", 38 rules) were removed with that page.
 *
 * Editing guide:
 *   - .gplt-* selectors are ours. Anything else (woocommerce-*, yith-*,
 *     select2-*) belongs to another plugin and is overridden deliberately.
 *   - Some selectors are defined more than once on purpose, the later
 *     definition overriding the earlier. Search the file for a second
 *     definition before changing a value.
 *
 * @package GPLT_My_Account
 */

/* Status colors */
.gplt-status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.gplt-status-active svg {
    stroke: #2e7d32;
}

.gplt-status-cancelled {
    background: #ffebee;
    color: #c62828;
}

.gplt-status-cancelled svg {
    stroke: #c62828;
}

.gplt-status-expired {
    background: #f5f5f5;
    color: #616161;
}

.gplt-status-expired svg {
    stroke: #616161;
}

/* Loading spinner */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   SUBSCRIPTIONS (40.24.0) - templates/woocommerce/myaccount/subscriptions.php
   One card per active subscription (.gplt-sub, facts use the shared .gplt-mem-facts), past subscriptions in
   one collapsible card (.gplt-subs-past). Buttons/chips come from the DASHBOARD rules in style.css; the
   confirm modal is styled in style.css ("MODAL").
   40.34.0: each subscription opens its page. Card: the plan name is a link (.gplt-sub__link) and "View details"
   leads the actions. Past row: the row is a link (.gplt-subs-row__link, like an Orders page row, with a chevron)
   and Resubscribe sits beside it.
   ===================================================== */
.gplt-dash .gplt-sub { padding: 20px 22px; border: 1px solid #e2e8f0; border-radius: 18px; background: #ffffff; }
.gplt-sub__top { display: flex; align-items: center; gap: 14px; }
.gplt-sub__icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(180deg, #23a3dc, #1a8fc4); box-shadow: 0 0 0 4px #ffffff, 0 10px 20px -10px rgba(13, 107, 154, 0.8); color: #ffffff; }
.gplt-sub__icon svg { width: 22px; height: 22px; }
.gplt-sub__title { flex: 1 1 auto; min-width: 0; }
.gplt-dash h2.gplt-sub__name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: #0f1b2a; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; text-transform: none; }
.gplt-dash h2.gplt-sub__name a.gplt-sub__link { color: inherit; text-decoration: none; }
.gplt-dash h2.gplt-sub__name a.gplt-sub__link:hover { color: #0d7ab0; }
.gplt-dash .gplt-sub__no { margin: 2px 0 0; color: #6b7a8f; font-size: 13.5px; }
.gplt-sub__price { flex: none; color: #46556a; font-size: 14px; font-weight: 600; text-align: right; }
.gplt-sub__price .woocommerce-Price-amount { color: #0f1b2a; font-family: var(--gplt-font-heading); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.gplt-dash .gplt-sub__facts { margin-top: 16px; }
.gplt-dash .gplt-mem-facts dd span.gplt-sub__when { display: inline-flex; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #e8f3fb; color: #0d6b9a; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.gplt-dash .gplt-mem-facts dd span.gplt-sub__when.is-soon { background: #fff4e0; color: #b45309; }
.gplt-sub__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #edf1f5; }

.gplt-subs-count { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 10px; border: 1px solid #d5e0ea; border-radius: 999px; background: #f8fafc; color: #46556a; font-size: 12.5px; font-weight: 700; line-height: 1.5; vertical-align: 2px; }
.gplt-dash .gplt-subs-toggle svg { width: 15px; height: 15px; transition: transform 0.2s ease; }
.gplt-dash .gplt-subs-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.gplt-dash ul.gplt-subs-list,
.gplt-dash ul.gplt-subs-list > li { margin: 0; padding: 0; list-style: none; }
.gplt-dash ul.gplt-subs-list[hidden] { display: none; }
.gplt-dash ul.gplt-subs-list > li + li { border-top: 1px solid #edf1f5; }
.gplt-dash ul.gplt-subs-list > li.gplt-subs-row { display: flex; align-items: center; transition: background-color 0.15s ease; }
.gplt-dash ul.gplt-subs-list > li.gplt-subs-row:hover { background: #f6fafd; }
.gplt-dash a.gplt-subs-row__link { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) auto auto auto 18px; align-items: center; gap: 16px; min-width: 0; padding: 12px 20px; color: inherit; text-decoration: none; }
.gplt-dash a.gplt-subs-row__link:hover { color: inherit; }
.gplt-dash a.gplt-subs-row__link:hover .gplt-subs-row__name { color: #0d7ab0; }
.gplt-dash a.gplt-subs-row__link:focus-visible { outline: 2px solid #1a8fc4; outline-offset: -2px; border-radius: 12px; }
.gplt-subs-row__go { display: grid; place-items: center; color: #98a6b7; }
.gplt-subs-row__go svg { width: 18px; height: 18px; }
.gplt-dash a.gplt-subs-row__link:hover .gplt-subs-row__go { color: #1a8fc4; }
.gplt-dash .gplt-subs-row > .gplt-sub-btn-resubscribe { flex: none; margin-right: 20px; }
.gplt-subs-row__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.gplt-subs-row__name { color: #0f1b2a; font-size: 15px; font-weight: 700; line-height: 1.35; }
.gplt-subs-row__no { color: #6b7a8f; font-size: 13px; font-variant-numeric: tabular-nums; }
.gplt-subs-row__price { color: #6b7a8f; font-size: 13.5px; white-space: nowrap; }
.gplt-subs-row__price .woocommerce-Price-amount { color: #46556a; font-weight: 700; }
.gplt-subs-row__end { color: #6b7a8f; font-size: 13.5px; white-space: nowrap; }

@media (max-width: 600px) {
    .gplt-dash .gplt-sub { padding: 16px; }
    .gplt-sub__top { flex-wrap: wrap; }
    .gplt-sub__price { flex: 1 1 100%; padding-left: 60px; text-align: left; }
    .gplt-sub__actions .gplt-dash-btn { flex: 1 1 auto; }
    .gplt-dash ul.gplt-subs-list > li.gplt-subs-row { flex-wrap: wrap; }
    .gplt-dash a.gplt-subs-row__link { flex-basis: 100%; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main chip" "price price" "end end"; gap: 4px 12px; padding: 12px 16px; }
    .gplt-subs-row__main { grid-area: main; }
    .gplt-subs-row .gplt-dash-chip { grid-area: chip; justify-self: end; }
    .gplt-subs-row__price { grid-area: price; }
    .gplt-subs-row__end { grid-area: end; }
    .gplt-subs-row__go { display: none; }
    .gplt-dash .gplt-subs-row > .gplt-sub-btn-resubscribe { margin: -4px 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .gplt-dash .gplt-subs-toggle svg,
    .gplt-dash ul.gplt-subs-list > li.gplt-subs-row { transition: none; }
}

/* =====================================================
   VIEW SUBSCRIPTION (40.33.0) - templates/woocommerce/myaccount/view-subscription.php
   Built from the VIEW ORDER rules in style.css (summary .gplt-vo-sum, .gplt-vo-count, help line .gplt-vo-help) and
   the DASHBOARD rules (cards, chips, buttons, and the Orders page's rows .gplt-dash-orders / .gplt-orders-page__row).
   Only what differs is here: the price in the summary ("$14.00" large, "/ 30 days" small, as on the subscription
   cards above), the Details facts inside their card, the red "Unpaid" pill, and the Orders card's "Show all" button.
   ===================================================== */
.gplt-dash .gplt-vs-sum .gplt-vo-sum__total { color: #46556a; font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.gplt-dash .gplt-vs-sum .gplt-vo-sum__total .woocommerce-Price-amount { color: #0f1b2a; font-family: var(--gplt-font-heading); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.gplt-dash .gplt-mem-facts.gplt-vs-facts { margin: 0; padding: 16px 20px 18px; }
.gplt-dash .gplt-mem-facts.gplt-vs-facts dd span.gplt-sub__when { display: flex; width: fit-content; margin: 5px 0 0; }
.gplt-dash .gplt-mem-facts dd span.gplt-sub__when.is-late { background: #fdecec; color: #b91c1c; }
.gplt-dash ul.gplt-dash-orders > li[hidden] { display: none; }
.gplt-vs-more { display: flex; justify-content: center; padding: 12px 20px 14px; border-top: 1px solid #edf1f5; }
.gplt-vs-extra:empty { display: none; }

@media (max-width: 600px) {
    .gplt-dash .gplt-vs-sum .gplt-vo-sum__total .woocommerce-Price-amount { font-size: 23px; }
    .gplt-dash .gplt-mem-facts.gplt-vs-facts { padding: 13px 16px 16px; }
    .gplt-vs-more { padding: 10px 16px 12px; }
    .gplt-vs-more .gplt-dash-btn { width: 100%; }
}
