/* ==========================================================================
   TGF Company Explorer
   ==========================================================================
   Themable via CSS custom properties on .tgf-explorer:
     --tgf-ex-bg, --tgf-ex-panel-bg, --tgf-ex-accent, --tgf-ex-text,
     --tgf-ex-muted, --tgf-ex-radius
   ========================================================================== */

.tgf-explorer {
    /* GradeIt brand palette */
    --tgf-ex-bg:       transparent;
    --tgf-ex-panel-bg: rgba(255,255,255,0.04);
    --tgf-ex-accent:         #F15F51;  /* coral — primary brand */
    --tgf-ex-accent-2:       #60C7CB;  /* teal — secondary highlight */
    --tgf-ex-accent-warm:    #F8AA4A;  /* orange — turnaround pills */
    --tgf-ex-accent-yellow:  #FBCC0A;  /* yellow — default-option highlight */
    --tgf-ex-text:     #f4f5f7;
    --tgf-ex-muted:    rgba(244, 245, 247, 0.65);
    --tgf-ex-border:   rgba(255,255,255,0.08);
    --tgf-ex-radius:   16px;

    color: var(--tgf-ex-text);
    background: var(--tgf-ex-bg);
    border-radius: var(--tgf-ex-radius);
    padding: 24px;
    margin: 40px auto;
    max-width: 1200px;
}

/* -------- Top tabs (companies) -------- */
.tgf-explorer__tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 28px;
}
.tgf-explorer__tab {
    appearance: none;
    background: transparent;
    color: var(--tgf-ex-text);
    border: 1px solid var(--tgf-ex-border);
    border-radius: 999px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.tgf-explorer__tab:hover {
    border-color: var(--tgf-ex-accent);
    transform: translateY(-1px);
}
.tgf-explorer__tab.is-active {
    background: var(--tgf-ex-accent);
    border-color: var(--tgf-ex-accent);
    color: #fff;
}
.tgf-explorer__tab-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* -------- Panels -------- */
.tgf-explorer__panel {
    display: none;
    background: var(--tgf-ex-panel-bg);
    border-radius: var(--tgf-ex-radius);
    padding: 28px;
    border: 1px solid var(--tgf-ex-border);
    animation: tgfFadeIn 0.25s ease;
}
.tgf-explorer__panel.is-active { display: block; }

@keyframes tgfFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.tgf-explorer__header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.tgf-explorer__logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 8px;
}
.tgf-explorer__intro {
    flex: 1 1 240px;
    min-width: 0;
}
.tgf-explorer__title {
    font-size: 26px;
    margin: 0 0 6px 0;
    font-weight: 800;
    color: var(--tgf-ex-text);
    letter-spacing: -0.01em;
}
.tgf-explorer__blurb {
    margin: 0 0 10px 0;
    color: var(--tgf-ex-muted);
    line-height: 1.5;
}
.tgf-explorer__facts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.tgf-explorer__fact {
    background: rgba(255,255,255,0.06);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    /* Flex with an explicit gap so the label + value never run together
       (e.g. "From:R825.00" because the trailing space got collapsed). */
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.tgf-explorer__fact strong {
    color: var(--tgf-ex-muted);
    font-weight: 600;
}

/* Subtabs (collectable types) */
.tgf-explorer__subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tgf-ex-border);
}
.tgf-explorer__subtab {
    appearance: none;
    background: transparent;
    color: var(--tgf-ex-text);
    border: 1px solid var(--tgf-ex-border);
    border-radius: 8px;
    padding: 6px 14px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.tgf-explorer__subtab:hover {
    border-color: var(--tgf-ex-accent-2);
}
.tgf-explorer__subtab.is-active {
    background: var(--tgf-ex-accent-2);   /* teal — secondary brand, distinct from company tabs */
    color: #0d0908;
    border-color: var(--tgf-ex-accent-2);
    font-weight: 700;
}

.tgf-explorer__subpanel { display: none; }
.tgf-explorer__subpanel.is-active { display: block; animation: tgfFadeIn 0.2s ease; }

/* Slabs grid inside subpanel */
.tgf-explorer__slabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px 24px;
    margin-bottom: 32px;
    padding: 8px 0;
}

/* Pricing-model note shown above the service-levels / add-ons grid.
   Clarifies that the per-option pills (+R150, −R225, Included) are MODIFIERS to
   the company's base grading price, not standalone amounts. */
.tgf-explorer__pricing-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 10px 14px;
    background: rgba(96, 199, 203, 0.10);          /* brand teal tint */
    border: 1px solid rgba(96, 199, 203, 0.28);
    border-left: 3px solid var(--tgf-ex-accent-2); /* solid teal accent on the leading edge */
    border-radius: 10px;
    color: var(--tgf-ex-text);
    font-size: 13px;
    line-height: 1.45;
}
.tgf-explorer__pricing-note-text { flex: 1 1 auto; min-width: 0; }
.tgf-explorer__pricing-note strong {
    color: var(--tgf-ex-text);
    font-weight: 800;
}
.tgf-explorer__pricing-note-delta {
    color: var(--tgf-ex-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.tgf-explorer__pricing-note-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tgf-ex-accent-2);
    color: #0d0908;
    font-weight: 800;
    font-style: italic;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
}

/* Service / add-on sections — side-by-side on desktop, stacked on mobile.
   Only splits when BOTH sections exist (the .tgf-explorer__sections--split class). */
.tgf-explorer__sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
@media (min-width: 900px) {
    .tgf-explorer__sections--split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 24px;
        align-items: start;
    }
    .tgf-explorer__sections--split .tgf-explorer__section { margin-top: 0; }
}
.tgf-explorer__section {
    margin: 28px 0;
    min-width: 0;   /* lets grid columns shrink so long pills don't break layout */
}
.tgf-explorer__section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tgf-ex-muted);
    margin: 0 0 14px 0;
    font-weight: 700;
}
.tgf-explorer__field {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--tgf-ex-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
}
.tgf-explorer__field-label {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}
.tgf-explorer__field-desc {
    color: var(--tgf-ex-muted);
    font-size: 13px;
    margin-bottom: 10px;
}
/* Field head: label on the left, optional hoisted turnaround pill on the right.
   Used when every option in the field shares the same turnaround. */
.tgf-explorer__field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.tgf-explorer__field-head .tgf-explorer__field-label {
    margin-bottom: 0;
}
.tgf-explorer__field-turnaround {
    display: inline-flex;
    align-items: center;
    color: #1f1410;
    font-size: 12px;
    font-weight: 700;
    background: var(--tgf-ex-accent-warm);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tgf-explorer__options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* Each option row: text block on the left grows, pills hug the right edge. */
.tgf-explorer__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}
.tgf-explorer__option-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tgf-explorer__option-meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tgf-explorer__option.is-default {
    background: rgba(255, 112, 67, 0.10);
    border: 1px solid rgba(255, 112, 67, 0.25);
}
.tgf-explorer__option-label {
    font-weight: 600;
}
.tgf-explorer__option-default {
    margin-left: 6px;
    color: var(--tgf-ex-accent-yellow);   /* yellow from the logo for the (default) tag */
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.tgf-explorer__option-desc {
    font-size: 12px;
    color: var(--tgf-ex-muted);
    line-height: 1.4;
}

@media (max-width: 540px) {
    /* Stack pills under the text on small screens so neither gets clipped. */
    .tgf-explorer__option {
        flex-direction: column;
        align-items: stretch;
    }
    .tgf-explorer__option-meta {
        justify-content: flex-start;
    }
}
.tgf-explorer__option-price {
    font-family: Menlo, Consolas, monospace;
    font-weight: 700;
    /* GradeIt teal pill with charcoal text — ~10:1 contrast (AAA) and stays on-brand.
       Teal complements the orange turnaround pill on the same row without the visual
       fight that coral + white had. */
    color: #0D0908;
    background: var(--tgf-ex-accent-2);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.tgf-explorer__option-turnaround {
    display: inline-block;
    color: #1f1410;
    font-size: 12px;
    font-weight: 700;
    background: var(--tgf-ex-accent-warm); /* orange from the logo for time/turnaround */
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    margin-right: 4px;
}

/* Paused option (per-option Active/Paused/Disabled status from the option editor) */
.tgf-explorer__option.is-paused {
    opacity: 0.55;
    filter: grayscale(0.7);
}
.tgf-explorer__option.is-paused .tgf-explorer__option-label {
    text-decoration: line-through;
}
.tgf-explorer__option-unavailable {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #1f2937;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
    vertical-align: middle;
    /* full opacity even on grayed-out parents */
    filter: none;
    opacity: 1;
    text-decoration: none;
}

.tgf-explorer__empty {
    text-align: center;
    color: var(--tgf-ex-muted);
    padding: 40px 0;
    font-style: italic;
}
.tgf-explorer-empty {
    padding: 24px;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    text-align: center;
    color: #666;
}

@media (max-width: 600px) {
    .tgf-explorer { padding: 14px; }
    .tgf-explorer__panel { padding: 18px; }
    .tgf-explorer__title { font-size: 22px; }
    .tgf-explorer__option { grid-template-columns: 1fr; }
    .tgf-explorer__option-price { justify-self: start; }
}

/* Paused tab + panel — grayed out + paused banner */
.tgf-explorer__tab.is-paused {
    opacity: 0.6;
    filter: grayscale(0.7);
}
.tgf-explorer__tab.is-paused .tgf-explorer__tab-name {
    text-decoration: line-through;
}
.tgf-explorer__tab-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #1f2937;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
    vertical-align: middle;
}
.tgf-explorer__panel.is-paused {
    position: relative;
}
.tgf-explorer__panel.is-paused .tgf-explorer__header,
.tgf-explorer__panel.is-paused .tgf-explorer__slabs,
.tgf-explorer__panel.is-paused .tgf-explorer__section,
.tgf-explorer__panel.is-paused .tgf-explorer__subtabs,
.tgf-explorer__panel.is-paused .tgf-explorer__subpanel {
    opacity: 0.55;
    filter: grayscale(0.6);
    pointer-events: none;
}
.tgf-explorer__paused-banner {
    background: #1f2937;
    color: #fff;
    border-radius: var(--tgf-ex-radius);
    padding: 14px 18px;
    margin-bottom: 18px;
    text-align: center;
}
.tgf-explorer__paused-banner strong {
    display: block;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.tgf-explorer__paused-banner span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.8;
}
