/* Badge Section Styles */
.badges-section {
    background: white;
    border-radius: 16px;
    padding: 2px 25px 25px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: -30px auto 30px auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
}

.badges-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0;
    text-align: center;
    font-weight: bold;
}

.badges-description {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

.badges-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Base Badge Styles */
.badge {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin: 0;
    max-width: 100px;
    min-width: 100px;
    height: 100px;
}

.badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Badge Types */
.badge.positive {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.badge.positive .badge-content h4,
.badge.positive .badge-content p {
    color: #2e7d32;
}

.badge.negative {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border-color: #f44336;
    color: #c62828;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.2);
}

.badge.negative .badge-content h4,
.badge.negative .badge-content p {
    color: #c62828;
}

.badge.early {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.badge.early .badge-content h4,
.badge.early .badge-content p {
    color: #2e7d32;
}

.badge.steady {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.badge.steady .badge-content h4,
.badge.steady .badge-content p {
    color: #2e7d32;
}

/* Missing Badge Types - Add these to match backend types */
.badge.beginner {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.badge.beginner .badge-content h4,
.badge.beginner .badge-content p {
    color: #2e7d32;
}

.badge.captain {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.badge.captain .badge-content h4,
.badge.captain .badge-content p {
    color: #2e7d32;
}

.badge.humble {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #f44336;
    color: #c62828;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.2);
}

.badge.humble .badge-content h4,
.badge.humble .badge-content p {
    color: #c62828;
}

.badge.anchored {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #f44336;
    color: #c62828;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.2);
}

.badge.anchored .badge-content h4,
.badge.anchored .badge-content p {
    color: #c62828;
}

.badge.bold {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.badge.bold .badge-content h4,
.badge.bold .badge-content p {
    color: #2e7d32;
}



/* Badge Theme Styles - Based on Backend Types */

/* Green Theme Badges (Positive/Good) */
.badge.beginner,
.badge.steady,
.badge.early,
.badge.captain,
.badge.positive,
.badge.bold {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%) !important;
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2) !important;
}

.badge.beginner .badge-content h4,
.badge.beginner .badge-content p,
.badge.steady .badge-content h4,
.badge.steady .badge-content p,
.badge.early .badge-content h4,
.badge.early .badge-content p,
.badge.captain .badge-content h4,
.badge.captain .badge-content p,
.badge.positive .badge-content h4,
.badge.positive .badge-content p,
.badge.bold .badge-content h4,
.badge.bold .badge-content p {
    color: #2e7d32 !important;
}

/* Red Theme Badges (Warning/Attention) */
.badge.humble,
.badge.negative,
.badge.anchored {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important;
    border-color: #f44336 !important;
    color: #c62828 !important;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.2) !important;
}

.badge.humble .badge-content h4,
.badge.humble .badge-content p,
.badge.negative .badge-content h4,
.badge.negative .badge-content p,
.badge.anchored .badge-content h4,
.badge.anchored .badge-content p {
    color: #c62828 !important;
}

/* Additional specificity for small screens */
@media (max-width: 640px) {
    .badge.beginner,
    .badge.steady,
    .badge.early,
    .badge.captain,
    .badge.positive,
    .badge.bold {
        background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%) !important;
        border-color: #4caf50 !important;
        color: #2e7d32 !important;
        box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2) !important;
    }
    
    .badge.humble,
    .badge.negative,
    .badge.anchored {
        background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important;
        border-color: #f44336 !important;
        color: #c62828 !important;
        box-shadow: 0 4px 16px rgba(244, 67, 54, 0.2) !important;
    }
}

.badge.locked {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    border-color: #bdbdbd;
    opacity: 0.7;
}

/* Badge Animation Effects */
.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.badge:hover::before {
    left: 100%;
}

/* Badge Icon Styles */
.badge-icon {
    font-size: 2rem;
    text-align: center;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-icon img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    object-fit: cover;
}

/* Badge Content Styles */
.badge-content {
    z-index: 1;
    text-align: center;
}

.badge-content h4 {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

/* Badge Display Rules for Normal Screens */
.badge {
    display: none; /* Default state */
}

.badge[style*="display: flex"] {
    display: flex !important; /* Show badges with inline display: flex */
}

/* Responsive Styles for Small Screens */
@media (max-width: 640px) {
    /* Ensure badges are hidden by default on small screens */
    .badge {
        display: none !important;
    }
    
    /* Show badges that should be visible */
    .badge.visible {
        display: flex !important;
    }
    
    /* Override inline styles for visible badges */
    .badge[style*="display: flex"].visible {
        display: flex !important;
    }
    
    .badges-section {
        padding: 3px;
        margin: 3px auto;
        width: 95%;
    }

    .badges-title {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .badges-description {
        font-size: 0.8rem;
        margin: 0.6px 0 3px 0;
    }

    .badges-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1.6px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    .badge {
        max-width: 28% !important;
        min-width: 28% !important;
        width: 28% !important;
        height: 115px !important;
        padding: 1.2px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }

    .badge-icon img {
        width: 75px !important;
        height: 75px !important;
    }

    .badge-content h4 {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    /* Ensure badges are hidden by default on very small screens */
    .badge {
        display: none !important;
    }
    
    /* Show badges that should be visible */
    .badge.visible {
        display: flex !important;
    }
    
    /* Override inline styles for visible badges */
    .badge[style*="display: flex"].visible {
        display: flex !important;
    }
    
    .badges-section {
        padding: 2.4px;
        margin: 2.4px auto;
        width: 98%;
    }

    .badges-title {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }

    .badges-description {
        font-size: 0.75rem;
        margin: 0.4px 0 2.4px 0;
    }

    .badges-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1.2px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    .badge {
        max-width: 28% !important;
        min-width: 28% !important;
        width: 28% !important;
        height: 105px !important;
        padding: 0.8px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }

    .badge-icon img {
        width: 70px !important;
        height: 70px !important;
    }

    .badge-content h4 {
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
        text-align: center !important;
    }
}
