/* ==========================================================================
   Yapay zekâ API fiyatları ve maliyet hesaplayıcı (/yapay-zeka-api-fiyatlari)
   Önek: .apc-  |  Renkler yalnız 00-settings.css token'larından gelir.
   ========================================================================== */

.apc-header .page-header-component__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 0.75rem;
    color: var(--color-text-secondary);
    font-size: var(--font-size-caption);
}

.apc-header .page-header-component__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.apc-header .page-header-component__meta .bi {
    color: var(--color-success);
}

.apc-page {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* --- Çalışma alanı: hesaplayıcı (sol, yapışkan) + sonuçlar --- */

.apc-workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.apc-results {
    min-width: 0;
}

/* --- Hesaplayıcı --- */

.apc-calculator {
    position: sticky;
    top: 96px;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.apc-calculator__title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 1rem;
    color: var(--color-text);
    font-size: 1.0625rem;
    font-weight: 700;
}

.apc-calculator__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: var(--color-brand-action);
    border-radius: var(--radius-md);
    color: var(--color-on-brand-action);
    font-size: 1rem;
}

.apc-presets {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.apc-presets .yz-pill-bar__label {
    flex: 0 0 100%;
}

.apc-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.875rem;
}

.apc-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.apc-field label {
    color: var(--color-text);
    font-size: var(--font-size-caption);
    font-weight: 700;
    line-height: 1.35;
}

.apc-field small {
    color: var(--color-text-muted);
    font-size: var(--font-size-badge);
    line-height: 1.45;
}

/* Etiket, kutu ve açıklama satırları alanlar arasında hizalı: etiket iki satıra kırılsa da
   kutular aynı çizgide başlar (subgrid). Desteklenmeyen tarayıcıda alan dikey flex kalır. */
@supports (grid-template-rows: subgrid) {
    .apc-fields {
        column-gap: 1rem;
        row-gap: 0.875rem;
    }

    .apc-field {
        display: grid;
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: 0.3125rem;
    }

    .apc-field label {
        align-self: end;
    }

    .apc-field small {
        align-self: start;
    }
}

/* --- Sonuç tablosu --- */

.apc-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}

.apc-results-head .section-title {
    margin-bottom: 0;
}

.apc-summary {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-caption);
}

.apc-table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.apc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-caption);
}

.apc-table th,
.apc-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    line-height: 1.45;
}

.apc-table thead th {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: var(--font-size-badge);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.apc-table tbody tr:last-child th,
.apc-table tbody tr:last-child td {
    border-bottom: 0;
}

.apc-table tbody tr:first-child {
    background: var(--color-success-subtle);
}

.apc-table .apc-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.apc-model {
    display: block;
    color: var(--color-text);
    font-size: var(--font-size-body);
    font-weight: 700;
}

.apc-meta,
.apc-sub,
.apc-note {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--font-size-badge);
    font-weight: 400;
}

.apc-note {
    max-width: 360px;
    margin-top: 0.25rem;
    white-space: normal;
}

.apc-tier {
    font-weight: 700;
}

.apc-tier--flagship {
    color: var(--color-info);
}

.apc-tier--balanced {
    color: var(--color-brand-strong);
}

.apc-tier--fast {
    color: var(--color-success);
}

.apc-total {
    color: var(--color-text);
    font-weight: 800;
}

.apc-disclaimer {
    margin: 0.75rem 0 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-badge);
    line-height: 1.55;
}

/* --- Metin, kaynaklar ve SSS --- */

.apc-about {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2.5rem;
    align-items: start;
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

.apc-prose {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.75;
}

.apc-prose p {
    margin-bottom: 1rem;
}

.apc-prose p:last-child {
    margin-bottom: 0;
}

.apc-sources-card {
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.apc-sources-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    color: var(--color-text);
    font-size: 1.0625rem;
    font-weight: 700;
}

.apc-sources-card__title .bi {
    color: var(--color-success);
}

.apc-sources {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

.apc-sources li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.125rem 0.75rem;
    padding: 0.625rem 0;
}

.apc-sources li + li {
    border-top: 1px solid var(--color-border);
}

.apc-sources a {
    color: var(--color-brand-strong);
    font-weight: 700;
    text-decoration: none;
}

.apc-sources a:hover,
.apc-sources a:focus-visible {
    text-decoration: underline;
}

.apc-sources span {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.apc-qa {
    margin-top: 2.5rem;
}

@media (max-width: 1199px) {
    .apc-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .apc-calculator {
        position: static;
    }

    .apc-presets .yz-pill-bar__label {
        flex: 0 0 auto;
    }

    .apc-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .apc-about {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .apc-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Beş alanın sonuncusu (dolar kuru) tek başına yarım kalmasın */
    .apc-field:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 576px) {
    .apc-page {
        padding-top: 1.25rem;
    }

    .apc-calculator {
        padding: 1rem;
    }

    .apc-calculator__title {
        margin-bottom: 0.75rem;
    }

    .apc-presets {
        gap: 0.375rem;
        margin-bottom: 0.875rem;
        padding-bottom: 0.875rem;
    }

    .apc-presets .yz-pill-bar__label {
        flex: 0 0 100%;
    }

    .apc-fields {
        gap: 0.75rem;
    }

    .apc-field label {
        font-size: 0.8125rem;
        line-height: 1.3;
    }

    .apc-field small {
        display: none;
    }

    @supports (grid-template-rows: subgrid) {
        .apc-field {
            grid-row: span 2;
        }
    }

    /* Mobilde tablo, her model bir kart olacak şekilde yeniden dizilir; yatay kaydırma gerekmez. */
    .apc-table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
    }

    .apc-table thead {
        display: none;
    }

    .apc-table,
    .apc-table tbody,
    .apc-table tr {
        display: block;
        width: 100%;
    }

    /* Kart: üst satırda model ve aylık tutar, altında giriş/çıkış/istek başı yan yana. */
    .apc-table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        padding: 0.875rem;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
    }

    .apc-table tbody tr:first-child {
        border-color: var(--color-success-border);
    }

    .apc-table th,
    .apc-table td {
        padding: 0;
        border: 0;
    }

    .apc-table tbody th {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .apc-table td.apc-total {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
        font-size: var(--font-size-body);
    }

    .apc-table td.apc-try {
        grid-column: 1 / -1;
    }

    .apc-table .apc-num {
        text-align: left;
        white-space: normal;
    }

    .apc-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--color-text-muted);
        font-size: var(--font-size-badge);
        font-weight: 700;
    }

    .apc-table td[hidden] {
        display: none;
    }
}
