/* =========================================================================
   UNIMART2040 — Demand Feed & Post styles
   "Students Looking To Buy" — the demand side of Layer 1
   ========================================================================= */

.demand-feed,
.demand-post,
.demand-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .demand-feed,
    .demand-post,
    .demand-detail {
        padding: 1.5rem;
    }
}

/* Demand board rollup (Sprint A) */
.demand-board-rollup {
    margin-bottom: 1.25rem;
}
.demand-board-rollup__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    color: var(--secondary);
}
.demand-board-rollup__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.demand-board-rollup__chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 76px;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    background: var(--primary-light);
    border: 1px solid var(--primary-light);
    text-decoration: none;
    color: var(--info);
}
.demand-board-rollup__chip strong {
    font-size: 1.05rem;
    color: var(--secondary);
}
.demand-board-rollup__chip span {
    font-size: 0.68rem;
    text-align: center;
}
.demand-board-alerts {
    margin-bottom: 1.25rem;
    padding: 0.85rem;
    border-radius: 12px;
    background: var(--primary-light);
    border: 1px solid var(--primary-light);
}
.demand-board-alerts h2 {
    font-size: 0.88rem;
    margin: 0 0 0.5rem;
    color: var(--primary-dark);
}
.demand-board-alerts__row {
    display: block;
    padding: 0.45rem 0;
    font-size: 0.82rem;
    color: var(--primary-dark);
    text-decoration: none;
    border-top: 1px solid rgba(154, 52, 18, 0.12);
}

/* Header */
.demand-feed__header {
    margin-bottom: 1rem;
}
.demand-feed__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.demand-feed__title-row h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}
.demand-feed__campus {
    font-size: 0.72rem;
    background: var(--secondary);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.demand-feed__subtitle {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0.3rem 0 0.8rem;
}
.demand-feed__post-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.demand-feed__post-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Demand Cards — list layout delegated to .um-feed-list when present */
.demand-feed__list:not(.um-feed-list) {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.demand-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: #fff;
    border: 1px solid var(--unimart-border, #e8e8e8);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.demand-card:hover {
    border-color: rgba(246, 139, 30, 0.35);
    box-shadow: 0 12px 32px rgba(44, 62, 80, 0.09);
    transform: translateY(-2px);
    color: inherit;
}
.demand-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.demand-card__urgency {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.demand-card__urgency--asap {
    background: var(--primary-light);
    color: var(--danger);
}
.demand-card__urgency--this_week {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.demand-card__urgency--this_month {
    background: var(--info);
    color: var(--info);
}
.demand-card__urgency--no_rush {
    background: var(--primary-light);
    color: var(--success);
}
.demand-card__time {
    font-size: 0.68rem;
    color: #9ca3af;
}
.demand-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0 0 0.3rem;
}
.demand-card__budget {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.2rem;
}
.demand-card__desc {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 0 0 0.5rem;
}
.demand-card__footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--gray);
}
.demand-card__interested {
    color: var(--primary);
    font-weight: 500;
}
.demand-card__matches {
    color: var(--success);
    font-weight: 500;
}

/* Empty state */
.demand-feed__empty i {
    display: block;
    font-size: 2rem;
    color: var(--unimart-text-muted, #9ca3af);
    margin-bottom: 0.75rem;
}

/* Post Form */
.demand-post__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.demand-post__back {
    color: var(--secondary);
    font-size: 1.1rem;
    text-decoration: none;
}
.demand-post__header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}
.demand-post__subtitle {
    font-size: 0.8rem;
    color: var(--gray);
    margin: -0.5rem 0 0 2.5rem;
}
.demand-post__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.demand-form__group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.demand-form__group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-dark);
}
.demand-form__group--half {
    flex: 1;
}
.demand-form__row {
    display: flex;
    gap: 0.75rem;
}
.demand-form__input,
.demand-form__textarea,
.demand-form__select {
    width: 100%;
    border: 1.5px solid var(--unimart-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.demand-form__input:focus,
.demand-form__textarea:focus,
.demand-form__select:focus {
    border-color: var(--primary);
}
.demand-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.demand-form__submit:hover {
    background: var(--primary);
}

/* Detail */
.demand-detail__header {
    margin-bottom: 1rem;
}
.demand-detail__card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.demand-detail__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.demand-detail__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0 0 0.5rem;
}
.demand-detail__desc {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
}
.demand-detail__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.demand-spec {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--gray);
    background: var(--unimart-bg-muted);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
}
.demand-spec i {
    color: var(--primary);
    font-size: 0.7rem;
}
.demand-detail__poster {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    color: var(--gray-dark);
    font-size: 0.8rem;
}
.demand-detail__poster i {
    color: #9ca3af;
}
.demand-detail__interest-count {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Offers */
.demand-detail__offer-section,
.demand-detail__offers {
    margin-top: 1.5rem;
}
.demand-detail__offer-section h2,
.demand-detail__offers h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}
.demand-offer__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.demand-offer__card {
    background: var(--unimart-bg-muted);
    border: 1px solid var(--unimart-border);
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.6rem;
}
.demand-offer__seller {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
}
.demand-offer__seller i {
    color: var(--primary);
}
.demand-offer__price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0 0 0.3rem;
}
.demand-offer__message {
    font-size: 0.78rem;
    color: var(--gray);
    margin: 0 0 0.3rem;
}
.demand-offer__product-link {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.demand-detail__waiting {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray);
}
.demand-detail__waiting p {
    margin-top: 0.5rem;
    font-size: 0.82rem;
}

/* Post-success + related listings */
.demand-detail__success {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1px solid rgba(22, 163, 74, 0.18);
}
.demand-detail__success-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #16a34a;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}
.demand-detail__success-title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #14532d;
}
.demand-detail__success-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #166534;
}

.demand-related {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem;
    border-radius: 14px;
    background: var(--primary-light, #fff7ed);
    border: 1px solid rgba(246, 139, 30, 0.15);
}
.demand-related__intro h2 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary, #1e293b);
}
.demand-related__intro p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--gray, #64748b);
}
.demand-related__search-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary, #f68b1e);
    text-decoration: none;
}
.demand-related__group {
    margin-top: 1rem;
}
.demand-related__group-title {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--secondary, #1e293b);
}
.demand-related__group-title i {
    color: var(--primary, #f68b1e);
    margin-right: 0.25rem;
}
.demand-related__products {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.demand-related__services {
    display: grid;
    gap: 0.75rem;
}
.demand-related__footer {
    margin: 0.85rem 0 0;
    font-size: 0.78rem;
    color: var(--gray, #64748b);
}
.demand-related__footer a {
    color: var(--primary, #f68b1e);
    font-weight: 600;
    text-decoration: none;
}

@media (min-width: 640px) {
    .demand-related__products {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }
}

@media (max-width: 575px) {
    .demand-form__row {
        flex-direction: column;
    }
}
