/* ── MTP Plugin Frontend Styles ─────────────────────────────────────────
   Synced with theme palette: Indigo #1C1777 + Orange #EE7922
   ──────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

.mtp-btn { display: inline-block; padding: 9px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1.5px solid #E4E2F0; background: #fff; color: #0F1235; text-decoration: none; transition: background .15s; }
.mtp-btn:hover { background: #F2F1F8; }
.mtp-btn--primary { background: #EE7922; color: #fff; border-color: #EE7922; }
.mtp-btn--primary:hover { background: #C25E15; }
.mtp-link { color: #1C1777; text-decoration: none; font-size: 13px; }
.mtp-link:hover { color: #EE7922; text-decoration: underline; }
.mtp-empty { color: #9CA0B8; font-style: italic; }

/* ── Filter bar ──────────────────────────────────────────────────────── */

.mtp-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; align-items: center; }
.mtp-filter-btn { display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 13px; border: 1.5px solid #E4E2F0; color: #6B6E89; text-decoration: none; transition: all .15s; background: #fff; }
.mtp-filter-btn:hover { border-color: #1C1777; color: #1C1777; }
.mtp-filter-btn.active { background: #1C1777; color: #fff; border-color: #1C1777; }
.mtp-filter-sep { color: #E4E2F0; margin: 0 4px; }

/* ── Series grid ─────────────────────────────────────────────────────── */

.mtp-series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.mtp-series-card { background: #fff; border: 1.5px solid #E4E2F0; border-radius: 12px; padding: 20px; transition: box-shadow .2s, border-color .2s, transform .2s; }
.mtp-series-card:hover { border-color: #1C1777; box-shadow: 0 8px 20px rgba(28,23,119,.10); transform: translateY(-2px); }
.mtp-series-card--locked { border-color: #E4E2F0; opacity: .95; }

.mtp-series-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mtp-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 12px; text-transform: uppercase; letter-spacing: .5px; }
.mtp-badge--free    { background: #DCFCE7; color: #15803D; }
.mtp-badge--premium { background: #FEE7D2; color: #C25E15; }
.mtp-series-cat { font-size: 12px; color: #9CA0B8; }
.mtp-series-title { font-size: 16px; font-weight: 600; color: #0F1235; margin: 0 0 8px; line-height: 1.4; }
.mtp-series-desc  { font-size: 13px; color: #6B6E89; line-height: 1.55; margin: 0 0 12px; }
.mtp-series-meta  { font-size: 12px; color: #9CA0B8; margin-bottom: 14px; }

.mtp-btn-card { display: block; width: 100%; padding: 10px; text-align: center; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s; }
.mtp-btn-card--buy      { background: #EE7922; color: #fff; }
.mtp-btn-card--buy:hover{ background: #C25E15; }
.mtp-btn-card--register { background: #1C1777; color: #fff; }
.mtp-btn-card--register:hover { background: #14105A; }

.mtp-test-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #F2F1F8; }
.mtp-test-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #F2F1F8; font-size: 13px; flex-wrap: wrap; }
.mtp-test-item--empty { color: #9CA0B8; font-style: italic; }
.mtp-test-name  { flex: 1; font-weight: 500; color: #0F1235; min-width: 0; }
.mtp-test-meta  { color: #9CA0B8; flex-shrink: 0; }
.mtp-test-score { color: #1C1777; font-size: 12px; flex-shrink: 0; font-weight: 600; }
.mtp-test-link  { flex-shrink: 0; padding: 4px 12px; background: #EE7922; color: #fff; border-radius: 5px; font-size: 12px; font-weight: 600; text-decoration: none; transition: background .15s; }
.mtp-test-link:hover { background: #C25E15; }
.mtp-test-link--resume { background: #F59E0B; }
.mtp-test-link--resume:hover { background: #B45309; }

/* ── Dashboard ───────────────────────────────────────────────────────── */

.mtp-dashboard-wrap { max-width: 900px; }
.mtp-dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.mtp-dash-title { font-size: 22px; font-weight: 700; margin: 0; color: #0F1235; }

.mtp-stats-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 12px; margin-bottom: 32px; }
.mtp-stat-card { background: #fff; border: 1px solid #E4E2F0; border-radius: 10px; padding: 16px; text-align: center; transition: border-color .15s; }
.mtp-stat-card:hover { border-color: #1C1777; }
.mtp-stat-val  { font-size: 28px; font-weight: 800; color: #1C1777; }
.mtp-stat-lbl  { font-size: 12px; color: #6B6E89; margin-top: 4px; }

.mtp-section { margin-bottom: 36px; }
.mtp-section h3 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: #0F1235; border-bottom: 2px solid #EE7922; display: inline-block; padding-bottom: 4px; }

.mtp-my-series-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mtp-my-series-chip { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: #EEEBFA; color: #1C1777; border-radius: 20px; font-size: 13px; font-weight: 500; text-decoration: none; }
.mtp-chip-badge { font-size: 10px; background: #EE7922; color: #fff; padding: 1px 6px; border-radius: 8px; font-weight: 600; }

.mtp-history-table-wrap { overflow-x: auto; }
.mtp-history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtp-history-table th { text-align: left; padding: 8px 12px; border-bottom: 2px solid #E4E2F0; font-size: 12px; font-weight: 700; color: #6B6E89; text-transform: uppercase; letter-spacing: .5px; }
.mtp-history-table td { padding: 10px 12px; border-bottom: 1px solid #F2F1F8; color: #3A3D5C; vertical-align: middle; }
.mtp-history-table tr:hover td { background: #FAFAFC; }
.mtp-ht-name { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0F1235; }
.mtp-correct { color: #16A34A; font-weight: 700; }
.mtp-wrong   { color: #DC2626; font-weight: 700; }

/* ── Result page ─────────────────────────────────────────────────────── */

.mtp-result-wrap { max-width: 860px; }
.mtp-result-scorecard { background: #fff; border: 1.5px solid #E4E2F0; border-radius: 16px; padding: 32px; margin-bottom: 32px; text-align: center; }
.mtp-result-test-title { font-size: 20px; font-weight: 700; color: #0F1235; margin: 0 0 20px; }
.mtp-result-score-big { margin-bottom: 24px; }
.mtp-result-score-num   { font-size: 56px; font-weight: 800; color: #1C1777; }
.mtp-result-score-total { font-size: 22px; color: #9CA0B8; }

.mtp-result-stats-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.mtp-result-stat { text-align: center; min-width: 80px; }
.mtp-result-stat-val { font-size: 22px; font-weight: 800; }
.mtp-result-stat-lbl { font-size: 12px; color: #6B6E89; margin-top: 2px; }
.mtp-result-stat--correct   .mtp-result-stat-val { color: #16A34A; }
.mtp-result-stat--wrong     .mtp-result-stat-val { color: #DC2626; }
.mtp-result-stat--skip      .mtp-result-stat-val { color: #9CA0B8; }
.mtp-result-stat--accuracy  .mtp-result-stat-val { color: #EE7922; }
.mtp-result-stat--rank      .mtp-result-stat-val { color: #1C1777; }
.mtp-result-stat--percentile.mtp-result-stat-val  { color: #EE7922; }

.mtp-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Solution review ─────────────────────────────────────────────────── */

.mtp-solutions-title { font-size: 18px; font-weight: 700; margin: 0 0 20px; color: #0F1235; }
.mtp-sol-item { background: #fff; border: 1.5px solid #E4E2F0; border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.mtp-sol-item--correct { border-left: 4px solid #16A34A; }
.mtp-sol-item--wrong   { border-left: 4px solid #DC2626; }
.mtp-sol-item--skipped { border-left: 4px solid #EE7922; }

.mtp-sol-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mtp-sol-num    { width: 28px; height: 28px; border-radius: 50%; background: #EEEBFA; color: #1C1777; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.mtp-sol-status { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.mtp-sol-item--correct .mtp-sol-status { color: #16A34A; }
.mtp-sol-item--wrong   .mtp-sol-status { color: #DC2626; }
.mtp-sol-item--skipped .mtp-sol-status { color: #EE7922; }
.mtp-sol-time { margin-left: auto; font-size: 12px; color: #9CA0B8; }

.mtp-sol-body { font-size: 15px; line-height: 1.65; color: #0F1235; margin-bottom: 14px; }
.mtp-sol-options { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.mtp-sol-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1.5px solid #E4E2F0; border-radius: 7px; font-size: 14px; }
.mtp-sol-opt--correct       { background: #DCFCE7; border-color: #16A34A; }
.mtp-sol-opt--wrong         { background: #FEE2E2; border-color: #DC2626; }
.mtp-sol-opt--your-correct  { background: #DCFCE7; border-color: #16A34A; }
.mtp-sol-opt-label { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: #F2F1F8; color: #1C1777; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.mtp-sol-opt-body { flex: 1; }
.mtp-sol-tick  { margin-left: auto; color: #16A34A; font-weight: 700; }
.mtp-sol-cross { margin-left: auto; color: #DC2626; font-weight: 700; }
.mtp-sol-explanation { background: #FFF4EB; border: 1px solid #FEE7D2; border-radius: 7px; padding: 12px 14px; font-size: 13px; color: #3A3D5C; line-height: 1.6; }
.mtp-sol-explanation strong { color: #C25E15; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media(max-width:640px) {
    .mtp-series-grid { grid-template-columns: 1fr; }
    .mtp-result-score-num { font-size: 40px; }
    .mtp-history-table { font-size: 12px; }
    .mtp-history-table th, .mtp-history-table td { padding: 7px 8px; }
}