/* Modern Form Styling for New Announcement Page */
.addList-Details .listingDetails {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid #f1f5f9;
}
.addList-Details .listingDetails h5 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
}
.addList-Details .select-itms {
    margin-bottom: 16px;
}
.addList-Details .select-itms label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.addList-Details .form-control {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: #334155;
    transition: all 0.2s ease;
    background-color: #f8fafc;
    box-shadow: none;
}
.addList-Details .form-control:focus {
    border-color: #3b6ef6;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.15);
    background-color: #ffffff;
}
.addList-Details .form-control:disabled, .addList-Details .form-control[readonly] {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}
/* Soften the invalid state */
.addList-Details .form-control.is-invalid {
    border-color: #fca5a5 !important;
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    background-image: none !important;
}
.addList-Details .form-control.is-invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Plate Lookup Box */
.plate-lookup-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    width: 100%;
}
.plate-input-wrapper {
    position: relative;
    max-width: 250px;
}
.plate-input {
    letter-spacing: 3px !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    text-align: center;
    border: 2px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    text-transform: uppercase;
    background: #fff !important;
    color: #0f172a !important;
}
.plate-input:focus {
    border-color: #3b6ef6 !important;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.15) !important;
}
.btn-lookup {
    background-color: #3b6ef6;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    padding: 12px 24px;
    border: none;
    transition: all 0.2s;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-lookup:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    color: white;
}

/* Image Upload Area */
.image-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}
.image-dropzone:hover, .image-dropzone.dragover {
    border-color: #3b6ef6;
    background-color: #eff6ff;
}
.sortable-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.sortable-item {
    width: calc(20% - 12px); /* 5 items per row */
    aspect-ratio: 1;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}
.sortable-item:active {
    cursor: grabbing;
}
.sortable-item .del-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
    z-index: 10;
}
.sortable-item .del-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}
.sortable-item .order-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(15, 23, 42, 0.7);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.sortable-ghost {
    opacity: 0.4;
}

@media (max-width: 991px) {
    .sortable-item { width: calc(25% - 11.25px); } /* 4 per row on tablet */
}
@media (max-width: 767px) {
    .sortable-item { width: calc(33.333% - 10px); } /* 3 per row on mobile */
}
@media (max-width: 480px) {
    .sortable-item { width: calc(50% - 7.5px); } /* 2 per row on small mobile */
}

/* Checkbox and Submit */
.terms-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}
.btn-submit {
    background-color: #10b981;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 8px;
    border: none;
    transition: all 0.2s;
    width: 100%;
}
.btn-submit:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-1px);
}
.btn-submit:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}
/* Bilar locked fields (disabled + readonly appearance) */
.bilar-locked {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    cursor: not-allowed !important;
    opacity: 0.9;
    border-color: #e2e8f0 !important;
}
.bilar-locked:focus {
    box-shadow: none !important;
    border-color: #e2e8f0 !important;
}
.bilar-editable-divider {
    margin-top: 8px;
    padding: 10px 16px;
    background: #eff6ff;
    border-left: 4px solid #3b6ef6;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e40af;
}
.bilar-editable-divider i {
    margin-right: 8px;
}
/* Bilvision returned a body type we don't have in typeofcar - user can pick */
.bilar-editable {
    background-color: #fffbeb !important;
    border-color: #fbbf24 !important;
    color: #1e293b !important;
}
.bilar-editable:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

/* Locked category level selects (after lookup) */
.category-locked {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    cursor: not-allowed !important;
}

/* For Bilar, sub-category dropdowns (level2+) are driven entirely by plate lookup
   and must never be shown. */
.hide-for-bilar {
    display: none !important;
}

/* Softer, word-wrapped labels for the Bilar readonly grid so long Swedish labels
   such as "Senaste godkända besiktning" do not overflow their column. */
#bilarVehicleData .select-itms label,
#bilar .select-itms label {
    font-size: 11px;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    min-height: 28px;
    display: block;
    margin-bottom: 6px;
}

/* Read-only editable grid divider spacing */
.bilar-editable-divider + .col-md-4,
.bilar-editable-divider + .col-md-3 {
    margin-top: 0;
}

/* Vehicle Details Grid (details.blade.php) */
.vehicle-spec-wrap { display:flex; flex-direction:column; gap:24px; margin:24px 0; }
.vehicle-spec-group { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:18px 20px; }
.vehicle-spec-title { font-size:15px; font-weight:700; color:#1e293b; margin:0 0 14px; padding-bottom:10px; border-bottom:1px solid #f1f5f9; }
.vehicle-spec-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px 22px; }
.spec-item { display:flex; gap:12px; align-items:flex-start; }
.spec-item i { font-size:22px; color:#F76631; margin-top:2px; }
.spec-label { font-size:12px; text-transform:uppercase; letter-spacing:.4px; color:#64748b; font-weight:600; }
.spec-value { font-size:15px; color:#0f172a; font-weight:500; margin-top:2px; }
.spec-value.is-empty { color:#94a3b8; font-style:italic; font-weight:400; }

/* Detail Page Image Slider Fix */
.detail-slider {
    max-height: 400px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
    width: 100%;
}
.detail-slider .carousel-item img {
    height: 400px;
    width: 100%;
    object-fit: cover;
    background: #f8fafc;
}
@media (max-width: 768px) {
    .detail-slider, .detail-slider .carousel-item img {
        height: 250px;
    }
}
.no-image-placeholder {
    object-fit: scale-down !important;
    padding: 20px;
    background: #f1f5f9 !important;
}
