/* ============================================
   ACHIEVEMENTS.CSS - Ultra Premium Design
   Stunning • Animated • Attractive
   ============================================ */

/* ============================================
   PAGE CONTAINER
   ============================================ */
#achievements-page {
    padding: 0;
    margin: 0;
    width: 100%;
    animation: fadeIn 0.6s ease;
}

#achievements-page .dashboard-section {
    margin: 0 0 32px 0;
    width: 100%;
}

/* ============================================
   SECTION TITLE - Premium with Glow
   ============================================ */
#achievements-page .section-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-primary);
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

#achievements-page .section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #FBBF24, #F59E0B, #FBBF24);
    border-radius: 3px;
    animation: titleGlow 2s ease infinite;
    background-size: 200% 100%;
}

@keyframes titleGlow {
    0%, 100% { background-position: 0% 50%; width: 80px; }
    50% { background-position: 100% 50%; width: 120px; }
}

#achievements-page .section-title i {
    font-size: 1.5rem;
    color: #FBBF24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.05));
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    animation: trophyPulse 2s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.05);
}

@keyframes trophyPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(251, 191, 36, 0.05); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(251, 191, 36, 0.15); }
}

/* ============================================
   ACHIEVEMENTS SUMMARY - Premium Cards with Glow
   ============================================ */
.achievements-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
    width: 100%;
}

.summary-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* Card 1 - Purple Gradient */
.summary-card:first-child::before {
    background: linear-gradient(90deg, #6366F1, #8B5CF6, #A78BFA);
    animation: cardGlow1 3s ease infinite;
    background-size: 200% 100%;
}

@keyframes cardGlow1 {
    0%, 100% { background-position: 0% 50%; opacity: 0.8; }
    50% { background-position: 100% 50%; opacity: 1; }
}

/* Card 2 - Green Gradient */
.summary-card.completed::before {
    background: linear-gradient(90deg, #10B981, #34D399, #6EE7B7);
    animation: cardGlow2 3s ease infinite;
    background-size: 200% 100%;
}

@keyframes cardGlow2 {
    0%, 100% { background-position: 0% 50%; opacity: 0.8; }
    50% { background-position: 100% 50%; opacity: 1; }
}

/* Card 3 - Orange Gradient */
.summary-card.progress::before {
    background: linear-gradient(90deg, #F59E0B, #FBBF24, #FCD34D);
    animation: cardGlow3 3s ease infinite;
    background-size: 200% 100%;
}

@keyframes cardGlow3 {
    0%, 100% { background-position: 0% 50%; opacity: 0.8; }
    50% { background-position: 100% 50%; opacity: 1; }
}

/* Shine Effect */
.summary-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.summary-card:hover::after {
    opacity: 1;
}

.summary-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--clr-primary);
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 2.8rem;
    font-weight: 900;
    font-family: 'Inter', monospace;
    letter-spacing: -1px;
    display: block;
    line-height: 1;
}

.summary-card:first-child .summary-value {
    background: linear-gradient(135deg, #8B5CF6, #6366F1, #A78BFA);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-card.completed .summary-value {
    background: linear-gradient(135deg, #34D399, #10B981, #6EE7B7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-card.progress .summary-value {
    background: linear-gradient(135deg, #FBBF24, #F59E0B, #FCD34D);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   ACHIEVEMENTS GRID
   ============================================ */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

/* ============================================
   ACHIEVEMENT CARD - Premium with Glow
   ============================================ */
.achievement-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    cursor: default;
    animation: cardFadeIn 0.5s ease backwards;
}

.achievement-card:nth-child(1) { animation-delay: 0.05s; }
.achievement-card:nth-child(2) { animation-delay: 0.10s; }
.achievement-card:nth-child(3) { animation-delay: 0.15s; }
.achievement-card:nth-child(4) { animation-delay: 0.20s; }
.achievement-card:nth-child(5) { animation-delay: 0.25s; }
.achievement-card:nth-child(6) { animation-delay: 0.30s; }

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top Accent Line */
.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    transition: all 0.4s ease;
}

/* Locked State */
.achievement-card.locked::before {
    background: linear-gradient(90deg, #475569, #64748B, #475569);
    opacity: 0.5;
}

/* In Progress State */
.achievement-card.in-progress::before {
    background: linear-gradient(90deg, #F59E0B, #FBBF24, #F59E0B);
    animation: progressGlow 2s ease infinite;
    background-size: 200% 100%;
}

@keyframes progressGlow {
    0%, 100% { background-position: 0% 50%; opacity: 0.7; }
    50% { background-position: 100% 50%; opacity: 1; }
}

/* Unlocked State */
.achievement-card.unlocked::before {
    background: linear-gradient(90deg, #10B981, #34D399, #6EE7B7, #10B981);
    animation: unlockedGlow 2s ease infinite;
    background-size: 300% 100%;
}

@keyframes unlockedGlow {
    0%, 100% { background-position: 0% 50%; opacity: 0.8; }
    50% { background-position: 100% 50%; opacity: 1; }
}

/* Corner Glow for Unlocked */
.achievement-card.unlocked::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 70%);
    border-radius: 0 20px 0 0;
    pointer-events: none;
}

.achievement-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--clr-primary);
}

/* ============================================
   ACHIEVEMENT ICON - Premium
   ============================================ */
.achievement-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Icon Background Glow */
.achievement-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
    border-radius: 50%;
    z-index: -1;
    transition: all 0.4s ease;
}

.achievement-card.unlocked .achievement-icon::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%);
    animation: iconPulse 2s ease infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.achievement-card:hover .achievement-icon {
    transform: scale(1.08) rotate(-3deg);
}

/* ============================================
   ACHIEVEMENT TITLE
   ============================================ */
.achievement-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
    transition: all 0.3s ease;
}

.achievement-card.unlocked .achievement-title {
    background: linear-gradient(135deg, #FFFFFF, #34D399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.achievement-card.in-progress .achievement-title {
    background: linear-gradient(135deg, #FFFFFF, #FBBF24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   ACHIEVEMENT DESCRIPTION
   ============================================ */
.achievement-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* ============================================
   ACHIEVEMENT STATUS BADGE - Premium
   ============================================ */
.achievement-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    transition: all 0.3s ease;
}

.status-completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.05));
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-completed::before {
    content: '✓';
    font-weight: 900;
}

.status-progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.05));
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-progress::before {
    content: '⟳';
    font-weight: 900;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-locked {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.status-locked::before {
    content: '🔒';
    font-size: 0.7rem;
}

/* ============================================
   ACHIEVEMENT PROGRESS BAR - Premium
   ============================================ */
.achievement-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.achievement-progress {
    height: 100%;
    border-radius: 30px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Progress Fill Colors */
.achievement-card.unlocked .achievement-progress {
    background: linear-gradient(90deg, #10B981, #34D399, #6EE7B7);
}

.achievement-card.in-progress .achievement-progress {
    background: linear-gradient(90deg, #F59E0B, #FBBF24, #FCD34D);
}

.achievement-card.locked .achievement-progress {
    background: linear-gradient(90deg, #475569, #64748B);
}

/* Shimmer Effect */
.achievement-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   ACHIEVEMENT TIER BADGE - Premium
   ============================================ */
.achievement-tier {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.achievement-card:hover .achievement-tier {
    transform: scale(1.05);
}

.achievement-tier.bronze {
    background: linear-gradient(135deg, #CD7F32, #A97142);
}

.achievement-tier.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.achievement-tier.gold {
    background: linear-gradient(135deg, #FFD700, #DAA520);
    animation: goldPulse 2s ease infinite;
}

@keyframes goldPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(255, 215, 0, 0.6); }
}

.achievement-tier.platinum {
    background: linear-gradient(135deg, #E5E4E2, #B8B8B8);
}

.achievement-tier.diamond {
    background: linear-gradient(135deg, #B9F2FF, #7DD3FC);
    animation: diamondPulse 2s ease infinite;
}

@keyframes diamondPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(185, 242, 255, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(185, 242, 255, 0.6); }
}

/* ============================================
   CONFETTI BURST FOR UNLOCKED
   ============================================ */
.achievement-card.unlocked .achievement-confetti {
    position: absolute;
    pointer-events: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    opacity: 0.3;
}

.achievement-confetti span {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    animation: confettiFall 4s ease-in-out infinite;
}

@keyframes confettiFall {
    0% { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(80px) rotate(720deg) scale(0); opacity: 0; }
}

/* ============================================
   EMPTY STATE - Premium
   ============================================ */
.achievements-grid:empty {
    grid-column: 1 / -1;
}

.achievements-grid:empty::after {
    content: 'Start your achievement journey! Complete anime to unlock achievements.';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    grid-column: 1 / -1;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 2px dashed var(--border);
}

.achievements-grid:empty::before {
    content: '\f07c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 3rem;
    display: block;
    text-align: center;
    color: var(--clr-secondary);
    opacity: 0.3;
    grid-column: 1 / -1;
    margin-top: 30px;
}

/* ============================================
   LIGHT THEME SUPPORT
   ============================================ */
[data-theme="light"] .summary-card,
[data-theme="light"] .achievement-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .summary-card:hover,
[data-theme="light"] .achievement-card:hover {
    border-color: var(--clr-primary);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.08);
}

[data-theme="light"] .status-locked {
    background: #F1F5F9;
    color: #94A3B8;
}

[data-theme="light"] .achievement-card.unlocked .achievement-title {
    background: linear-gradient(135deg, #1a1f2e, #10B981);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .achievement-card.in-progress .achievement-title {
    background: linear-gradient(135deg, #1a1f2e, #F59E0B);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    #achievements-page .section-title {
        font-size: 1.3rem;
    }
    
    .achievements-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .summary-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 18px 20px;
    }
    
    .summary-label {
        margin-bottom: 0;
        font-size: 0.65rem;
    }
    
    .summary-value {
        font-size: 2rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .achievement-card {
        padding: 18px 16px;
        border-radius: 16px;
    }
    
    .achievement-icon {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }
    
    .achievement-title {
        font-size: 0.95rem;
    }
    
    .achievement-desc {
        font-size: 0.75rem;
    }
    
    .achievement-tier {
        top: 10px;
        right: 10px;
        font-size: 0.45rem;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    #achievements-page .section-title {
        font-size: 1.1rem;
    }
    
    #achievements-page .section-title i {
        font-size: 1rem;
        padding: 6px;
    }
    
    .summary-value {
        font-size: 1.6rem;
    }
    
    .summary-card {
        padding: 14px 16px;
    }
    
    .achievement-card {
        padding: 14px 12px;
        border-radius: 14px;
    }
    
    .achievement-icon {
        font-size: 1.8rem;
    }
    
    .achievement-status {
        font-size: 0.5rem;
        padding: 3px 10px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .summary-card,
    .achievement-card,
    .achievement-card.unlocked .achievement-icon::before,
    .achievement-progress::after,
    .summary-card::before,
    .achievement-card::before,
    .summary-card::after,
    .achievement-tier,
    .achievement-status.progress::before {
        animation: none !important;
        transition: none !important;
    }
    
    .summary-card:hover,
    .achievement-card:hover {
        transform: none !important;
    }
}