/* Ensure the body doesn't scroll, only the inner panels do */
body.opps-page {
    height: 100vh;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
}

/* Search Bar */
.search-filter-bar {
    background: var(--white);
    padding: 1rem 6%; 
    border-bottom: 1px solid #eee;
    z-index: 10;
    flex-shrink: 0; 
}

.filter-container { display: flex; gap: 15px; align-items: center; }

.search-input {
    flex: 2;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: "Times New Roman", Times, serif;
}

.filter-select {
    font-family: "Times New Roman", Times, serif;
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
}

.map-home-control { background: #fff; border: 1px solid rgba(27,67,50,.2); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.2); color: var(--forest); cursor: pointer; font-size: .8rem; font-weight: 700; padding: 8px 10px; transition: background .2s, box-shadow .2s, transform .2s; }
.map-home-control:hover, .map-home-control:focus-visible { background: var(--mint); box-shadow: 0 4px 12px rgba(27,67,50,.25); transform: translateY(-1px); }
.distance-label { color: var(--emerald); font-weight: 700; }
.map-info-panel { position: absolute; top: 12px; right: 12px; z-index: 500; max-width: min(330px, calc(100% - 24px)); padding: 10px 12px; border: 1px solid rgba(27,67,50,.16); border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 4px 14px rgba(0,0,0,.14); color: var(--forest); font-size: .76rem; line-height: 1.35; pointer-events: none; }
.map-info-panel strong { display: block; margin-bottom: 2px; font-size: .78rem; }
.map-info-panel span { color: #52605a; }
.distance-tooltip { border: 1px solid rgba(27,67,50,.2); border-radius: 6px; color: var(--forest); font-size: .7rem; font-weight: 700; padding: 3px 6px; box-shadow: 0 2px 7px rgba(0,0,0,.15); }
.distance-tooltip::before { border-top-color: rgba(27,67,50,.2); }

/* INCREASE LEFT PANEL WIDTH */
.opps-layout {
    display: grid;
    grid-template-columns: 580px 1fr;
    flex: 1; 
    overflow: hidden; 
    position: relative;
}

/* ADD STATS BAR STYLING */
.stats-bar {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.stat-pill {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.stat-pill strong {
    font-size: 1.4rem;
    color: var(--forest, #1b4332);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-pill span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Left Side: The Scrollable List */
.listings-container {
    height: 100%;
    overflow-y: auto; 
    padding: 24px;
    background: var(--off-white);
    border-right: 1px solid #e0e0e0;
}

.results-header { margin-bottom: 20px; padding: 0 10px; }
.results-header h2 span { color: var(--emerald); }

.listings-grid {
    display: flex;      
    flex-direction: column;
    gap: 20px;
}

/* Cards */
.opp-card {
    display: flex;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: transform 0.2s;
    min-height: 160px;
    position: relative; /* Add this line */ 
}
.opp-card:hover { transform: translateY(-3px); }

.opp-img {
    width: 140px;
    flex-shrink: 0; 
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #e2e8f0; 
}

.star-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(27, 67, 50, .18);
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--forest);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.star-btn:hover,
.star-btn:focus-visible {
    transform: scale(1.1);
    background: var(--mint);
    border-color: var(--emerald);
    box-shadow: 0 6px 16px rgba(27, 67, 50, .28);
}
.star-btn:active { transform: scale(.96); }

.category-tag {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--forest);
    color: white;
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.opp-content { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.opp-content h3 { font-size: 1.1rem; margin-bottom: 4px; color: var(--dark); }
.org-name { color: var(--emerald); font-weight: 600; font-size: 0.85rem; margin-bottom: 8px; display:flex; align-items:center; flex-wrap:wrap;}

/* Verification Badges */
.verified-badge {
    font-size: 0.7rem; font-weight: 700; color: #065f46;
    background: #d1fae5; border: 1px solid #6ee7b7;
    padding: 2px 6px; border-radius: 12px;
    display: inline-flex; align-items: center;
}
.gov-badge {
    font-size: 0.7rem; font-weight: 700; color: #3730a3;
    background: #e0e7ff; border: 1px solid #a5b4fc;
    padding: 2px 6px; border-radius: 12px;
    display: inline-flex; align-items: center;
}

.opp-details { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 12px; 
    font-size: 0.8rem; 
    color: #666; 
    flex-wrap: wrap;
}

/* Bulleted Role Summary on Card */
.role-brief {
    font-size: 0.8rem;
    color: #444;
    margin-bottom: 15px;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--forest, #2d6a4f);
}
.role-brief strong { display: block; margin-bottom: 4px; color: var(--dark); }
.role-brief ul { margin: 0; padding-left: 18px; }
.role-brief li { margin-bottom: 3px; line-height: 1.3;}

.btn-card {
    background: transparent;
    border: 1.5px solid var(--forest);
    color: var(--forest);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-card:hover { background: var(--forest); color: white; }

/* Right Side: The Map */
.map-view {
    height: 100%;
    width: 100%;
    position: relative; 
}

#interactive-map { 
    width: 100%; 
    height: 100%; 
    min-height: 360px;
    z-index: 1;
}

.status-closed { background-color: #d9534f; }
.status-open { background-color: var(--forest); }

/* Modal Overlay Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
    background: #fff;
    width: 92%; max-width: 600px; max-height: 90vh;
    overflow-y: auto; border-radius: 12px;
    padding: 30px; position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}
.close-modal {
    position: absolute; top: 15px; right: 20px;
    background: transparent; border: none; font-size: 2rem;
    cursor: pointer; color: #666; line-height: 1;
}
.close-modal:hover { color: #000; }
.modal-header h2 { margin: 0 0 10px 0; color: #1b4332; }
.modal-header .badge { 
    display: inline-block; padding: 4px 10px; border-radius: 6px; 
    font-size: 0.8rem; font-weight: 700; margin-right: 8px; margin-bottom: 10px;
}
.badge.verified { background-color: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.badge.gov { background-color: #e0e7ff; color: #3730a3; border: 1px solid #6366f1; }
.badge.status { color: white; border: 1px solid transparent; }

.modal-section { margin-top: 20px; }
.modal-section h3 { font-size: 1.05rem; color: #222; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 6px;}
.modal-section p { font-size: 0.9rem; color: #444; line-height: 1.5; margin-bottom: 8px;}
.modal-section ul { padding-left: 20px; margin-top: 5px; }
.modal-section li { font-size: 0.9rem; color: #444; margin-bottom: 6px; line-height: 1.4; }

.modal-apply-btn { 
    display: inline-block; background: var(--forest, #2d6a4f); color: white; 
    padding: 12px 24px; text-decoration: none; border-radius: 8px; 
    font-weight: bold; font-size: 1rem; margin-top: 20px; 
    text-align: center; transition: background 0.2s;
}
.modal-apply-btn:hover { background: var(--emerald, #1b4332); }

/* Responsive */
@media (max-width: 900px) {
    .opps-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .listings-container { border-right: none; border-bottom: 1px solid #ddd; }
}

@media (max-width: 700px) {
    body.opps-page { height: auto; min-height: 100vh; overflow: auto; }
    .search-filter-bar { padding: .75rem 5%; }
    .filter-container { flex-direction: column; align-items: stretch; }
    .opps-layout { min-height: 1000px; grid-template-rows: minmax(560px, 1fr) clamp(360px, 48vh, 520px); }
    .listings-container { padding: 16px; }
    .opp-img { width: 105px; }
    .opp-content { padding: 12px; }
    .opp-content h3 { font-size: 1rem; }
    .results-header { padding: 0; }
    .stats-bar { gap: 6px; }
}

/* ==========================================
   NEWLY EXTRACTED UTILITY CLASSES (FROM JS)
   ========================================== */
.modal-badges-container { margin-bottom: 15px; }
.modal-section-no-border { border: none; }
.modal-footer { text-align: center; margin-top: 15px; }
.modal-apply-btn.disabled { background: #ccc; pointer-events: none; }
.modal-timestamp { font-size: 0.75rem; color: #888; margin-top: 15px; }

.popup-category-tag {
    display: inline-block;
    background: var(--forest);
    color: white;
    font-size: 0.7rem;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: bold;
}

.btn-card.full-width { width: 100%; text-align: center; margin-top: 5px; }
.btn-card.align-bottom { align-self: flex-start; margin-top: auto; }
.opp-description { font-size: 0.85rem; color: #555; margin-bottom: 12px; line-height: 1.4; }
