/**
 * AiDalil Badges System Styles
 * Modern, Dark Mode Compatible
 */

/* ==========================================
   🎖️ Single Badge
========================================== */
.aidalil-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: help;
}

.aidalil-badge:hover {
    transform: translateY(-3px) scale(1.05);
}

.badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    flex-shrink: 0;
}

.badge-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
}

.badge-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.badge-info strong {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.badge-info small {
    color: #a0a0a0;
    font-size: 12px;
}

/* Rarity Borders */
.badge-bronze .badge-icon {
    border: 2px solid #cd7f32;
}

.badge-silver .badge-icon {
    border: 2px solid #c0c0c0;
}

.badge-gold .badge-icon {
    border: 2px solid #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.badge-platinum .badge-icon {
    border: 2px solid #e5e4e2;
    box-shadow: 0 4px 20px rgba(229, 228, 226, 0.4);
}

.badge-legendary .badge-icon {
    border: 2px solid #f093fb;
    box-shadow: 0 4px 25px rgba(240, 147, 251, 0.5);
    animation: legendary-glow 2s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% { box-shadow: 0 4px 25px rgba(240, 147, 251, 0.5); }
    50% { box-shadow: 0 4px 35px rgba(245, 87, 108, 0.7); }
}

/* ==========================================
   📦 Compact View (Header)
========================================== */
.aidalil-badges-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.aidalil-badges-compact .aidalil-badge {
    margin: 0;
}

.badges-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: rgba(88, 243, 255, 0.1);
    border: 1px solid rgba(88, 243, 255, 0.3);
    color: #58f3ff;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
}

/* ==========================================
   📊 Badges Grid (Dashboard/Profile)
========================================== */
.aidalil-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.badge-card {
    background: #1a222e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.badge-card:hover {
    transform: translateY(-3px);
    border-color: rgba(88, 243, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.badge-card.earned {
    background: linear-gradient(135deg, rgba(88, 243, 255, 0.05) 0%, rgba(15, 20, 31, 1) 100%);
}

.badge-card.locked {
    opacity: 0.6;
}

.badge-card.locked .badge-icon {
    filter: grayscale(100%);
}

.badge-card-content {
    flex-grow: 1;
    min-width: 0;
}

.badge-card-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
}

.badge-card-desc {
    color: #a0a0a0;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.badge-card-progress {
    margin-top: 10px;
}

.progress-bar-wrapper {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #58f3ff 0%, #2eafc5 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #808080;
}

/* Rarity Indicator */
.badge-rarity-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rarity-bronze { background: rgba(205, 127, 50, 0.2); color: #cd7f32; }
.rarity-silver { background: rgba(192, 192, 192, 0.2); color: #c0c0c0; }
.rarity-gold { background: rgba(255, 215, 0, 0.2); color: #ffd700; }
.rarity-platinum { background: rgba(229, 228, 226, 0.2); color: #e5e4e2; }
.rarity-legendary { 
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2) 0%, rgba(245, 87, 108, 0.2) 100%);
    color: #f093fb;
}

/* Earned Checkmark */
.badge-earned-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* ==========================================
   📱 Category Section
========================================== */
.badge-category-section {
    margin-bottom: 40px;
}

.badge-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.badge-category-icon {
    width: 48px;
    height: 48px;
    background: rgba(88, 243, 255, 0.1);
    border: 1px solid rgba(88, 243, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #58f3ff;
    font-size: 20px;
}

.badge-category-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.badge-category-count {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 12px;
    color: #a0a0a0;
    font-size: 13px;
}

/* ==========================================
   📊 Stats Summary
========================================== */
.badges-stats-summary {
    background: linear-gradient(135deg, rgba(88, 243, 255, 0.05) 0%, rgba(15, 20, 31, 1) 100%);
    border: 1px solid rgba(88, 243, 255, 0.2);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-item-big {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-item-big .stat-value {
    font-size: 36px;
    font-weight: 800;
    color: #58f3ff;
    line-height: 1;
}

.stat-item-big .stat-label {
    color: #a0a0a0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   📱 Responsive
========================================== */
@media (max-width: 768px) {
    .aidalil-badges-grid {
        grid-template-columns: 1fr;
    }
    
    .badge-card {
        padding: 15px;
    }
    
    .badge-card-title {
        font-size: 14px;
    }
    
    .badges-stats-summary {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px;
    }
    
    .stat-item-big .stat-value {
        font-size: 28px;
    }
}