/* ==========================================================================
   Opportunity Cards (opp-card) — Phase 8 UI Overhaul
   ========================================================================== */

:root {
    --opp-card-radius: 0.5rem;
    --role-tile-height: 52px;
    --role-tile-gap: 0.375rem;
    --role-tile-open-bg: #f3f4f6;
    --role-tile-open-border: #d1d5db;
    --role-tile-filled-bg: color-mix(in srgb, var(--brand-highlight) 10%, white);
    --role-tile-filled-border: color-mix(in srgb, var(--brand-highlight) 45%, white);
    --role-tile-mine-bg: color-mix(in srgb, var(--brand-primary) 10%, white);
    --role-tile-mine-border: var(--brand-primary);
}

/* Card grid layout — 3 columns on desktop (sidebar closed), 2 with sidebar open */
.opp-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1199.98px) {
    .opp-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .opp-card-grid {
        grid-template-columns: 1fr;
    }
}

/* When sidebar is open, use auto-fill so column count adapts to available space.
   400px minimum ensures role tiles stay readable (2-col sub-grid needs ~185px per tile). */
.app-layout:not(.sidebar-collapsed) .opp-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

/* Card container — position:relative is set inline on the element (immune to cascade) */
.opp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--opp-card-radius);
    overflow: hidden;
    min-width: 0; /* Prevent grid blowout — cards shrink to fit their track */
    transition: box-shadow 0.15s ease;
}

/* Info icon — position/top/right/z-index set inline; only visual props here */
.opp-card__info-icon {
    font-size: 0.8125rem;
    color: #9ca3af;
    cursor: default;
    line-height: 1;
}

.opp-card__info-icon:hover {
    color: #6b7280;
}


.opp-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Card header — flat */
.opp-card__header {
    background: #fff;
    color: #111827;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    border-radius: var(--opp-card-radius) var(--opp-card-radius) 0 0;
}

.opp-card__template {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.125rem;
}

.opp-card__title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
}

.opp-card__subtitle {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.3;
}

/* Date row — HC-style centered bold */
.opp-card__date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #eef2ff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e0e7ff;
}

.opp-card__date-row i {
    font-size: 0.875rem;
    color: #6366f1;
    flex-shrink: 0;
}

/* Location / info rows */
.opp-card__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fc;
    font-size: 0.8125rem;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
}

.opp-card__row i {
    font-size: 0.875rem;
    color: #9ca3af;
    flex-shrink: 0;
}

/* Role tile grid — sized to fit 6 roles (2 cols × 3 rows) even with fewer */
.opp-card__roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, minmax(var(--role-tile-height), auto));
    gap: var(--role-tile-gap);
    padding: 0.75rem;
}

@media (max-width: 575.98px) {
    .opp-card__roles {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Property chips on signup-group opportunity cards (Sprint 12.4)
   ========================================================================== */

.signup-group__properties {
    padding: 0.25rem 0.75rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Hide properties container when empty.
   :has() supported in Chrome 105+, Firefox 121+, Safari 15.4+.
   Server-side templates also guard rendering, so this is defense-in-depth. */
.signup-group__properties:empty {
    display: none;
    padding: 0;
}

.property-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-200);
    white-space: nowrap;
}

.property-chip__label {
    color: var(--brand-primary, var(--bs-gray-600));
    font-weight: 600;
}

.property-chip__value {
    color: var(--bs-gray-700);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Property filter panel in the filter bar */
.property-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bs-gray-50, #f9fafb);
    border: 1px solid var(--bs-gray-200);
    border-radius: 0.375rem;
    min-width: 140px;
}

.property-filter-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-gray-600);
}

.property-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    max-height: 200px;
    overflow-y: auto;
}

.property-filter-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--bs-gray-700);
    cursor: pointer;
    padding: 0.125rem 0;
}

.property-filter-option input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--brand-primary, var(--bs-primary));
}

/* Card footer */
.opp-card__footer {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.8125rem;
    color: #6b7280;
}

.opp-card__filled-count {
    font-size: 0.75rem;
}

/* ==========================================================================
   Card Progress Timeline — Sprint 8.1b
   ========================================================================== */

.opp-card__progress {
    border-top: 1px solid #f3f4f6;
}

.opp-card__progress-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: #1e293b;
    color: #fff;
    border: none;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.opp-card__progress-toggle:hover {
    background: #334155;
}

.opp-card__progress-panel {
    padding: 0.5rem 1rem 0.75rem;
    background: #f8fafc;
}

.opp-card__progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.opp-card__progress-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.opp-card__progress-item.is-done {
    color: #374151;
}

.opp-card__progress-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}

.opp-card__progress-item.is-done .opp-card__progress-dot {
    background: #10b981;
}

/* Card footer — open count & action link */
.opp-card__open-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #059669;
}

.opp-card__action {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
}

.opp-card__action:hover {
    text-decoration: underline;
}
