/* ============================================================
   motodez.ro — Redesign cereri (minimalist)
   ============================================================
   Folosește variabilele CSS din app.css. Nu redefinim culori
   brand — respectăm dark mode automat.
   ============================================================ */

/* ─── HERO cerere (pagina de detaliu) ──────────────────── */
.req-hero {
    padding: 1.75rem;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-soft, #e4e8ee);
    border-radius: 14px;
    box-shadow: var(--shadow-sm, 0 4px 14px rgba(20, 30, 50, 0.06));
}

.req-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main, #162235);
    margin: 0;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .req-title { font-size: 2rem; }
}

.req-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* Buget mare — echivalentul prețului de pe listings */
.req-budget {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-soft, #e4e8ee);
    border-bottom: 1px solid var(--border-soft, #e4e8ee);
}

.req-budget-label {
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.req-budget-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-accent, #ffb703);
    letter-spacing: -0.02em;
    line-height: 1;
}

@media (min-width: 768px) {
    .req-budget-value { font-size: 2.4rem; }
}

/* Dark mode: buget rămâne galben brand */
html[data-bs-theme="dark"] .req-budget-value {
    color: var(--brand-accent, #ffb703) !important;
}

/* ─── Galerie poze (grid inteligent) ────────────────────── */
.req-gallery {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* Prima poză poate fi mai mare la desktop */
@media (min-width: 768px) {
    .req-gallery {
        grid-template-columns: repeat(5, 1fr);
    }
    .req-gallery-item:first-child {
        grid-column: span 2;
        grid-row: span 2;
    }
}

.req-gallery-item {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-soft, #eef2f6);
    border: 1px solid var(--border-soft, #e4e8ee);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.req-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 12px 32px rgba(20, 30, 50, 0.1));
}

.req-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Secțiuni flat (fără card wrapper) ────────────────── */
.req-section {
    padding: 0;
}

.req-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main, #162235);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-soft, #e4e8ee);
}

.req-description {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-main, #162235);
    white-space: normal;
}

/* ─── Oferte ─────────────────────────────────────────── */
.req-offers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.req-offer {
    padding: 1rem;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-soft, #e4e8ee);
    border-radius: 10px;
}

.req-offer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.req-offer-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-accent, #ffb703);
    line-height: 1;
    margin-bottom: 0.25rem;
}

html[data-bs-theme="dark"] .req-offer-price {
    color: var(--brand-accent, #ffb703) !important;
}

.req-offer-msg {
    white-space: pre-wrap;
    color: var(--text-main, #162235);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* ─── Similar listings (compact) ──────────────────────── */
.req-similar-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-soft, #e4e8ee);
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.req-similar-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 12px 32px rgba(20, 30, 50, 0.1));
    color: inherit;
}

.req-similar-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.req-similar-noimage {
    aspect-ratio: 1;
    background: var(--surface-soft, #eef2f6);
    color: var(--text-muted, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.req-similar-body {
    padding: 0.6rem;
}

.req-similar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #162235);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.req-similar-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-accent, #ffb703);
}

html[data-bs-theme="dark"] .req-similar-price {
    color: var(--brand-accent, #ffb703) !important;
}

/* ============================================================
   LISTĂ CERERI (pagina /cereri)
   ============================================================ */

.req-list-card {
    display: flex;
    gap: 1rem;
    padding: 0;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-soft, #e4e8ee);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.req-list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 12px 32px rgba(20, 30, 50, 0.1));
    border-color: var(--brand-accent, #ffb703);
    color: inherit;
}

.req-list-thumb {
    flex-shrink: 0;
    width: 140px;
    aspect-ratio: 1;
    background: var(--surface-soft, #eef2f6);
    overflow: hidden;
}

@media (max-width: 575px) {
    .req-list-card { flex-direction: column; }
    .req-list-thumb { width: 100%; aspect-ratio: 16/9; }
}

.req-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.req-list-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted, #6c757d);
    opacity: 0.5;
}

.req-list-body {
    flex-grow: 1;
    padding: 0.9rem 1rem;
    min-width: 0;
}

.req-list-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main, #162235);
    line-height: 1.3;
    letter-spacing: -0.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.req-list-card:hover .req-list-title {
    color: var(--brand-accent, #ffb703);
}

.req-list-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-accent, #ffb703);
    white-space: nowrap;
    letter-spacing: -0.01em;
    text-align: right;
    flex-shrink: 0;
}

html[data-bs-theme="dark"] .req-list-price {
    color: var(--brand-accent, #ffb703) !important;
}

.req-list-price-open {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted, #6c757d);
    font-style: italic;
}

.req-list-preview {
    color: var(--text-muted, #6c757d);
    font-size: 0.88rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0.5rem 0;
}

.req-list-meta {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-soft, #e4e8ee);
}

/* ============================================================
   EDIT: poze existente cu delete
   ============================================================ */

.req-photo-existing {
    position: relative;
    width: 120px;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-soft, #e4e8ee);
    background: var(--surface-soft, #eef2f6);
}

.req-photo-existing img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.req-photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(214, 40, 40, 0.9);
    color: #fff;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease, transform 0.15s ease;
}

.req-photo-delete-btn:hover {
    background: #b91c1c;
    transform: scale(1.08);
}

.req-photo-delete-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ============================================================
   CREATE/EDIT: preview upload
   ============================================================ */

.req-photo-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px dashed var(--border-soft, #e4e8ee);
    background: var(--surface-soft, #eef2f6);
}

.req-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.req-photo-preview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.7rem;
    color: var(--brand-red, #d62828);
    background: rgba(214, 40, 40, 0.08);
    border-color: rgba(214, 40, 40, 0.3);
    height: 100%;
}

/* ============================================================
   LIGHTBOX simplu pentru galerie (fără dependințe)
   ============================================================ */

.req-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    cursor: zoom-out;
}

.req-lightbox.open {
    display: flex;
}

.req-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.req-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.req-lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

.req-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: #fff;
    font-size: 1.6rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.req-lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.req-lightbox-prev { left: 1rem; }
.req-lightbox-next { right: 1rem; }

.req-lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    z-index: 2001;
}
