/* ===================================
   OPPORTUNITIES PAGE STYLES
   =================================== */

/* ===================================
   PAGE HEADER
   =================================== */
.opportunities-header {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #1A2332 0%, #2C3E50 100%);
    color: #FFFFFF;
    text-align: center;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    opacity: 0.8;
}

.breadcrumb a {
    color: #FFFFFF;
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb a:hover {
    color: #C8A868;
}

.breadcrumb span {
    opacity: 0.5;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #FFFFFF;
}

.page-subtitle {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto 40px;
    opacity: 0.9;
    line-height: 1.6;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.header-stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #C8A868;
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.stat-text {
    display: block;
    font-size: 14px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===================================
   OPPORTUNITIES SECTION
   =================================== */
.opportunities-section {
    padding: 60px 0 100px;
    background: #F5F5F5;
}

/* ===================================
   TOOLBAR
   =================================== */
.opportunities-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 30px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.filter-group,
.search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #1A2332;
}

.filter-select,
.search-input {
    padding: 12px 14px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: #FFFFFF;
}

.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: #C8A868;
    box-shadow: 0 0 0 3px rgba(200, 168, 104, 0.1);
}

.search-group {
    grid-column: span 2;
}

.search-input {
    width: 100%;
}

/* ===================================
   VIEW TOGGLE
   =================================== */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.view-btn {
    padding: 12px 24px;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn:hover {
    border-color: #C8A868;
    transform: translateY(-2px);
}

.view-btn.active {
    background: #C8A868;
    color: #FFFFFF;
    border-color: #C8A868;
}

/* ===================================
   RESULTS COUNT
   =================================== */
.results-count {
    padding: 15px 20px;
    background: #FFFFFF;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 15px;
    color: #2C3E50;
}

.results-count strong {
    color: #C8A868;
    font-weight: 700;
}

/* ===================================
   TABLE VIEW
   =================================== */
.table-container {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.opportunities-table {
    width: 100%;
    border-collapse: collapse;
}

.opportunities-table thead {
    background: #1A2332;
    color: #FFFFFF;
}

.opportunities-table th {
    padding: 18px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.opportunities-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.opportunities-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sort-icon {
    margin-left: 5px;
    opacity: 0.5;
    font-size: 12px;
}

.opportunities-table th.sorted .sort-icon {
    opacity: 1;
    color: #C8A868;
}

.opportunities-table tbody tr {
    border-bottom: 1px solid #F0F0F0;
    transition: all 0.3s ease;
}

.opportunities-table tbody tr:hover {
    background: rgba(200, 168, 104, 0.05);
}

.opportunities-table tbody tr:last-child {
    border-bottom: none;
}

.opportunities-table td {
    padding: 16px;
    font-size: 14px;
    color: #2C3E50;
}

.opp-name {
    font-weight: 600;
    color: #1A2332;
}

.opp-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(200, 168, 104, 0.1);
    color: #1A2332;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

.risk-badge.low {
    background: #D4EDDA;
    color: #155724;
}

.risk-badge.medium {
    background: #FFF3CD;
    color: #856404;
}

.risk-badge.high {
    background: #F8D7DA;
    color: #721C24;
}

.score-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}

.score-display.excellent {
    background: #D4EDDA;
    color: #155724;
}

.score-display.good {
    background: #D1ECF1;
    color: #0C5460;
}

.score-display.fair {
    background: #FFF3CD;
    color: #856404;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.open {
    background: #D4EDDA;
    color: #155724;
}

.status-badge.closing-soon {
    background: #FFF3CD;
    color: #856404;
}

.status-badge.due-diligence {
    background: #D1ECF1;
    color: #0C5460;
}

/* ===================================
   CARDS VIEW
   =================================== */
.opportunities-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.opportunity-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.opportunity-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-color: #C8A868;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: #1A2332;
    margin-bottom: 8px;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7F8C8D;
    font-size: 14px;
}

.card-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(200, 168, 104, 0.05);
    border-radius: 12px;
}

.metric-item {
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 12px;
    color: #7F8C8D;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1A2332;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #F0F0F0;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 14px;
    color: #7F8C8D;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #1A2332;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #F0F0F0;
}

.view-details-btn {
    padding: 10px 20px;
    background: #C8A868;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: #D4874B;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 168, 104, 0.3);
}

/* ===================================
   NO RESULTS
   =================================== */
.no-results {
    text-align: center;
    padding: 60px 30px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.no-results p {
    font-size: 18px;
    color: #7F8C8D;
    margin-bottom: 20px;
}

.reset-button {
    padding: 12px 30px;
    background: #C8A868;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-button:hover {
    background: #D4874B;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 168, 104, 0.3);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
    }
    
    .opportunities-table {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    .opportunities-header {
        padding: 120px 0 60px;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .page-subtitle {
        font-size: 16px;
    }

    .header-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .opportunities-toolbar {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .search-group {
        grid-column: span 1;
    }

    .view-toggle {
        justify-content: center;
    }
    
    .opportunities-cards {
        grid-template-columns: 1fr;
    }

    .opportunities-table {
        font-size: 13px;
    }
    
    .opportunities-table th,
    .opportunities-table td {
        padding: 12px 10px;
    }
}

/* ===================================
   CREDIT-SPECIFIC STYLES
   =================================== */
.credit-type-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.credit-type-badge.senior-secured {
    background: #D4EDDA;
    color: #155724;
}

.credit-type-badge.mezzanine {
    background: #FFF3CD;
    color: #856404;
}

.credit-type-badge.subordinated {
    background: #F8D7DA;
    color: #721C24;
}

.credit-type-badge.revolving-facility {
    background: #D1ECF1;
    color: #0C5460;
}

.credit-type-badge.bridge-loan {
    background: #E2E3E5;
    color: #383D41;
}

.credit-type-badge.asset-based-loan {
    background: #D6D8DB;
    color: #1B1E21;
}

.credit-type-badge.venture-debt {
    background: #CCE5FF;
    color: #004085;
}

.credit-type-badge.distressed-debt {
    background: #F8D7DA;
    color: #721C24;
}

.collateral-info {
    color: #495057;
    font-size: 13px;
    font-style: italic;
}

.collateral-info::before {
    content: "🔒 ";
    font-style: normal;
}

.yield-value {
    color: #28A745;
    font-weight: 700;
    font-size: 15px;
}

/* Update table to accommodate new columns */
@media (max-width: 1400px) {
    .opportunities-table {
        min-width: 1300px;
    }
}

/* ===================================
   CARD VIEW - CREDIT DETAILS
   =================================== */
.card-credit-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(200, 168, 104, 0.08);
    border-radius: 8px;
    border-left: 3px solid #C8A868;
}

.credit-info-item {
    flex: 1;
}

.credit-info-label {
    display: block;
    font-size: 11px;
    color: #7F8C8D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.credit-info-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1A2332;
}

.collateral-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(40, 167, 69, 0.1);
    color: #28A745;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.collateral-badge::before {
    content: "🔒";
}