/*
  File: SDAI_Screens.css
  Purpose: Screen-level styling for the vehicle type question renderer.
  Architecture Role: Styles the screen container, tile grid, selection state, and local footer actions.
  Expected Collaborators: SDAI_RenderTileSelect.js and SDAI_CarFinderHost.jspf.
  Scaffold Status: Working styling for the first question screen.
*/
#SDAI_ChatAIPage .sdai-screen-host {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
}

#SDAI_ChatAIPage .sdai-screen-host__inner {
    display: flex;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    width: 100%;
    min-width: 0;
}

#SDAI_ChatAIPage .sdai-screen {
    --sdai-tile-min-width: 180px;
    --sdai-tile-max-width: 240px;
    --sdai-tile-gap: 16px;
    --sdai-tile-body-min-height: 82px;
    --sdai-tile-body-padding-y: var(--sdai-space-2);
    --sdai-tile-body-padding-x: var(--sdai-space-3);
    --sdai-tile-logo-padding: clamp(0.85rem, 4%, 1.35rem);
    --sdai-tile-media-aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--sdai-color-surface);
    border: 0;
    border-radius: 0;
    padding: var(--sdai-space-4) 0 0;
    box-shadow: none;
    overflow-x: hidden;
    width: 100%;
}

#SDAI_ChatAIPage .sdai-screen__header {
    flex: 0 0 auto;
    padding: 0 0 var(--sdai-space-3);
    text-align: center;
}

#SDAI_ChatAIPage .sdai-screen__title {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

#SDAI_ChatAIPage .sdai-screen__subtitle,
#SDAI_ChatAIPage .sdai-screen__help {
    margin: var(--sdai-space-2) 0 0;
    color: var(--sdai-color-text-soft);
    font-size: 1.05rem;
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
}

#SDAI_ChatAIPage .sdai-screen__content {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

#SDAI_ChatAIPage .sdai-screen__grid-viewport {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--sdai-space-1) 0 var(--sdai-space-3);
    scrollbar-gutter: stable;
}

#SDAI_ChatAIPage .sdai-screen__footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    margin-top: auto;
    padding: var(--sdai-space-3) 0 var(--sdai-space-3);
    border-top: 1px solid rgba(216, 225, 234, 0.85);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255,255,255,0.94) 22%, var(--sdai-color-surface) 100%);
}

#SDAI_ChatAIPage .sdai-screen__footer-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 0 0 auto;
    align-items: center;
    justify-content: stretch;
    gap: var(--sdai-space-2);
    width: 100%;
}

#SDAI_ChatAIPage .sdai-tile-grid {
    display: grid;
    width: 100%;
    max-width: none;
    margin: 0;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(var(--sdai-tile-min-width), var(--sdai-tile-max-width)));
    gap: var(--sdai-tile-gap);
    max-width: 100%;
    align-items: stretch;
    align-content: start;
    justify-content: center;
}

#SDAI_ChatAIPage .sdai-tile {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--sdai-tile-max-width);
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 22px;
    background: var(--sdai-color-surface);
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

#SDAI_ChatAIPage .sdai-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

#SDAI_ChatAIPage .sdai-tile:focus-visible {
    outline: 2px solid var(--sdai-color-primary);
    outline-offset: 2px;
}

#SDAI_ChatAIPage .sdai-tile--selected,
#SDAI_ChatAIPage .sdai-tile[aria-pressed="true"] {
    border-color: var(--sdai-color-selected-border);
    background: var(--sdai-color-selected-bg);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35), 0 22px 40px rgba(22, 163, 74, 0.18);
}

#SDAI_ChatAIPage .sdai-tile__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: var(--sdai-tile-media-aspect-ratio);
    min-height: 0;
    padding: 0;
    background: linear-gradient(135deg, #f3f7fb 0%, #e4edf5 100%);
    overflow: hidden;
}

#SDAI_ChatAIPage .sdai-tile__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

#SDAI_ChatAIPage .sdai-tile__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    color: var(--sdai-color-primary);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#SDAI_ChatAIPage .sdai-tile__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sdai-space-1);
    min-width: 0;
    padding: var(--sdai-tile-body-padding-y) var(--sdai-tile-body-padding-x) calc(var(--sdai-tile-body-padding-y) + 0.2rem);
    min-height: var(--sdai-tile-body-min-height);
}

#SDAI_ChatAIPage .sdai-tile__label {
    min-width: 0;
    font-size: clamp(1.2rem, 1.1vw, 1.55rem);
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
}

#SDAI_ChatAIPage .sdai-tile--logo .sdai-tile__media {
    padding: var(--sdai-tile-logo-padding);
}

#SDAI_ChatAIPage .sdai-tile--logo .sdai-tile__image {
    object-fit: contain;
    object-position: center;
}

#SDAI_ChatAIPage .sdai-tile__meta {
    color: var(--sdai-color-text-soft);
    font-size: 0.8rem;
    text-align: center;
    overflow-wrap: anywhere;
}

#SDAI_ChatAIPage .sdai-screen .sdai-button {
    min-width: 112px;
    width: 100%;
}

#SDAI_ChatAIPage .sdai-screen .sdai-button--secondary {
    justify-self: start;
}

#SDAI_ChatAIPage .sdai-screen .sdai-button--ghost {
    justify-self: center;
}

#SDAI_ChatAIPage .sdai-screen .sdai-button--primary {
    justify-self: end;
    min-width: 220px;
    min-height: 56px;
    padding: 0.9rem 1.8rem;
    border-radius: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 16px 30px rgba(13, 111, 209, 0.22);
}

@media (max-width: 640px) {
    #SDAI_ChatAIPage .sdai-screen {
        padding-top: var(--sdai-space-3);
    }

    #SDAI_ChatAIPage .sdai-screen__footer {
        padding-bottom: var(--sdai-space-4);
    }

    #SDAI_ChatAIPage .sdai-screen__footer-actions {
        width: 100%;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    #SDAI_ChatAIPage .sdai-screen__footer-actions .sdai-button {
        min-width: 0;
    }

    #SDAI_ChatAIPage .sdai-tile-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #SDAI_ChatAIPage .sdai-tile {
        max-width: none;
    }
}
