/* Modern Health Component Styles */

/* Status Button */
.health-status-btn {
    min-width: 32px !important;
    font-weight: 600;
    text-transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: black !important;
    border-color: white !important;
}

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

/* Super Growth Button - Animated gradient with rocket effect */
.health-btn-super-growth {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4, #FECA57) !important;
    color: black !important;
}

.health-btn-super-growth:hover {
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6), 0 0 30px rgba(255, 107, 107, 0.5) !important;
}

/* Growing Button - Success green with subtle animation */
.health-btn-growing {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    animation: healthGrowingPulse 3s ease-in-out infinite !important;
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3) !important;
}

.health-btn-growing:hover {
    box-shadow: 0 5px 18px rgba(40, 167, 69, 0.5) !important;
}

/* Stagnating Button - Warning yellow/orange */
.health-btn-stagnating {
    background: linear-gradient(135deg, #9c9a94, #eb9655) !important;
    box-shadow: 0 3px 12px rgba(255, 193, 7, 0.3) !important;
}

.health-btn-stagnating:hover {
    box-shadow: 0 5px 18px rgba(255, 193, 7, 0.5) !important;
}

/* Declining Button - Error red with warning animation */
.health-btn-declining {
    background: linear-gradient(135deg, #dc3545, #bd2130) !important;
    animation: healthDecliningWarning 2s ease-in-out infinite !important;
    box-shadow: 0 3px 12px rgba(220, 53, 69, 0.3) !important;
}

.health-btn-declining:hover {
    box-shadow: 0 5px 18px rgba(220, 53, 69, 0.5) !important;
}

.health-status-text {
    margin-left: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Popup Card */
.health-popover {
    z-index: 1300;
    padding: 0px !important;
    margin: 0px !important;
}

.health-popup-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    min-width: 400px;
    overflow: hidden;
}

.health-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.health-popup-title {
    display: flex;
    align-items: center;
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.health-close-btn {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.health-close-btn:hover {
    opacity: 1;
}

.health-popup-content {
    padding: 10px 8px;
    max-height: 75vh;
    overflow-y: auto;
}

/* Loading and Error States */
.health-loading, .health-error {
    padding: 20px;
    text-align: center;
}

/* Section Styling */
.health-section {
    margin-bottom: 24px;
}

.health-section:last-child {
    margin-bottom: 0;
}

.health-section-header {
    display: flex;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.health-section-icon {
    color: #6c757d;
    margin-right: 8px;
}

.health-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.health-players-chart {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 24px;
    padding: 8px 0;
}

.health-tournaments-chart {
    display: flex;
    align-items: flex-end;
    flex-direction: row;
    gap: 24px;
    padding: 8px 0;
}

@media (max-width: 576px) {
    .health-tournaments-chart {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

.health-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.health-group-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    text-align: center;
}

.health-bar-triplet {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 24px !important;
}

.health-bar-quartet {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 24px !important;
}

.health-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    flex: 1;
    height: auto;
}

.health-bar {
    position: relative;
    width: 32px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 4px;
    min-height: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: all 0.3s ease;
}

.health-bar-green {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.health-bar-red {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.health-bar-neutral {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.health-bar:hover {
    transform: scaleY(1.1);
    filter: brightness(1.1);
}

.health-bar-value {
    position: absolute;
    top: -20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.health-bar-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
}

/* Player Retention Chart */
.health-retention-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-retention-group {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 32px;
}

.health-retention-bars {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    flex: 1;
    height: 24px;
}

.health-retention-bar {
    position: relative;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    transition: all 0.3s ease;
}

.health-retention-bar:hover {
    transform: scaleY(1.2);
    z-index: 10;
}

.health-retention-initial {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    align-items: center;
    justify-content: start;
    gap: 6px;
    padding-left: 12px;
}

@media (max-width: 576px) {
    .health-retention-initial {
        padding-left: 2px;
    }
}

.health-retention-arrow-initial {
    color: #20c997;
}

.health-retention-two-years {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
}

.health-retention-arrow-two-years {
    color: #ffb300;
}

.health-retention-one-year {
    background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%);
}

.health-retention-arrow-one-year {
    color: #e55a00;
}

.health-retention-current {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.health-retention-arrow-current {
    color: #bd2130;
}

.health-retention-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: black;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 576px) {
    .health-popup-card {
        max-width: 95vw;
        min-width: 320px;
    }
    
    .health-retention-bars {
        gap: 1px;
    }
}

/* Smooth Animations */
@keyframes healthFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Growing Animation */
@keyframes healthGrowingPulse {
    0%, 100% {
        box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 3px 12px rgba(40, 167, 69, 0.5);
    }
}

/* Declining Warning Animation */
@keyframes healthDecliningWarning {
    0%, 100% {
        box-shadow: 0 3px 12px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 3px 12px rgba(220, 53, 69, 0.6);
    }
}

.health-section {
    animation: healthFadeIn 0.4s ease-out;
}

.health-section:nth-child(2) {
    animation-delay: 0.1s;
}

.health-section:nth-child(3) {
    animation-delay: 0.2s;
}

.health-section:nth-child(4) {
    animation-delay: 0.3s;
}

.health-summary-text {
    font-size: 0.7rem;
    color: #6c757d;
    text-align: left;
    font-weight: bold;
}