﻿/* =========================================================
   GLOBAL THEME VARIABLES & RESETS
   ========================================================= */

:root {
    --txt: #0f172a;
    --muted: #475569;
    --bg: #f7f8fb;
    --card: #ffffff;
    --br: #e5e7eb;
    --brand: #0ea5e9;
    --brand-dk: #0284c7;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--txt);
    font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Generic centered container (used heavily on Index) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* =========================================================
   APP SHELL / LAYOUT (MainLayout)
   ========================================================= */

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f9fafb;
}

.page-header {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.page-main {
    flex: 1;
}

/* Main body wrapper used by MainLayout */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0rem;
}

.page-footer {
    border-top: 1px solid #e5e7eb;
    background: #111827;
    color: #e5e7eb;
}

/* Simple content container if you wrap page bodies yourself */
.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* =========================================================
   HEADER / APP NAV (Shared/AppNav.razor)
   ========================================================= */

.app-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: transparent; /* Light header over white */
    color: var(--txt);
    box-shadow: none;
}

    .app-nav .nav-inner {
        max-width: 1100px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .app-nav .brand {
        font-weight: 700;
        text-decoration: none;
        color: var(--txt);
        letter-spacing: 0.2px;
    }

    /* Mobile menu toggle button */
    .app-nav .hamburger {
        display: none;
        background: transparent;
        border: 1px solid #e5e7eb;
        color: rgb(14, 165, 233);
        /*   color: #fff;*/
        padding: 0.5rem 0.65rem;
        border-radius: 0.35rem;
        font-size: 1.2rem; /* bigger icon */
    }

    /* Desktop menu row */
    .app-nav .menu {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .app-nav .link {
        color: var(--muted);
        text-decoration: none;
        padding: 0.25rem 0.5rem;
        border-radius: 0.35rem;
        font-size: 0.95rem;
    }

        .app-nav .link:hover {
            background: rgba(148, 163, 184, 0.12);
            color: var(--txt);
        }

    /* Active NavLink */
    .app-nav .menu a.active {
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
    }

    /* CTA buttons in header (Become Seller/Buyer) */
    .app-nav .cta {
        background: var(--brand);
        color: #001018;
        padding: 0.35rem 0.6rem;
        border-radius: 0.4rem;
        text-decoration: none;
        font-weight: 600;
    }

        .app-nav .cta:hover {
            filter: brightness(1.05);
        }

    /* Account / user cluster */
    .app-nav .account {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        margin-left: 0.25rem;
    }

    .app-nav .hello {
        font-size: 0.9rem;
        opacity: 0.9;
    }

    .app-nav .logout-form {
        display: inline;
    }

    /* Logout button – light version */
    .app-nav .logout {
        background: transparent;
        color: var(--muted);
        border: 1px solid #d1d5db;
        padding: 0.25rem 0.5rem;
        border-radius: 0.35rem;
        cursor: pointer;
        font-size: 0.9rem;
    }

        .app-nav .logout:hover {
            background: #f3f4f6;
            color: #111827;
        }

/* --- Header: Mobile menu behaviour (Super Polished Premium Version) --- */
@media (max-width: 860px) {

    .app-nav .hamburger {
        display: inline-block;
    }

    .app-nav .menu {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #ffffff;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        /* CLOSED STATE: no visible height, no padding, no border, no shadow */
        max-height: 0;
        overflow: hidden;
        padding: 0 1.2rem 0 1.2rem; /* horizontal only, no vertical */
        border-radius: 0 0 14px 14px;
        border-width: 0;
        border-style: solid;
        border-color: #e5e7eb;
        box-shadow: none;
        transform-origin: top;
        transition: max-height 0.35s cubic-bezier(.25, .8, .25, 1), padding 0.25s ease-out, border-width 0.25s ease-out, box-shadow 0.25s ease-out;
    }

        .app-nav .menu.open {
            /* OPEN STATE: actual height + padding + border + shadow */
            max-height: 500px; /* tall enough for all items */
            padding: 0.9rem 1.2rem 1.4rem 1.2rem; /* add vertical padding when open */
            border-width: 1px;
            box-shadow: 0 12px 35px rgba(0,0,0,0.08);
        }

        /* Individual links */
        .app-nav .menu .link,
        .app-nav .menu .logout {
            display: block;
            padding: 10px 4px;
            color: #0f172a !important;
            border-radius: 8px;
        }

            .app-nav .menu .link:hover {
                background: #f3f4f6;
            }

        /* CTA buttons */
        .app-nav .menu .cta {
            background: var(--brand);
            color: #001018 !important;
            padding: 10px 14px;
            border-radius: 10px;
            margin-top: 6px;
        }
}

/* --- Header: Mobile menu behaviour (Light Clean Version) --- */
/*@media (max-width: 860px) {

    .app-nav .hamburger {
        display: inline-block;
    }

    .app-nav .menu {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #ffffff;*/ /* clean white dropdown */
        /*display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        padding: 0.9rem 1.2rem 1.2rem;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 4px 14px rgba(0,0,0,0.08);*/ /* gentle shadow */

        /*animation: menuFadeDown 0.18s ease-out;
        border-radius: 0 0 12px 12px;*/ /* soft rounded bottom */
    /*}

        .app-nav .menu.open {
            display: flex;
        }*/

        /* Links inside the mobile dropdown */
        /*.app-nav .menu .link,
        .app-nav .menu .logout {
            color: #0f172a !important;
            background: transparent;
            padding: 8px 2px;
            width: 100%;
            border-radius: 6px;
        }

            .app-nav .menu .link:hover {
                background: #f3f4f6;
                color: #0f172a;
            }*/

        /* CTA buttons (Become Seller/Buyer) */
        /*.app-nav .menu .cta {
            width: 100%;
            background: var(--brand);
            color: #001018 !important;
            padding: 10px 14px;
            border-radius: 8px;
            margin-top: 4px;
        }*/

    /* Simple fade-drop animation */
    /*@keyframes menuFadeDown {
        from {
            opacity: 0;
            transform: translateY(-6px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}*/





/* =========================================================
   FOOTER (Shared/ALFooter.razor)
   ========================================================= */

.site-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #0b1220;
    color: #c7d2fe;
}

    .site-footer .footer-inner {
        max-width: 1100px;
        margin: 0 auto;
        padding: 0.9rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .site-footer .footer-links .link {
        color: #c7d2fe;
        text-decoration: none;
        padding: 0;
    }

        .site-footer .footer-links .link:hover {
            text-decoration: underline;
            color: #fff;
        }

    .site-footer .sep {
        margin: 0 0.5rem;
        opacity: 0.6;
    }

    .site-footer .copy {
        font-size: 0.875rem;
        opacity: 0.8;
    }

@media (max-width: 860px) {
    .site-footer .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}

/* =========================================================
   TYPOGRAPHY HELPERS
   ========================================================= */

.page-title {
    margin: 16px 0 8px;
}

.lede {
    color: #374151;
    max-width: 75ch;
    margin-top: 1px;
    margin-bottom:1px;
}

.muted {
    color: #6b7280;
}

/* =========================================================
   BUTTONS & LINKS
   ========================================================= */

/* Generic button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #111827;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    gap: 6px;
}

/* Marketing primary button (hero etc.) */
.btn-primary {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}

    .btn-primary:hover {
        background: var(--brand-dk);
    }

/* Secondary button */
.btn-secondary {
    background: #ffffff;
    color: #111827;
    border-color: #9ca3af;
}

/* Disabled buttons */
.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

/* Simple underline link helper (not for NavLink) */
.link {
    text-decoration: underline;
    text-underline-offset: 2px;
    color: inherit;
}

/* =========================================================
   GENERIC LAYOUT UTILITIES
   ========================================================= */

/* Generic grid (Index, Latest, Testimonials, etc.) */
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, 1fr);
}

/* CTA rows/stacks */
.cta-row,
.cta-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

/* For responsive 2–4 column card grids (Buy page etc.) */
.grid.cards,
.grid-card {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Two-column content blocks (About, Seller) */
.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Full-width child in grid forms (contact textarea, submit) */
.grid .full {
    grid-column: 1 / -1;
}

/* =========================================================
   FORM ELEMENTS & VALIDATION
   ========================================================= */

label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

input,
select,
textarea {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 0.95rem;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
}

/* Blazor validation messages */
.validation-message {
    color: #b91c1c;
    font-size: 0.85rem;
}

/* =========================================================
   INDEX / HOME PAGE – HERO, KVP, CAROUSELS, MARKET DAY
   ========================================================= */

/* Hero banner */
.hero {
    position: relative;
    margin-top: 16px;
    padding-top: 0px;
}

.hero-bg img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 12px;
}

.hero-overlay {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
}

/* Hero search grid */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 8px;
}

    .hero-grid select,
    .hero-grid input {
        padding: 10px 12px;
        border: 1px solid var(--br);
        border-radius: 10px;
    }

/* Key Value Propositions */
.kvs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kv-icn {
    font-size: 22px;
}

.kv-title {
    font-weight: 700;
    margin-top: 6px;
}

.kv-text {
    color: var(--muted);
}

/* Section header with tabs (Featured by State, etc.) */
.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

h3 {
    margin: 0 0 8px 0;
}

/* Tabs for state selector */
.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tab {
    border: 1px solid var(--br);
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
}

    .tab.active {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
    }

/* Horizontal car cards carousel */
.carousel-wrap {
    position: relative;
}

.carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 6px 48px;
}

    .carousel::-webkit-scrollbar {
        height: 8px;
    }

    .carousel::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 8px;
    }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--br);
    background: #fff;
    cursor: pointer;
}

    .carousel-btn.left {
        left: 6px;
    }

    .carousel-btn.right {
        right: 6px;
    }

/* Car cards used in carousels and grids */
.car-card {
    min-width: 220px;
    border: 1px solid var(--br);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

    .car-card img {
        width: 100%;
        height: 140px;
        object-fit: cover;
        border-radius: 8px;
    }

    .car-card .price {
        font-weight: 800;
        margin-top: 6px;
    }

    .car-card .title {
        color: var(--txt);
    }

    .car-card .meta {
        color: var(--muted);
        font-size: 14px;
    }

/* "View all" link under carousels */
.view-all {
    margin-top: 8px;
}

    .view-all a {
        color: var(--brand-dk);
        text-decoration: none;
    }

/* Market Day info bar (inside Index) */
.marketday.card {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    align-items: center;
    gap: 16px;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.md-left .md-kicker {
    color: #0369a1;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.md-title {
    font-size: 20px;
    font-weight: 800;
}

.md-sub {
    color: var(--muted);
}

.md-count {
    display: flex;
    gap: 10px;
}

.md-box {
    background: #fff;
    border: 1px solid var(--br);
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
}

.md-num {
    font-size: 22px;
    font-weight: 800;
}

.md-lbl {
    color: var(--muted);
    font-size: 12px;
}

.md-ctas a {
    margin-left: 8px;
}

/* Testimonials strip */
.testimonials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.t-quote {
    font-style: italic;
}

.t-user {
    color: var(--muted);
    margin-top: 6px;
}

/* Under construction banner on top of Index */
.under-construction-banner {
    background: linear-gradient(90deg, #ffcc00, #ff9900);
    color: #222;
    text-align: center;
    padding: 10px 0;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid #e68a00;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   INDEX – DEALER SECTION (In-House Dealer Cars)
   ========================================================= */

.section-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid var(--br);
}

/* Dealer body-type filters – row of pills */
#dealer .filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    border: 1px solid var(--br);
    background: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
}

    .filter-pill.on {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
    }

/* =========================================================
   RESPONSIVE TWEAKS – HOME PAGE
   ========================================================= */

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kvs {
        grid-template-columns: 1fr 1fr;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .testimonials {
        grid-template-columns: 1fr;
    }

    .marketday.card {
        grid-template-columns: 1fr;
    }
}

/* Latest Listings: 1 per row on phones */
@media (max-width: 700px) {
    .latest-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   BUY PAGE (Buy.razor) – FILTERS & LIST GRID
   ========================================================= */

.buy-layout {
    display: grid;
    gap: 16px;
}

    /* Buy page filters row – scoped to Buy layout only */
    .buy-layout .filters {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        align-items: end;
    }

.results-meta {
    color: #374151;
}

/* Card grid for Buy results */
.grid.buy-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* Generic card styling used across pages */
.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/*    .card img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        background: #f3f4f6;
    }*/

    .card > img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        background: #f3f4f6;
    }

.card-body {
    padding: 12px;
    display: grid;
    gap: 8px;
}

.card .title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.2;
}

/* Meta line inside cards (location, km, etc.) */
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 0.95rem;
    color: #374151;
}

.price {
    font-weight: 700;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Empty state box */
.empty {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    padding: 16px;
    border-radius: 12px;
}

/* Pager controls */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
}

.pg-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
}

    .pg-btn[disabled] {
        pointer-events: none;
        opacity: 0.5;
    }

/* =========================================================
   SELLER INFO PAGE (Sell.razor)
   ========================================================= */

.seller-hero {
    display: grid;
    gap: 2px;
    padding:8px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.seller-steps,
.seller-benefits,
.seller-faq,
.seller-final-cta {
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    padding: 8px;
    margin-top: 2px;
    margin-bottom: 2px;
}

    .seller-steps ol,
    .seller-benefits ul {
        padding-left: 18px;
        display: grid;
        gap:2px;


    }

/* =========================================================
   ABOUT PAGE (About.razor)
   ========================================================= */

.about-hero {
    display: grid;
    gap: 12px;
    padding: 16px 0;
}

.about-columns {
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.about-values,
.about-founder,
.about-faq,
.about-contact,
.about-final-cta {
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    padding: 6px 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 0.95rem;
}

/* =========================================================
   CONTACT PAGE (Contact.razor)
   ========================================================= */

.contact-hero {
    display: grid;
    gap: 12px;
    padding: 16px 0;
}

.contact-options {
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

    .contact-options ul {
        padding-left: 18px;
        display: grid;
        gap: 6px;
    }

.contact-form {
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

    /* Contact form two-column layout */
    .contact-form .grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

.sent {
    margin-top: 10px;
    color: #065f46;
}

/* =========================================================
   PRIVACY PAGE (Privacy.razor)
   ========================================================= */

.doc {
    display: grid;
    gap: 12px;
    max-width: 80ch;
}

    .doc h1 {
        margin: 8px 0;
    }

    .doc h2 {
        margin-top: 16px;
    }

    .doc ul {
        padding-left: 18px;
        display: grid;
        gap: 6px;
    }

/* =========================================================
   DETAILS / FAQ (Accordion helpers)
   ========================================================= */

details {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0;
}

summary {
    cursor: pointer;
    font-weight: 600;
}

/* =========================================================
   MARKET DAY (MarketDay.razor)
   ========================================================= */
.marketday-hero,
.marketday-how,
.marketday-benefits,
.marketday-next,
.marketday-faq,
.marketday-final-cta {
    padding: 20px 0;
}
