/* Custom styles for NJK Rankings */

/* Gender Badge Fix - Ensure proper text color and background */
.badge.bg-pink,
.swagger-ui .badge.bg-pink,
span.badge.bg-pink {
    background-color: #e91e63 !important; /* Material Design Pink */
    color: white !important;
    border: none !important;
}

/* Alternative: Use Bootstrap's standard pink if bg-pink fails */
.badge.bg-danger.female-badge {
    background-color: #e91e63 !important; /* Material Design Pink */
    color: white !important;
}

.badge.bg-info,
.swagger-ui .badge.bg-info,
span.badge.bg-info {
    color: white !important;
    background-color: #0dcaf0 !important;
}

/* Club History Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
}

/* NJK Rankings Specific Fixes */
.njk-rankings .rankings-results .d-flex h3.h5.mb-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.2;
    display: block !important; /* Force block display to prevent flex interference */
}

/* Ensure proper spacing in flexbox containers for rankings headers */
.rankings-results .d-flex.justify-content-between.align-items-center h3 {
    margin: 0 !important;
    line-height: 1.2;
    display: block !important; /* Ensure h3 stays as block element */
}

/* General fix for heading elements with mb-0 in flexbox containers */
.d-flex h1.mb-0,
.d-flex h2.mb-0,
.d-flex h3.mb-0,
.d-flex h4.mb-0,
.d-flex h5.mb-0,
.d-flex h6.mb-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Fix alignment between result-info and badge elements */
.result-info {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
}

.result-info h3 {
    margin-bottom: 0.25rem !important; /* Reduce spacing between h3 and text-muted */
}

.result-info .text-muted {
    margin-bottom: 0 !important; /* Remove any bottom margin */
}

/* Ensure badges align properly with result-info */
.badge.bg-primary.fs-6 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    line-height: 1.2 !important; /* Match closer to result-info line-height */
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #007bff, #28a745);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -23px;
    top: 8px;
    width: 16px;
    height: 16px;
    background: #007bff;
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-marker.current {
    background: #28a745;
    width: 20px;
    height: 20px;
    left: -25px;
    animation: pulse 2s infinite;
}

.timeline-marker i {
    font-size: 8px;
    color: white;
}

.timeline-marker.current i {
    font-size: 10px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.timeline-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.club-card {
    padding: 1.5rem;
}

.club-name {
    color: #2c3e50;
    font-weight: 600;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

.period-details {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* NJK Rankings Specific Fixes */
.njk-rankings .rankings-results .d-flex h3.h5.mb-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.2;
    display: block !important; /* Force block display to prevent flex interference */
}

/* Ensure proper spacing in flexbox containers for rankings headers */
.rankings-results .d-flex.justify-content-between.align-items-center h3 {
    margin: 0 !important;
    line-height: 1.2;
    display: block !important; /* Ensure h3 stays as block element */
}

/* General fix for heading elements with mb-0 in flexbox containers */
.d-flex h1.mb-0,
.d-flex h2.mb-0,
.d-flex h3.mb-0,
.d-flex h4.mb-0,
.d-flex h5.mb-0,
.d-flex h6.mb-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-marker {
        left: -18px;
        width: 12px;
        height: 12px;
    }
    
    .timeline-marker.current {
        width: 16px;
        height: 16px;
        left: -20px;
    }
    
    .timeline-marker i {
        font-size: 6px;
    }
    
    .timeline-marker.current i {
        font-size: 8px;
    }
    
    .club-card {
        padding: 1rem;
    }
}
