/* =====================================================
   Compatibility Score Styling
   ===================================================== */

/* Main Compatibility Badge (Top Right Corner) */
.compatibility-badge {
    position: relative;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compatibility-badge:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.badge-score {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.badge-level {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Score Level Badges */
.badge-excellent {
    background: #d4edda;
    color: #155724;
}

.badge-good {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-moderate {
    background: #fff3cd;
    color: #856404;
}

.badge-low {
    background: #f8d7da;
    color: #721c24;
}

.badge-poor {
    background: #e2e3e5;
    color: #383d41;
}

/* =====================================================
   Score Bar Components
   ===================================================== */

/* Horizontal Score Bar */
.score-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    background-size: 100% 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

/* Score with Label */
.score-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.score-percentage {
    font-weight: 700;
    color: #2c3e50;
}

.score-text {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    margin-top: 4px;
}

/* =====================================================
   Category Scores Grid
   ===================================================== */

.category-scores-grid {
    margin: 24px 0;
}

.category-scores-grid h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: #2c3e50;
}

.scores-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.score-card {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.score-card:hover {
    background: #f0f2f5;
    border-color: #dee2e6;
}

.score-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mini Score Bar */
.mini-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-bar {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    background-size: 100% 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.mini-percent {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 30px;
    text-align: right;
}

/* =====================================================
   Score Tooltip / Breakdown
   ===================================================== */

.score-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 1000;
    padding: 12px;
}

.compatibility-badge:hover .score-tooltip {
    display: block;
}

.tooltip-header {
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.tooltip-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.score-name {
    min-width: 70px;
    color: #495057;
    font-weight: 500;
}

.score-mini-bar {
    flex: 1;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.score-mini-bar .mini-fill {
    height: 100%;
}

.score-value {
    min-width: 35px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

/* =====================================================
   Breed Card Integration
   ===================================================== */

.breed-card {
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.breed-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #dee2e6;
}

.breed-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    height: 240px;
}

.breed-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.breed-card:hover .breed-image {
    transform: scale(1.05);
}

.breed-image-wrapper .compatibility-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    font-size: 12px;
}

.breed-info {
    padding: 12px;
}

.breed-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #2c3e50;
}

.breed-species {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breed-summary {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

.compatibility-bar-container {
    margin: 12px 0;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.breed-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.attr-tag {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f2f5;
    border-radius: 4px;
    font-size: 11px;
    color: #495057;
}

.breed-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.btn {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-outline {
    background: white;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline:hover {
    background: #f0f8ff;
}

/* =====================================================
   Detail View Compatibility
   ===================================================== */

.breed-detail-view {
    max-width: 1000px;
    margin: 0 auto;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.detail-header h1 {
    flex: 1;
    margin: 0;
    font-size: 32px;
    color: #2c3e50;
}

.detail-compatibility {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.large-score-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.large-score-bar .score-fill {
    height: 100%;
    border-radius: 10px;
}

.score-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.large-percentage {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
}

.large-level {
    font-size: 14px;
    color: #7f8c8d;
}

/* =====================================================
   Mismatches & Strengths
   ===================================================== */

.mismatches-section,
.strengths-section {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 8px;
}

.mismatches-section {
    background: #fff5f5;
    border-left: 4px solid #ff6b6b;
}

.mismatches-section h3 {
    color: #c92a2a;
    margin-top: 0;
}

.strengths-section {
    background: #f0fdf4;
    border-left: 4px solid #6bcf7f;
}

.strengths-section h3 {
    color: #2f7c31;
    margin-top: 0;
}

.mismatches-list,
.strengths-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mismatch-item,
.strength-item {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    font-size: 14px;
    line-height: 1.6;
}

.mismatch-item::before {
    content: "⚠️";
    position: absolute;
    left: 0;
}

.strength-item::before {
    content: "✅";
    position: absolute;
    left: 0;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
    }
    
    .detail-compatibility {
        flex: 1 1 100%;
    }
    
    .scores-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .breed-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .scores-container {
        grid-template-columns: 1fr;
    }
    
    .large-percentage {
        font-size: 28px;
    }
    
    .detail-header h1 {
        font-size: 24px;
    }
}
