/* =====================================================
   TranslateXYZ — Shared Components
   Cards · Badges · Tables · Forms · Alerts · Tabs · FAQ · Tooltip
   Component-specific styles (header, footer, hero, etc.) live in their own files.
   ===================================================== */

/* ---------- CARDS ---------- */
.card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    box-shadow: var(--sh-sm);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-lg);
    border-color: var(--neutral-300);
}
.card-flat { box-shadow: none; }
.card-elevated { box-shadow: var(--sh-md); }
.card-feature {
    padding: var(--sp-7);
    background: var(--bg-light);
}
.card-feature .card-icon {
    width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--green-50);
    color: var(--green-700);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
}
.card-feature .card-icon svg { width: 24px; height: 24px; }

/* dark surface */
.section-dark .card {
    background: var(--bg-dark-elev);
    border-color: var(--border-dark);
    color: var(--text-on-dark);
}
.section-dark .card-hover:hover {
    border-color: rgba(48,178,48,0.4);
}
.section-dark .card-feature .card-icon {
    background: rgba(48,178,48,0.15);
    color: var(--green-300);
}

/* ---------- BADGES ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    padding: 4px 10px;
    border-radius: var(--r-pill);
    line-height: 1.4;
    letter-spacing: 0.01em;
}
.badge-green   { background: var(--green-100);  color: var(--green-700); }
.badge-cyan    { background: var(--cyan-100);   color: var(--cyan-700); }
.badge-amber   { background: var(--amber-100);  color: var(--amber-700); }
.badge-neutral { background: var(--neutral-100);color: var(--neutral-700); }
.badge-dark    { background: var(--neutral-900);color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--border-light-strong); color: var(--text-on-light); }
.section-dark .badge-outline { border-color: var(--border-dark-strong); color: var(--text-on-dark); }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-light); border-radius: var(--r-lg); }
.table {
    width: 100%;
    background: var(--bg-light);
    font-size: var(--fs-sm);
}
.table th, .table td {
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table thead th {
    background: var(--bg-light-subtle);
    color: var(--text-on-light-strong);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-light-subtle); }

.section-dark .table-wrap { border-color: var(--border-dark); }
.section-dark .table { background: var(--bg-dark-elev); color: var(--text-on-dark); }
.section-dark .table th, .section-dark .table td { border-bottom-color: var(--border-dark); }
.section-dark .table thead th { background: var(--bg-dark-elev-2); color: var(--text-on-dark-strong); }
.section-dark .table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: var(--sp-5); }
.label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-on-light-strong);
    margin-bottom: var(--sp-2);
}
.input, .textarea, .select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border-light-strong);
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    color: var(--text-on-light-strong);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-on-light-muted); }
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: var(--sh-focus);
}
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-base); }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235C605C' d='M6 8L0 0h12z'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.section-dark .label { color: var(--text-on-dark-strong); }
.section-dark .input, .section-dark .textarea, .section-dark .select {
    background: var(--bg-dark-elev);
    border-color: var(--border-dark-strong);
    color: var(--text-on-dark-strong);
}
.section-dark .input::placeholder, .section-dark .textarea::placeholder { color: var(--text-on-dark-muted); }

/* ---------- ALERTS ---------- */
.alert {
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
}
.alert-info    { background: var(--cyan-50);  border-color: var(--cyan-100);  color: var(--cyan-700); }
.alert-success { background: var(--green-50); border-color: var(--green-100); color: var(--green-700); }
.alert-warning { background: var(--amber-50); border-color: var(--amber-100); color: var(--amber-700); }

/* ---------- TOGGLE (yearly/lifetime) ---------- */
.toggle-group {
    display: inline-flex;
    background: var(--bg-light-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--r-pill);
    padding: 4px;
    gap: 2px;
}
.toggle-group .toggle-btn {
    padding: 8px 16px;
    border-radius: var(--r-pill);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-on-light);
    background: transparent;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.toggle-group .toggle-btn.is-active {
    background: var(--green-500);
    color: var(--neutral-0);
    box-shadow: var(--sh-sm);
}
/* DARK VARIANT — used on .section-dark surfaces */
.section-dark .toggle-group {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.section-dark .toggle-group .toggle-btn {
    color: var(--text-on-dark-muted);
    transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.section-dark .toggle-group .toggle-btn.is-active {
    background: var(--green-500);
    color: #fff;
    box-shadow: 0 4px 14px rgba(48,178,48,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
}
.section-dark .toggle-group .toggle-btn:hover:not(.is-active) {
    color: var(--text-on-dark-strong);
    background: rgba(255,255,255,0.06);
}
.section-dark .toggle-group .toggle-btn .badge-amber {
    background: var(--amber-500);
    color: var(--neutral-900);
}

/* ---------- FAQ ACCORDION ---------- */
.faq { display: flex; flex-direction: column; gap: var(--sp-3); }
.faq-item {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t-fast);
}
.faq-item.is-open { border-color: var(--green-500); }
.faq-q {
    width: 100%;
    text-align: left;
    padding: var(--sp-4) var(--sp-5);
    font-weight: var(--fw-semibold);
    color: var(--text-on-light-strong);
    font-size: var(--fs-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    cursor: pointer;
}
.faq-q:hover { color: var(--green-700); }
.faq-q::after {
    content: '';
    width: 14px; height: 14px;
    flex-shrink: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path fill='none' stroke='%231A6F1A' stroke-width='2' stroke-linecap='round' d='M3.5 5l3.5 4 3.5-4'/></svg>") no-repeat center / contain;
    transition: transform var(--t-fast);
}
.faq-item.is-open .faq-q::after { transform: rotate(180deg); }
.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--t-base), padding var(--t-base);
    padding: 0 var(--sp-5);
    color: var(--text-on-light);
}
.faq-item.is-open .faq-a {
    max-height: 600px;
    padding: 0 var(--sp-5) var(--sp-5);
}
.section-dark .faq-item { background: var(--bg-dark-elev); border-color: var(--border-dark); }
.section-dark .faq-q { color: var(--text-on-dark-strong); }
.section-dark .faq-a { color: var(--text-on-dark); }

/* ---------- FAQ RICH (2-column with sidebar — used on homepage / product / feature pages) ---------- */
.faq-rich {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--sp-9);
    align-items: start;
}
.faq-rich__intro { position: sticky; top: calc(var(--header-h-shrunk, 64px) + var(--sp-5)); }
.faq-rich__intro-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-extra);
    color: var(--text-on-light-strong);
    line-height: 1.15;
    letter-spacing: var(--ls-tighter);
    margin-bottom: var(--sp-4);
}
.faq-rich__intro-help {
    font-size: var(--fs-md);
    color: var(--text-on-light);
    margin-bottom: var(--sp-5);
    line-height: var(--lh-relaxed);
}

/* Support card inside the FAQ sidebar */
.faq-support-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
}
.faq-support-card__avatars {
    margin: 0 0 var(--sp-4);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-light-subtle);
}
.faq-support-card__avatars img {
    width: 100%;
    height: auto;
    display: block;
}
.faq-support-card__title {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--text-on-light-strong);
    margin-bottom: var(--sp-2);
}
.faq-support-card__text {
    font-size: var(--fs-sm);
    color: var(--text-on-light);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--sp-4);
}
.faq-support-card .btn { width: 100%; justify-content: center; }

/* Accordion list — single bordered card with separator lines */
.faq-rich__list {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
}
.faq-rich__list .faq-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    overflow: visible;
    transition: background var(--t-fast);
}
.faq-rich__list .faq-item:last-child { border-bottom: none; }
.faq-rich__list .faq-item.is-open { border-bottom-color: var(--border-light); }

.faq-rich__list .faq-q {
    padding: var(--sp-5) var(--sp-6);
    font-size: var(--fs-md);
    color: var(--text-on-light-strong);
    line-height: 1.4;
    gap: var(--sp-4);
}
.faq-rich__list .faq-q:hover { color: var(--green-700); }
.faq-rich__list .faq-item.is-open .faq-q { color: var(--green-700); }

/* Replace default chevron with circular outline button */
.faq-rich__list .faq-q::after {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-light-strong);
    border-radius: 50%;
    background-color: var(--bg-light);
    background-size: 12px 12px;
    transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}
.faq-rich__list .faq-q:hover::after,
.faq-rich__list .faq-item.is-open .faq-q::after {
    border-color: var(--green-300);
    background-color: var(--green-50);
}

.faq-rich__list .faq-a {
    padding: 0 var(--sp-6);
    font-size: var(--fs-base);
    color: var(--text-on-light);
}
.faq-rich__list .faq-item.is-open .faq-a {
    padding: 0 var(--sp-6) var(--sp-5);
    max-height: 600px;
}

/* Responsive */
@media (max-width: 900px) {
    .faq-rich { grid-template-columns: 1fr; gap: var(--sp-7); }
    .faq-rich__intro { position: static; }
}
@media (max-width: 640px) {
    .faq-rich__list .faq-q { padding: var(--sp-4) var(--sp-5); }
    .faq-rich__list .faq-item.is-open .faq-a { padding: 0 var(--sp-5) var(--sp-4); }
}

/* ---------- BREADCRUMB ---------- */
.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-sm);
    color: var(--text-on-light-muted);
}
.breadcrumb__link { color: var(--color-link); transition: color var(--t-fast); }
.breadcrumb__link:hover { color: var(--color-link-hover); }
.breadcrumb__sep { color: var(--neutral-300); }
.breadcrumb__current { color: var(--text-on-light); font-weight: var(--fw-medium); }

.breadcrumb--dark .breadcrumb__list  { color: var(--text-on-dark-muted); }
.breadcrumb--dark .breadcrumb__link  { color: var(--green-300); }
.breadcrumb--dark .breadcrumb__link:hover { color: #fff; }
.breadcrumb--dark .breadcrumb__sep   { color: rgba(255,255,255,0.2); }
.breadcrumb--dark .breadcrumb__current { color: var(--text-on-dark); }

/* ---------- DEMO BLOCK (used in /design-kit/) ---------- */
.demo-block {
    border: 1px dashed var(--border-light-strong);
    border-radius: var(--r-md);
    padding: var(--sp-6);
    margin-bottom: var(--sp-6);
    background: var(--bg-light);
}
.demo-block.dark {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    border-color: var(--border-dark-strong);
}
.demo-block .demo-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--text-on-light-muted);
    margin-bottom: var(--sp-3);
    font-weight: var(--fw-semibold);
}
.demo-block.dark .demo-label { color: var(--text-on-dark-muted); }

/* =====================================================
   REVIEW CARD — shared component (product + feature pages)
   The .product-review-card--featured variant lives in product.css
   ===================================================== */
.product-review-card {
    background: var(--bg-light-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    position: relative;
    transition: transform var(--t-base), box-shadow var(--t-base);
}
.product-review-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
}

.product-review-card__top {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}
.product-review-card__stars {
    color: var(--amber-500);
    font-size: var(--fs-xl);
    letter-spacing: 2px;
    line-height: 1;
}
.product-review-card__quote-mark {
    width: 28px;
    height: 22px;
    color: var(--green-300);
    margin-left: auto;
    flex-shrink: 0;
}
.product-review-card__quote {
    font-size: var(--fs-sm);
    color: var(--text-on-light);
    line-height: var(--lh-relaxed);
    margin: 0;
    flex: 1;
}
.product-review-card__author {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border-light);
}
.product-review-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: var(--fw-bold);
    color: #fff;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 6px rgba(15,30,15,0.10);
}
.product-review-card__avatar--green   { background: linear-gradient(135deg, var(--green-400) 0%, var(--green-700) 100%); }
.product-review-card__avatar--cyan    { background: linear-gradient(135deg, var(--cyan-300) 0%, var(--cyan-700) 100%); }
.product-review-card__avatar--amber   { background: linear-gradient(135deg, var(--amber-300) 0%, var(--amber-700) 100%); color: #2A2C2A; }
.product-review-card__avatar--neutral { background: linear-gradient(135deg, var(--neutral-400) 0%, var(--neutral-700) 100%); }

.product-review-card__author-text { min-width: 0; flex: 1; }
.product-review-card__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--text-on-light-strong);
    line-height: 1.2;
}
.product-review-card__role {
    font-size: var(--fs-xs);
    color: var(--text-on-light-muted);
    margin-top: 2px;
}
.product-review-card__verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--green-700);
    background: var(--green-50);
    border: 1px solid var(--green-200);
    border-radius: var(--r-pill);
    padding: 3px 8px;
    flex-shrink: 0;
}
.product-review-card__verified svg { width: 10px; height: 10px; }

/* ----- Real image avatar (overrides the gradient initials chip) ----- */
.product-review-card__avatar--img {
    width: 40px;
    height: 40px;
    background: var(--bg-light-subtle);
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(15,30,15,0.08);
    object-fit: cover;
}

/* ----- Username variant (forum handle, not a real name) ----- */
.product-review-card__name--username {
    font-style: italic;
    font-weight: var(--fw-medium);
    color: var(--text-on-light);
}

/* ----- Product chip (homepage + reviews page, identifies which addon) ----- */
.product-review-card__product {
    font-size: 10px;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--neutral-700);
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-pill);
    padding: 3px 8px;
    flex-shrink: 0;
}

/* ----- Source badge: WordPress.org / Trustpilot / Customer testimonial ----- */
.product-review-card__source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: 1.2;
    text-decoration: none;
    transition: color var(--t-fast);
    max-width: 100%;
}
.product-review-card__source-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-review-card__source-arrow {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform var(--t-fast), opacity var(--t-fast);
}
.product-review-card__source:hover .product-review-card__source-arrow {
    transform: translate(1px, -1px);
    opacity: 1;
}

/* WP.org + Trustpilot — same green anchor color */
.product-review-card__source--wp,
.product-review-card__source--tp { color: var(--green-600); }
.product-review-card__source--wp:hover,
.product-review-card__source--tp:hover { color: var(--green-700); text-decoration: underline; }

/* Generic customer testimonial — neutral, no link */
.product-review-card__source--gen,
.product-review-card__source--static {
    color: var(--text-on-light-muted);
    font-style: italic;
}
