/**
 * BADGE SYSTEM STYLES
 * Styling for badges, progress bars, and unlock notifications
 */

/* ========================================
   BADGE ITEMS
   ======================================== */

.badge-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.badge-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-name {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    font-size: var(--font-size-sm);
}

.badge-description {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    margin-top: var(--space-xs);
    display: block;
}

/* ========================================
   BADGE PROGRESS BARS
   ======================================== */

.badge-progress-container {
    background: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-md);
}

.badge-progress-category-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary);
}

.badge-progress {
    margin-bottom: var(--space-lg);
}

.badge-progress:last-child {
    margin-bottom: 0;
}

.badge-progress-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.badge-progress-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-progress-name {
    flex: 1;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    font-size: var(--font-size-sm);
}

.badge-progress-stats {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    font-weight: var(--font-weight-medium);
}

.badge-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.badge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
}

/* ========================================
   BADGE UNLOCK NOTIFICATION
   ======================================== */

.badge-unlock-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    width: 350px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--space-xl);
    z-index: 9999;
    transition: right 0.3s ease;
    border: 2px solid var(--primary);
}

.badge-unlock-notification.show {
    right: var(--space-lg);
}

.badge-unlock-content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.badge-unlock-icon {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    flex-shrink: 0;
    animation: badgePulse 0.6s ease;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.badge-unlock-text {
    flex: 1;
}

.badge-unlock-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.badge-unlock-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.badge-unlock-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .badge-unlock-notification {
        right: -100%;
        left: var(--space-md);
        width: calc(100% - var(--space-xl));
        max-width: 350px;
    }

    .badge-unlock-notification.show {
        right: auto;
        left: var(--space-md);
    }
}

/* ========================================
   BADGE COLLECTION MODAL
   ======================================== */

.badge-collection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--space-lg);
}

.badge-collection-modal.active {
    display: flex;
}

.badge-collection-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl);
}

.badge-collection-header {
    padding: var(--space-xl);
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-gradient);
    color: var(--white);
}

.badge-collection-header h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.badge-collection-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.badge-collection-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.badge-collection-body {
    padding: var(--space-xl);
    overflow-y: auto;
}

.badge-collection-category {
    margin-bottom: var(--space-2xl);
}

.badge-collection-category:last-child {
    margin-bottom: 0;
}

.badge-collection-category-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.badge-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.badge-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.badge-card.earned {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(50%);
}

.badge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.badge-card-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
}

.badge-card-name {
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-base);
}

.badge-card-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

.badge-card-status {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.badge-card-status.earned {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-card-status.locked {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-card-rarity {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--space-xs);
}

/* Mobile adjustments */
@media (max-width: 767px) {
    /* Hide desktop modal on mobile - use drawer instead */
    .badge-collection-modal {
        display: none !important;
    }

    .badge-collection-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .badge-collection-grid {
        grid-template-columns: 1fr;
    }

    .badge-collection-header {
        padding: var(--space-lg);
    }

    .badge-collection-header h2 {
        font-size: var(--font-size-xl);
    }

    .badge-collection-body {
        padding: var(--space-lg);
    }
}

/* ========================================
   BADGE COUNT INDICATOR
   ======================================== */

.badge-count {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
}

/* ========================================
   SECRET BADGE INDICATOR
   ======================================== */

.badge-secret {
    position: relative;
}

.badge-secret::after {
    content: '🔒';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
    background: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   MOBILE DRAWER BADGE COLLECTION
   ======================================== */

.mobile-badge-collection {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
}

.mobile-badge-header {
    position: sticky;
    top: 0;
    background: var(--primary-gradient);
    color: var(--white);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.mobile-badge-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 44px;
}

.mobile-badge-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-badge-header h2 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    flex: 1;
}

.mobile-badge-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--gray-50);
}

.mobile-badge-category {
    margin-bottom: var(--space-2xl);
}

.mobile-badge-category:last-child {
    margin-bottom: 0;
}

.mobile-badge-category-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-badge-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.mobile-badge-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: all var(--transition-base);
}

.mobile-badge-card.earned {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

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

.mobile-badge-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.mobile-badge-info {
    flex: 1;
    min-width: 0;
}

.mobile-badge-name {
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-base);
}

.mobile-badge-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
}

.mobile-badge-progress {
    margin-top: var(--space-sm);
}

.mobile-badge-progress-text {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    margin-top: var(--space-xs);
    font-weight: var(--font-weight-semibold);
}
