﻿/* ==========================================================================
   AutoFlick – Ad Form styling
   Works with your existing markup. If you add .ad-form to the outer wrapper,
   everything is scoped; otherwise the generic fallbacks still apply.
   Brand vars come from theme.css
   ========================================================================== */

/* ---------- Page rhythm ---------- */
.ad-form .card,
.card {
    border: 1px solid var(--ae-border);
    border-radius: 14px;
}

    .ad-form .card + .card,
    .card + .card {
        margin-top: 1rem;
    }

/* Title / description a bit bigger for comfort */
.ad-form .form-label,
.form-label {
    font-weight: 600;
    color: #111827;
}

.ad-form input[asp-for="Title"],
.ad-form textarea[asp-for="Description"],
/* generic fallback */
.ad-form input#Title, .ad-form textarea#Description,
input#Title, textarea#Description {
    font-size: 1.05rem;
}

/* ---------- Section headers (brand) ---------- */
.ad-form .card-header,
.card > .card-header {
    background: #eef4ff; /* light brand tint */
    color: var(--ae-primary-700);
    font-weight: 700;
    border-bottom: 1px solid rgba(34,76,154,.15);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

/* ---------- Controls: focus + hover ---------- */
.ad-form .form-control,
.ad-form .form-select,
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--ae-border);
}

    .ad-form .form-control:focus,
    .ad-form .form-select:focus,
    .form-control:focus, .form-select:focus {
        border-color: var(--ae-primary);
        box-shadow: 0 0 0 .2rem var(--ae-ring);
    }

/* ---------- Brand chips for units (km, L/100km, CP, cm³, g/km etc) ---------- */
.ad-form .input-group-text,
.input-group-text {
    background: #eef2ff;
    color: var(--ae-primary-700);
    border: 1px solid rgba(34,76,154,.20);
    font-weight: 600;
    border-radius: 12px;
}

/* keep input-group rounded correctly */
.ad-form .input-group .form-control:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.ad-form .input-group .input-group-text:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ---------- Switches / checkboxes ---------- */
.ad-form .form-check-input:checked,
.form-check-input:checked {
    background-color: var(--ae-primary);
    border-color: var(--ae-primary);
}

.ad-form .form-check-input:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .2rem var(--ae-ring);
}

/* ---------- Selects in a grid (Make/Model etc.) ---------- */
#ad-form-make-model {
}

/* keep selects uniform height */
.ad-form select.form-select,
select.form-select {
    height: 44px;
}

/* ---------- Map block ---------- */
#ad-form-map {
}

#mapEdit {
    border: 1px solid var(--ae-border);
    box-shadow: 0 6px 18px rgba(17,24,39,.06);
}

/* ---------- Existing media gallery ---------- */
.ad-form .d-flex.flex-wrap.gap-3 > .border.rounded {
    border-color: var(--ae-border) !important;
    border-radius: 12px !important;
    background: #fff;
    box-shadow: 0 6px 16px rgba(17,24,39,.06);
}

.ad-form .d-flex.flex-wrap.gap-3 img {
    border-radius: 8px;
}

/* ---------- Small helper text ---------- */
.ad-form .form-text,
.form-text {
    color: var(--ae-muted);
}

/* ---------- “Promoted” / “Tip anunț” select highlight on focus ---------- */
select[name="Tier"]:focus {
    box-shadow: 0 0 0 .2rem var(--ae-ring);
}

/* ---------- Actions row (Save / Cancel) ---------- */
.ad-form .ad-actions,
.d-flex.justify-content-end.gap-2.mt-3 {
    padding-top: .5rem;
    padding-bottom: .5rem;
    z-index: 5;
}

/* Buttons rounded & a bit bolder */
.ad-form .btn,
.btn {
    border-radius: 12px;
    font-weight: 600;
}

/* ---------- Subtle separators inside big cards ---------- */
.ad-form .row.g-3 > [class*="col-"] + [class*="col-"] .form-label {
}

/* ---------- Section spacing helpers ---------- */
.ad-form .mb-3:last-child {
    margin-bottom: 1rem !important;
}

/* ---------- Nice badges for “Promovat” etc. (optional) ---------- */
.badge-promoted {
    background: #3b82f6;
    color: #fff;
}

.badge-regular {
    background: #e5e7eb;
    color: #111827;
}

/* ---------- Make the “blue chips” more vivid on critical units ---------- */
input[asp-for="Co2Emission"] ~ .input-group-text,
input#Co2Emission ~ .input-group-text,
input[asp-for="ConsumptionUrban"] ~ .input-group-text,
input[asp-for="ConsumptionExtraUrban"] ~ .input-group-text,
input[asp-for="ConsumptionCombined"] ~ .input-group-text,
input[asp-for="PowerHp"] ~ .input-group-text,
input[asp-for="EngineDisplacementCc"] ~ .input-group-text {
    background: #eaf1ff;
    color: var(--ae-primary-700);
    border-color: rgba(34,76,154,.25);
}

/* ---------- Headers in main form (big “card titles” inside body) ---------- */
.ad-form h6,
h6 {
    font-weight: 700;
    color: var(--ae-primary-700);
}

/* ---------- Compact labels on left when using .col-md-3 labels ---------- */
@media (min-width: 992px) {
    .ad-form .col-md-3 .form-label,
    .ad-form .col-md-2 .form-label {
        margin-bottom: .35rem;
    }
}

/* ---------- Fieldset look for grouped sections ---------- */
#ad-form-basic {
}

#ad-form-tech {
}

#ad-form-caronly {
}

#ad-form-truckonly {
}

#ad-form-state {
}


.category-picker {
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    border: 2px solid #0d6efd;
    background: white;
    color: #0056b3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 12px;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

    /* Icon bigger */
    .category-btn i {
        font-size: 26px;
    }

    /* Active */
    .category-btn.active {
        background-color: #0056b3;
        color: #fff;
        border-color: #0056b3;
    }

/* Mobile = horizontal scroll */
@media (max-width: 767.98px) {
    .category-picker {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

/* Desktop = wrap into full row */
@media (min-width: 768px) {
    .category-picker {
        flex-wrap: wrap;
        overflow: visible;
        justify-content: center; /* ⬅ centers horizontally */
    }
}

.category-wrapper {
    position: relative;
}

/* arrows for mobile only */
.cat-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.25);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    display: flex;
    font-size: 16px;
    backdrop-filter: blur(3px);
    z-index: 10;
}

.left-arrow {
    left: 4px;
}

.right-arrow {
    right: 4px;
}

/* hide arrows on desktop */
@media (min-width: 768px) {
    .cat-arrow {
        display: none !important;
    }
}
