/* ── Antioxidant Ranking Table — [antioxidant_table] ─────────────────────── */
/* Theme: Indigo — depth of polyphenol research, scientific prestige          */

/* ── Tool-specific color variables ────────────────────────────────────────── */
.mat-app {
  --primary:  #283593;
  --bg-light: #e8eaf6;
  --border:   #9fa8da;
  --g-dark:   #1a237e;
  --g-mid:    #3949ab;
}

/* ── Top-10 SEO block ──────────────────────────────────────────────────────── */
.mat-top10 { margin-bottom: 2rem; }
.mat-top10 h2 { font-size: 1.25rem; margin-bottom: .5rem; color: #283593; }
.mat-top10-list { margin: 0; padding-left: 1.4rem; }
.mat-top10-list li { margin-bottom: .3rem; line-height: 1.5; }

.mat-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #2d3244;
    max-width: 900px;
    margin: 0 auto;
}

/* ── Indigo theme overrides ────────────────────────────────── */
.mat-app .mat-control-group label { color: #5c6bc0; }
.mat-app .mat-combobox-input:focus,
.mat-app .mat-select:focus,
.mat-app .mat-btn:focus  { border-color: #283593; }
.mat-app .mat-btn        { border-color: #9fa8da; color: #283593; }
.mat-app .mat-btn:hover,
.mat-app .mat-btn.active { background: #e8eaf6; border-color: #283593; }
.mat-app .mat-sort-tab.active { background: #283593; border-color: #283593; color: #fff; }
.mat-app .mat-sort-tab:hover  { background: #e8eaf6; border-color: #9fa8da; }
.mat-app .mat-table thead      { background: #3949ab; color: #fff; }
.mat-app .mat-table thead th   { background: #3949ab; color: #fff; border-bottom-color: #283593; }
.mat-app .mat-table tbody tr:hover { background: #eff0fb; }
.mat-app .mat-food-name        { color: #1a237e; }
.mat-app .mat-val              { color: #283593; }
.mat-app .mat-bar              { background: linear-gradient(90deg, #283593, #7986cb); }
.mat-app .mat-pagination button:not(:disabled) { color: #283593; border-color: #9fa8da; }
.mat-app .mat-pagination button:not(:disabled):hover { background: #e8eaf6; }
.mat-app .mat-spinner           { border-color: #9fa8da; border-top-color: #283593; }
.mat-app .mat-class-badge.active { background: #e8eaf6; color: #283593; }
.mat-app .mat-loading-overlay    { border-top-color: #283593; }

/* ── Controls bar ── */
.mat-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end;
}
.mat-wf-row {
    margin-bottom: 14px;
}
.mat-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}
.mat-control-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--g-mid, #5c6bc0);
}
.mat-control-group select,
.mat-control-group input[type="text"] {
    border: 1.5px solid var(--border, #9fa8da);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #2d3a2d;
    background: #fff;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.mat-control-group select:focus,
.mat-control-group input[type="text"]:focus {
    border-color: #4a8c3f;
    box-shadow: 0 0 0 3px rgba(74,140,63,.1);
}
.mat-sort-toggle {
    display: flex;
    gap: 6px;
    align-items: center;
}
.mat-sort-btn {
    border: 1.5px solid var(--border, #9fa8da);
    border-radius: 8px;
    background: #fff;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #4a8c3f;
    -webkit-transition: background .15s, border-color .15s;
    transition: background .15s, border-color .15s;
}
.mat-sort-btn.active {
    background: var(--bg-light, #e8eaf6);
    border-color: #4a8c3f;
}

/* ── Table ── */
.mat-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1.5px solid var(--border, #9fa8da);
    margin-bottom: 16px;
}
.mat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.mat-table thead th {
    background: var(--bg-light, #e8eaf6);
    color: var(--g-dark, #1a237e);
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    border-bottom: 1.5px solid var(--border, #9fa8da);
}
.mat-table thead th.mat-th-rank { width: 44px; text-align: center; }
.mat-table thead th.mat-th-value { text-align: right; }
.mat-table tbody tr {
    border-bottom: 1px solid #edeef8;
    transition: background .1s;
}
.mat-table tbody tr:last-child { border-bottom: none; }
.mat-table tbody tr:hover { background: #f3f4fb; }
.mat-table td { padding: 10px 14px; vertical-align: middle; }
.mat-rank {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--g-mid, #5c6bc0);
    width: 44px;
}
.mat-table tbody tr:nth-child(1) .mat-rank { color: #c8a020; font-size: 15px; }
.mat-table tbody tr:nth-child(2) .mat-rank { color: #8a9a8a; font-size: 14px; }
.mat-table tbody tr:nth-child(3) .mat-rank { color: #a0704a; font-size: 13px; }
.mat-food-name { font-weight: 600; color: var(--g-dark, #1a237e); }
.mat-category {
    font-size: 11px;
    color: var(--g-mid, #5c6bc0);
    margin-top: 2px;
}
.mat-value {
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    color: var(--g-dark, #1a237e);
    white-space: nowrap;
}
.mat-unit {
    font-size: 10px;
    font-weight: 400;
    color: var(--g-mid, #5c6bc0);
    display: block;
}
.mat-bar-cell { width: 120px; min-width: 80px; padding-right: 18px; }
.mat-bar {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: -webkit-linear-gradient(left, #4a8c3f, #a0d090);
    background: linear-gradient(90deg, #4a8c3f, #a0d090);
    min-width: 4px;
    max-width: 100%;
    -webkit-transition: width .3s ease;
    transition: width .3s ease;
}
.mat-n {
    font-size: 11px;
    color: var(--g-mid, #5c6bc0);
    text-align: center;
}

/* ── Meta / pagination ── */
.mat-meta {
    font-size: 12px;
    color: var(--g-mid, #5c6bc0);
    margin-bottom: 10px;
}
.mat-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.mat-pagination button {
    border: 1.5px solid var(--border, #9fa8da);
    border-radius: 8px;
    background: #fff;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #4a8c3f;
    font-weight: 600;
    transition: background .15s;
}
.mat-pagination button:disabled { opacity: .4; cursor: default; }
.mat-pagination button:not(:disabled):hover { background: var(--bg-light, #e8eaf6); }
.mat-page-info { font-size: 12px; color: #6b8264; margin: 0 6px; }

/* ── States ── */
.mat-loading, .mat-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--g-mid, #5c6bc0);
    font-size: 14px;
}
.mat-spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid var(--border, #9fa8da);
    border-top-color: #4a8c3f;
    border-radius: 50%;
    -webkit-animation: mat-spin .7s linear infinite;
    animation: mat-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@-webkit-keyframes mat-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
@keyframes mat-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }

/* ── Method badge ── */
.mat-method {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--bg-light, #e8eaf6);
    color: #4a8c3f;
    font-weight: 600;
}

/* ── Combobox (searchable dropdown replacement) ── */
.mat-combobox { position: relative; flex: 1; min-width: 160px; }
.mat-combobox-input {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--border, #9fa8da);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #2d3a2d;
    background: #fff;
    outline: none;
}
.mat-combobox-input:focus {
    border-color: #4a8c3f;
    box-shadow: 0 0 0 3px rgba(74,140,63,.1);
}
.mat-combobox-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid var(--border, #9fa8da);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    z-index: 200;
    max-height: 260px;
    overflow-y: auto;
    display: none;
}
.mat-combobox-dropdown.open { display: block; }
.mat-cb-item {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #edeef8;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.mat-cb-item:last-child { border-bottom: none; }
.mat-cb-item:hover, .mat-cb-item.mat-cb-selected { background: #f3f4fb; }
.mat-cb-name { font-weight: 600; color: var(--g-dark, #1a237e); }
.mat-cb-class { font-size: 11px; color: #6b8264; }
.mat-cb-empty { padding: 10px 12px; font-size: 12px; color: #6b8264; font-style: italic; }

/* ── Select wrapper (styled select for cooking method) ── */
.mat-select-wrap { position: relative; }
.mat-select-wrap::after {
    content: '▾';
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    color: #4a8c3f; font-size: 11px; pointer-events: none;
}
.mat-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 28px;
    cursor: pointer;
    width: 100%;
}

/* ── Retention factor badge ── */
.mat-rf-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    vertical-align: middle;
    white-space: nowrap;
}
.mat-rf-badge.mat-rf-na {
    background: #f0f0f0;
    color: #888;
    border-color: #ccc;
}

/* ── Share bar ── */
.mat-share-bar {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.mat-share-bar.visible { display: flex; }
.mat-share-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: #6b8264; white-space: nowrap;
}
.mat-share-icons { display: flex; gap: 8px; align-items: center; }
.mat-social-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1.5px solid var(--border, #9fa8da); background: #fff;
    cursor: pointer;
    -webkit-transition: all 0.18s;
    transition: all 0.18s;
    text-decoration: none; flex-shrink: 0;
}
.mat-social-btn svg { width: 18px; height: 18px; display: block; }
.mat-social-btn:hover { -webkit-transform: translateY(-2px); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.mat-social-btn.pinterest { border-color: #E60023; }
.mat-social-btn.pinterest:hover { background: #E60023; }
.mat-social-btn.pinterest:hover svg path { fill: #fff; }
.mat-social-btn.facebook  { border-color: #1877F2; }
.mat-social-btn.facebook:hover  { background: #1877F2; }
.mat-social-btn.facebook:hover svg path { fill: #fff; }
.mat-social-btn.whatsapp  { border-color: #25D366; }
.mat-social-btn.whatsapp:hover  { background: #25D366; }
.mat-social-btn.whatsapp:hover svg path { fill: #fff; }
.mat-social-btn.twitter   { border-color: #000; }
.mat-social-btn.twitter:hover   { background: #000; }
.mat-social-btn.twitter:hover svg path { fill: #fff; }
.mat-copy-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
    border: 1.5px solid var(--border, #9fa8da); cursor: pointer;
    background: #f3f4fb; color: #6b8264;
    -webkit-transition: all 0.15s;
    transition: all 0.15s; white-space: nowrap;
}
.mat-copy-btn:hover { background: var(--bg-light, #e8eaf6); color: #2d3a2d; border-color: #4a8c3f; }
.mat-copy-btn.copied { background: var(--g-dark, #1a237e); color: #fff; border-color: var(--g-dark, #1a237e); }

/* ── Winner star ── */
.mat-winner-star { color: #c8a020; font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .mat-controls { flex-direction: column; }
    .mat-bar-cell, .mat-table thead th.mat-th-bar { display: none; }
    .mat-table { font-size: 12px; }
    .mat-table td { padding: 8px 10px; }
}

/* ── Attribution ── */
.mipb-data-source {
    margin-top: 1rem;
    font-size: 12px;
    color: #999;
    text-align: right;
}
.mipb-source-label { font-weight: 600; color: #888; }
.mipb-data-source a { color: #4a8c3f; text-decoration: none; }
.mipb-data-source a:hover { text-decoration: underline; }

/* ── FAQ section ─────────────────────────────────────────────── */
.mat-faq { max-width: 960px; margin: 2rem auto 0; font-family: inherit; }
.mat-faq h2 { font-size: 1.2rem; margin-bottom: .75rem; color: var(--primary, #283593); }
.mat-faq details { border: 1px solid var(--border, #c5cae9); border-radius: 6px; margin-bottom: .5rem; padding: .6rem .9rem; }
.mat-faq details[open] { border-color: var(--primary, #283593); }
.mat-faq summary { cursor: pointer; font-weight: 600; font-size: .95rem; list-style: none; padding-right: 1.4rem; position: relative; }
.mat-faq summary::-webkit-details-marker { display: none; }
.mat-faq summary::after { content: '+'; position: absolute; right: 0; color: var(--primary, #283593); font-size: 1.1rem; line-height: 1; }
.mat-faq details[open] summary::after { content: '−'; }
.mat-faq details p { margin: .6rem 0 .2rem; font-size: .92rem; line-height: 1.65; color: #444; }

/* ── Header grid (two-column layout) ────────────────────────── */
.mat-header-grid {
    max-width: 1040px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 720px) {
    .mat-header-grid { grid-template-columns: 1fr; }
}

/* ── Insight box (dataset snapshot) ─────────────────────────── */
.mat-insight-box {
    background: #f0f7ff;
    border: 1px solid var(--border, #c5cae9);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}
.mat-insight-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary, #283593);
    margin: 0 0 .6rem;
}
.mat-insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .9rem;
    line-height: 1.7;
    color: #333;
}
.mat-insight-list li { border-bottom: 1px solid #e8eaf6; padding: .2rem 0; }
.mat-insight-list li:last-child { border-bottom: none; }

/* ── Context card ────────────────────────────────────────────── */
.mat-context-card {
    margin-top: .8rem;
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    border-radius: 0 6px 6px 0;
    padding: .7rem 1rem;
    font-size: .88rem;
    color: #444;
    line-height: 1.6;
}
.mat-context-label {
    font-weight: 700;
    font-size: .85rem;
    color: #c43e00;
    margin: 0 0 .3rem;
}
.mat-context-card p:last-child { margin: 0; }
.mat-context-card a { color: var(--primary, #283593); }

/* ── Related tools section ───────────────────────────────────── */
.mat-related {
    max-width: 1120px;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    margin-top: 2.5rem;
    padding: 0 1rem;
    box-sizing: border-box;
}
.mat-related-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary, #283593);
    margin-bottom: 1rem;
}
.mat-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.mat-related-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1rem;
    border: 1px solid #dde;
    border-top: 3px solid var(--card-accent, var(--primary, #283593));
    border-radius: 8px;
    text-decoration: none;
    background: #fff;
    min-height: 140px;
    transition: box-shadow .18s, transform .18s;
}
.mat-related-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.mat-related-icon { font-size: 2.25rem; flex-shrink: 0; line-height: 1; color: var(--card-accent, #283593); }
.mat-related-icon svg { width: 38px; height: 38px; flex-shrink: 0; }
.mat-related-body { display: flex; flex-direction: column; gap: .25rem; }
.mat-related-name { font-size: .9rem; font-weight: 700; color: #1a1a2e; }
.mat-related-desc { font-size: .8rem; color: #555; margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
