/*
 * assets/listings.css
 *
 * Styles for SupplierHub listing cards and the Open Exchange page layout.
 * Designed to match and complement the OpenMineral UI language.
 */

/* ── Card Grid ───────────────────────────────────────────────────────────── */
.shl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* ── Individual Card ─────────────────────────────────────────────────────── */
.shl-card {
    background: #ffffff;
    border: 1px solid #e7ebf0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.shl-card:hover {
    box-shadow: 0 6px 24px rgba(16, 24, 40, 0.10);
    transform: translateY(-2px);
}

.shl-card--closed {
    opacity: 0.75;
    filter: grayscale(25%);
}

/* ── Card Image ──────────────────────────────────────────────────────────── */
.shl-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f2f5;
}

.shl-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.shl-card:hover .shl-card__image img {
    transform: scale(1.04);
}

/* ── Status Badge ────────────────────────────────────────────────────────── */
.shl-card__status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.shl-card__status-badge--active {
    background: rgba(22, 163, 74, 0.9);
    color: #ffffff;
}

.shl-card__status-badge--closed {
    background: rgba(100, 116, 139, 0.85);
    color: #ffffff;
}

/* ── Card Body ───────────────────────────────────────────────────────────── */
.shl-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.shl-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2332;
    margin: 0;
    line-height: 1.3;
}

/* ── Meta List ───────────────────────────────────────────────────────────── */
.shl-card__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}

.shl-card__meta li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shl-meta-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a95a3;
}

.shl-meta-value {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a2332;
}

/* ── Description ─────────────────────────────────────────────────────────── */
.shl-card__desc {
    font-size: 13.5px;
    color: #606a78;
    line-height: 1.6;
    flex: 1;
}

.shl-card__desc p {
    margin: 0;
}

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.shl-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f5;
}

.shl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    line-height: 1;
}

.shl-btn:hover {
    transform: translateY(-1px);
}

/* Green Inquiry button */
.shl-btn--inquiry {
    background: linear-gradient(135deg, #1db96a 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.28);
}

.shl-btn--inquiry:hover {
    background: linear-gradient(135deg, #18a85f 0%, #138a3f 100%);
    box-shadow: 0 5px 14px rgba(22, 163, 74, 0.38);
    color: #ffffff;
}

/* Blue Order button */
.shl-btn--order {
    background: linear-gradient(135deg, #3b6ef5 0%, #2f55d4 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(47, 85, 212, 0.28);
}

.shl-btn--order:hover {
    background: linear-gradient(135deg, #3464e8 0%, #2848bf 100%);
    box-shadow: 0 5px 14px rgba(47, 85, 212, 0.38);
    color: #ffffff;
}

/* ── Show Completed Toggle ───────────────────────────────────────────────── */
.shl-show-closed-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 340px;
    margin: 28px auto 0;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b6ef5 0%, #2f55d4 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(47, 85, 212, 0.3);
    transition: all 0.2s ease;
}

.shl-show-closed-btn:hover {
    background: linear-gradient(135deg, #3464e8 0%, #2848bf 100%);
    box-shadow: 0 6px 18px rgba(47, 85, 212, 0.4);
    transform: translateY(-1px);
}

/* ── Closed Listings Section ─────────────────────────────────────────────── */
.shl-closed-section {
    display: none;
    margin-top: 32px;
}

.shl-closed-section.is-visible {
    display: block;
}

.shl-closed-section__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #8a95a3;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e7ebf0;
}

.shl-closed-section__heading::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.shl-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e7ebf0;
    margin-top: 16px;
    text-align: center;
}

.shl-empty-state__icon {
    color: #94a3b8;
    margin-bottom: 16px;
    opacity: 0.7;
}

.shl-empty-state__text {
    font-size: 14px;
    color: #8a95a3;
    max-width: 340px;
    line-height: 1.6;
}

/* ── KYC Banner (Open Exchange page) ─────────────────────────────────────── */
.shl-kyc-banner {
    background: #fef3e2;
    border-bottom: 1px solid #fde0a0;
    padding: 14px 24px;
    font-size: 13.5px;
    color: #7a4a0a;
    text-align: center;
    margin: -24px -24px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shl-kyc-banner a {
    color: #c2610a;
    font-weight: 700;
    text-decoration: underline;
}

/* ── Notification Bell Badge ─────────────────────────────────────────────── */
.sh-notif-wrapper {
    position: relative;
    display: inline-flex;
}

.sh-notif-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid #ffffff;
    pointer-events: none;
}

/* ── Notification Dropdown ───────────────────────────────────────────────── */
.sh-notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e7ebf0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.12);
    z-index: 10000;
    overflow: hidden;
}

.sh-notif-dropdown.is-open {
    display: block;
}

.sh-notif-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sh-notif-header__title {
    font-size: 13px;
    font-weight: 700;
    color: #1a2332;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sh-notif-mark-read {
    font-size: 11.5px;
    color: #3b6ef5;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
}

.sh-notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.sh-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid #f8fafc;
    text-decoration: none;
    transition: background 0.15s;
}

.sh-notif-item:hover {
    background: #f8fafc;
}

.sh-notif-item__icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #3b6ef5;
}

.sh-notif-item__text {
    flex: 1;
    min-width: 0;
}

.sh-notif-item__title {
    font-size: 13px;
    font-weight: 600;
    color: #1a2332;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-notif-item__meta {
    font-size: 11.5px;
    color: #8a95a3;
    margin-top: 3px;
}

.sh-notif-empty {
    padding: 28px 18px;
    text-align: center;
    font-size: 13px;
    color: #8a95a3;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .shl-grid {
        grid-template-columns: 1fr;
    }

    .shl-card__actions {
        grid-template-columns: 1fr;
    }

    .sh-notif-dropdown {
        width: 290px;
        right: -40px;
    }
}
