/*
 * otosorgu-ui-results.css: page-group styles of G3 "results and samples" (OWL-UI-4).
 * Own file, loaded only by the result/sample views through their `@section styles` (Sorgu/*Ornek), after otosorgu-ui.css.
 * Tokens and components come from otosorgu-ui.css; this file only adds the result CARD (header, body wrapper, footer).
 * Look only: no selector depends on a URL, a form field name/id or a script hook.
 * The HTML that comes from the DB / report engine (inside .ou-result__body) is NOT restyled: the body only scrolls
 * sideways when the content is wider than the card. Report images are never scaled (decisions.md, 2026-11-09).
 */

/* 1. Card ---------------------------------------------------------------------------------- */
#Content .section_wrapper.ou-result { margin-top: var(--ou-s6) !important; box-sizing: border-box; }
#Content .ou-result > * + * { margin-top: var(--ou-s5); }

/* 2. Header: title + status pill, then the plate / chassis meta ------------------------------ */
.ou-result__head { padding-bottom: var(--ou-s4); border-bottom: 1px solid var(--ou-line); }
.ou-result__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ou-s2) var(--ou-s3); }
#Content .ou-result__title { margin: 0; padding: 0; text-align: left; font-size: var(--ou-fs-lg); line-height: 1.3; font-weight: 500; }
.ou-pill {
    display: inline-flex; align-items: center; gap: var(--ou-s1); min-height: 28px; padding: 0 var(--ou-s3);
    border: 1px solid var(--ou-line-strong); border-radius: var(--ou-r-pill); background: var(--ou-canvas); color: var(--ou-ink);
    font-size: var(--ou-fs-xs); font-weight: 500; line-height: 1; white-space: nowrap;
}
.ou-pill__icon { font-family: "Material Icons Round"; font-size: 16px; line-height: 1; font-weight: normal; font-style: normal; letter-spacing: normal; text-transform: none; font-feature-settings: 'liga'; }
.ou-pill--success { background: var(--ou-success-bg); border-color: var(--ou-success-line); color: var(--ou-success-ink); }
.ou-pill--warning { background: var(--ou-warning-bg); border-color: var(--ou-warning-line); color: var(--ou-warning-ink); }
.ou-pill--error { background: var(--ou-error-bg); border-color: var(--ou-error-line); color: var(--ou-error-ink); }
.ou-result__meta { display: flex; flex-wrap: wrap; gap: var(--ou-s3) var(--ou-s6); margin: var(--ou-s4) 0 0; padding: 0; }
.ou-result__meta > div { min-width: 0; }
.ou-result__meta dt { margin: 0 0 var(--ou-s1); padding: 0; font-size: var(--ou-fs-xs); font-weight: 500; color: var(--ou-muted); }
.ou-result__meta dd { margin: 0; padding: 0; font-size: var(--ou-fs-md); font-weight: 500; color: var(--ou-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* The plate / chassis number reads as a label, not as body text. */
.ou-result__subject {
    display: inline-block; padding: 2px var(--ou-s3); border: 1px solid var(--ou-line-strong); border-radius: var(--ou-r-control);
    background: var(--ou-canvas); font-weight: 700 !important; letter-spacing: .06em; text-transform: uppercase;
}

/* 3. Body: the DB / report HTML sits in here untouched ------------------------------------- */
#Content .ou-result__body { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#Content .ou-result__body:empty { display: none; }
/* Report image: shown at its own size and scrolled, never scaled down (Okan, 2026-11-09). */
.ou-result__image { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ou-result__image img { display: block; max-width: none; width: auto; height: auto; }

/* 4. Messages and sections written by the view itself (Borc) --------------------------------- */
#Content .ou-result__section-title { margin: var(--ou-s3) 0 0; padding: 0; font-size: var(--ou-fs-md); line-height: 1.4; font-weight: 700; color: var(--ou-ink); }
#Content .ou-result__section-title:first-child { margin-top: 0; }
/* The old .ou-result__note messages now use the shared notice (_Alert, otosorgu-ui.css section 6; OWL-UI-12c). */

/* Data tables written by the view (not the report engine): same table look as DESIGN.md section 3. */
.ou-result__scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--ou-line); border-radius: var(--ou-r-control); }
#Content table.ou-result__table { width: 100%; min-width: 480px; margin: 0; border: 0; border-collapse: collapse; font-size: var(--ou-fs-sm); font-variant-numeric: tabular-nums; background: var(--ou-surface); }
#Content table.ou-result__table th { padding: var(--ou-s3) var(--ou-s4); background: var(--ou-canvas); border: 0; border-bottom: 1px solid var(--ou-line); font-size: var(--ou-fs-sm); font-weight: 500; text-align: left; color: var(--ou-ink); white-space: nowrap; }
#Content table.ou-result__table td { height: 48px !important; padding: var(--ou-s2) var(--ou-s4); border: 0; border-bottom: 1px solid var(--ou-line); color: var(--ou-ink); text-align: left; }
#Content table.ou-result__table tbody tr:last-child td { border-bottom: 0; }
#Content table.ou-result__table tbody tr:hover td { background: #fafafa; }

/* 5. Footer: image, legal text, report button ---------------------------------------------- */
.ou-result__foot { padding-top: var(--ou-s4); border-top: 1px solid var(--ou-line); }
/* A result without a body (header, then footer only): one hairline, not two. */
.ou-result__head + .ou-result__foot { padding-top: 0; border-top: 0; }
#Content .ou-result__foot .smalltext { margin: 0; }
#Content .ou-result__foot .button { width: auto; align-self: flex-start; margin: 0; }
#Content .ou-result__actions { display: flex; flex-wrap: wrap; gap: var(--ou-s2); margin-top: var(--ou-s5); }
#Content .ou-result__actions .button { margin: 0; }

/* 6. Result cards of the query pages (OWL-UI-18b): the same look as the sample results ------------------------------
   Markup: card `.ou-result`, heading line `.ou-result-line` (text unchanged), provider HTML in `.ou-result__body.ou-scroll`. */
#Content .ou-result > .column_attr { display: flex; flex-direction: column; gap: var(--ou-s3); min-width: 0; }
/* The old markup spaces with <br>; the card gap does that now (Borc message no longer sits on the button, no empty bands). */
#Content .ou-result > .column_attr > br { display: none; }
#Content .ou-result .ou-result-line { text-align: left; text-wrap: balance; overflow-wrap: anywhere; }
#Content .ou-result .ou-result-plate { display: inline-block; max-width: 100%; }
/* Report button: natural width like the sample result, not full width. */
#Content .ou-result > .column_attr > a.button[button="view"], #Content .ou-result > a.button[button="view"] { width: auto; align-self: flex-start; margin: 0; }
/* Direct-child report button (Borc): the card gap (--ou-s5) replaces the old <br>; this rule must not reset it to 0 (OWL-UI-18b fix round). */
#Content .ou-result > a.button[button="view"] { display: inline-flex; width: fit-content; margin-top: var(--ou-s5); }
/* Keep the last words of the heading together so "sonucu:" never stands alone on the last line. */
#Content .ou-result .ou-result-line .ou-nowrap { white-space: nowrap; }
/* Provider tables and the view's own tables scroll inside the card, never clip (A11). */
#Content .ou-result .ou-result__body.ou-scroll { max-width: 100%; overflow-x: auto; }
#Content .ou-result .ou-result__scroll.ou-scroll { margin-bottom: var(--ou-s2); }
/* KM table: no forced min-width, so the KM column is visible without sideways scrolling; the vehicle column wraps. */
#Content table.ou-result__table--km { min-width: 0; }
#Content table.ou-result__table--km th, #Content table.ou-result__table--km td { padding-left: var(--ou-s3); padding-right: var(--ou-s3); }
#Content table.ou-result__table--km td:first-child, #Content table.ou-result__table--km td:last-child { white-space: nowrap; }
/* Provider tables (DB / report HTML): every cell gets a floor so a column such as "Sigorta Şirketi" is not squeezed to one word per line. */
#Content .ou-result .ou-result__body table th, #Content .ou-result .ou-result__body table td { min-width: 96px; }
/* OWL-UI-15c: amounts ("6.599,00 TL") never wrap; scoped to money cells/classes (the same class also lives in otosorgu-ui-tables.css for the panel pages). */
.ou-money, #Content table.ou-result__table td.ou-money, .ou-qinfo__facts dd.ou-money { white-space: nowrap; }
/* A long chassis / plate value stays inside its chip (G3-6). */
.ou-result__subject { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }

@media (max-width: 639px) {
    #Content .ou-result > .column_attr > a.button[button="view"], #Content .ou-result > a.button[button="view"] { width: 100%; align-self: stretch; }
    .ou-result__subject { letter-spacing: .02em; }
    #Content .ou-result__foot .button, #Content .ou-result__actions .button { width: 100%; align-self: stretch; }
    .ou-result__meta { gap: var(--ou-s3) var(--ou-s5); }
    #Content .section_wrapper.ou-result { margin-top: var(--ou-s4) !important; }
}
