/* Matching Pages Styles */
.job-header-card,
.candidate-header-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.match-card {
    position: relative;
    background: white;
    border-radius: 6px; /* reduce from 12px to 6px */
    padding: 1rem; /* reduce from 0.5rem to 0.2rem */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.match-grid .match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.match-rank {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 1;
}

.match-card__actions {
    display: flex;
    justify-content: flex-end; /* This moves the button to the right */
    margin-top: 0.5rem;
}

.candidate-header,
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.match-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: auto;
}

.score-excellent { color: #28a745; }
.score-good { color: #17a2b8; }
.score-moderate { color: #ffc107; }
.score-low { color: #dc3545; }

.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 column for full width */
    /* grid-template-columns: auto auto;
    /* gap: 0.5rem 0.1rem; /* Reduced from 0.5rem */
    gap: 0.25rem 0.1rem; /* Reduced from 0.5rem */
    margin: 0.25rem 0; /* Reduced from 0.5rem */
    font-size: 0.8rem; /* Slightly smaller */
}

.breakdown-item {
    display: grid ; /* Changed from flex to grid control */
/*    grid-template-columns: 80px 80px 40px; /* Fixed label | Flexible meter | Fixed value */
    grid-template-columns: minmax(120px, auto) 80px auto; 
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem; /* Reduced from 0.5rem+ */
    min-width: 0; /* Prevent flex items from growing too wide */ 
}

.breakdown-label {
    text-transform: capitalize;
    color: #666;
    margin-right: 0.5rem; /* Space between label and value */
    min-width: 120px; /* Increased from previous value */
    flex-shrink: 0; /* Prevent shrinking */
    white-space: nowrap; /* Prevent text wrapping */
}

.breakdown-value {
    font-weight: 600;
 /*   min-width: 25rem; /* Fixed width for alignment */
    text-align: left;
    margin-left: -2px; /* Minimal pull */
    justify-self: start; /* hug left inside bar column */
  margin-left: 0.25rem; /* small spacing from bar */
}

.matches-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .job-header-card,
    .candidate-header-card {
        padding: 1.5rem;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .candidate-header,
    .job-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .match-score {
        margin-left: 0;
    }
}

/* Add these button styles to matching-pages.css */

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.875rem;
}

.btn--primary {
    background: #2563eb;
    color: white;
}

.btn--primary:hover {
    background: #1d4ed8;
}

.btn--secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn--secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

/* Add space between header and match cards */
.matches-header {
    margin-bottom: 02rem; /* Space after "Ranked by AI Match Score" */
}

.matches-stats .stat {
    margin-top: 0.5rem; /* Space between heading and stat text */
    display: block; /* Ensure it takes full width */
}

.matches-content-spacing {
    margin-bottom: 2rem !important;
    height: 1px;
    width: 100%;
    display: block;
}

/* Ensure consistent spacing for candidate matches */
.matching .candidate-header-card {
    margin-bottom: 2rem !important;
}

.matching .matches-header {
    margin-bottom: 2rem !important;
}

/* Add to components/matching-pages.css */
.score-meter {
    width: 60px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 8px;
}

.score-meter__bar {
    height: 100%;
    background: #20c997;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ai-justification-section {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #6f42c1;
}

.ai-justification-section h6 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px 0;
    font-size: 0.875rem;
    color: #495057;
}

.justification-content {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #6c757d;
}

.growth-breakdown-grid {
    display: grid;
    gap: 4px;
    max-width: 100%;
}

.growth-breakdown-grid .growth-metric {
    display: flex !important;
    flex: 140px 0 30px;
    text-align: left !important;
    align-items: center !important; 
/*    justify-content: space-between !important;8 */
    gap: 0.5rem !important; 
    white-space: nowrap; /* Prevent wrapping */
    min-height: 20px !important;
    max-width: 100%;
    font-family: inherit !important; /* Match score breakdown font */
    font-size: 0.8rem !important; /* Match score breakdown size */
    font-weight: 600; /* Match score breakdown weight */
    color: #495057 !important; /* Match score breakdown color */
}

.growth-breakdown-grid .growth-metric span:first-child {
    flex: 0 0 140px;
    min-width: 140px !important; /* Increased to prevent cutting */
    max-width: 140px !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: visible !important; /* Remove ellipsis - show full text */
    text-overflow: unset !important; /* Remove ellipsis */
    color: #666 !important; /* Match breakdown-label color */
    font-weight: normal !important; /* Match breakdown-label weight */
} 

.growth-breakdown-grid .score-meter {
    flex: 0 0 100px !important; 
    height: 12px;
    align-self: center;
    margin: 0 4px !important;
/*    max-width: 60px !important; */
    max-width: 100px !important;
    background: #ddd
}

/* .growth-breakdown-grid .growth-metric span:last-child {
    min-width: 30px !important;
    max-width: 30px !important;
    text-align: right !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
    color: #495057 !important; /* Match breakdown-value color */
/*} */

.growth-archetype {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #dee2e6;
}