/* ============================================
   ACHIEVEMENT TOAST - Notification Styles
   ============================================ */

/* Container */
#achievement-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

#achievement-toast-container > * {
    pointer-events: auto;
}

/* Toast principal */
.achievement-toast {
    width: 340px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: at-slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateX(120%);
    opacity: 0;
}

.achievement-toast.hiding {
    animation: at-slideOut 0.3s ease-in forwards;
}

@keyframes at-slideIn {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes at-slideOut {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
}

/* Barre de progression en haut */
.achievement-toast .toast-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #a67c00, #f4e4a6, #d4af37);
    animation: at-progress 5s linear forwards;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

@keyframes at-progress {
    0% { width: 100%; }
    100% { width: 0%; }
}

/* Shimmer fond */
.achievement-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    animation: at-shimmer 2s ease-in-out infinite;
}

@keyframes at-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Badge icon */
.achievement-toast .toast-badge {
    width: 64px;
    height: 64px;
    background: linear-gradient(145deg, #2a2a2a 0%, #0d0d0d 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    animation: at-badgePulse 2s ease-in-out infinite;
}

@keyframes at-badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(212, 175, 55, 0), 0 4px 20px rgba(212, 175, 55, 0.3);
    }
}

.achievement-toast .toast-badge svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

/* Glow rotatif badge */
.achievement-toast .toast-badge::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    background: conic-gradient(from 0deg, transparent, rgba(212, 175, 55, 0.5), transparent, transparent, transparent);
    animation: at-rotate 3s linear infinite;
    z-index: -1;
}

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

/* Texte */
.achievement-toast .toast-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #a67c00, #f4e4a6, #d4af37, #f4e4a6, #a67c00);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: at-textShimmer 2s ease-in-out infinite;
    margin-bottom: 6px;
}

@keyframes at-textShimmer {
    0%, 100% { background-position: -200% center; }
    50% { background-position: 200% center; }
}

.achievement-toast .toast-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.achievement-toast .toast-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-toast .toast-description {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button */
.achievement-toast .toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    z-index: 2;
}

.achievement-toast .toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}


/* ============= COMMON ============= */
.achievement-toast.common {
    border-color: rgba(136, 136, 136, 0.3);
}

.achievement-toast.common .toast-badge {
    border-color: rgba(136, 136, 136, 0.4);
    animation: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.achievement-toast.common .toast-badge::before {
    display: none;
}

.achievement-toast.common .toast-badge svg {
    filter: drop-shadow(0 0 4px rgba(136, 136, 136, 0.3));
}

.achievement-toast.common .toast-label {
    background: linear-gradient(90deg, #666, #999, #666);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

.achievement-toast.common .toast-progress {
    background: linear-gradient(90deg, #555, #888, #666);
}

.achievement-toast.common::before {
    background: linear-gradient(90deg, transparent, rgba(136, 136, 136, 0.05), transparent);
}


/* ============= UNCOMMON ============= */
.achievement-toast.uncommon {
    border-color: rgba(201, 166, 107, 0.3);
}

.achievement-toast.uncommon .toast-badge {
    border-color: rgba(201, 166, 107, 0.4);
    animation-name: at-badgePulseUncommon;
}

.achievement-toast.uncommon .toast-badge::before {
    background: conic-gradient(from 0deg, transparent, rgba(201, 166, 107, 0.4), transparent, transparent, transparent);
}

.achievement-toast.uncommon .toast-badge svg {
    filter: drop-shadow(0 0 6px rgba(201, 166, 107, 0.4));
}

.achievement-toast.uncommon .toast-label {
    background: linear-gradient(90deg, #8a6e3e, #dfc08a, #c9a66b, #dfc08a, #8a6e3e);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

.achievement-toast.uncommon .toast-progress {
    background: linear-gradient(90deg, #8a6e3e, #dfc08a, #c9a66b);
}

.achievement-toast.uncommon::before {
    background: linear-gradient(90deg, transparent, rgba(201, 166, 107, 0.08), transparent);
}

@keyframes at-badgePulseUncommon {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(201, 166, 107, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(201, 166, 107, 0), 0 4px 18px rgba(201, 166, 107, 0.2);
    }
}


/* ============= RARE ============= */
.achievement-toast.rare {
    border-color: rgba(212, 175, 55, 0.4);
}


/* ============= EPIC ============= */
.achievement-toast.epic {
    border-color: rgba(155, 89, 182, 0.5);
}

.achievement-toast.epic .toast-badge {
    border-color: rgba(155, 89, 182, 0.5);
    animation-name: at-badgePulseEpic;
}

.achievement-toast.epic .toast-badge::before {
    background: conic-gradient(from 0deg, transparent, rgba(155, 89, 182, 0.5), transparent, transparent, transparent);
}

.achievement-toast.epic .toast-badge svg {
    filter: drop-shadow(0 0 8px rgba(155, 89, 182, 0.5));
}

.achievement-toast.epic .toast-label {
    background: linear-gradient(90deg, #6c3483, #bb77d6, #9b59b6, #bb77d6, #6c3483);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

.achievement-toast.epic .toast-progress {
    background: linear-gradient(90deg, #6c3483, #bb77d6, #9b59b6);
}

.achievement-toast.epic::before {
    background: linear-gradient(90deg, transparent, rgba(155, 89, 182, 0.1), transparent);
}

@keyframes at-badgePulseEpic {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(155, 89, 182, 0), 0 4px 20px rgba(155, 89, 182, 0.3);
    }
}


/* ============= LEGENDARY ============= */
.achievement-toast.legendary {
    border-color: rgba(243, 156, 18, 0.6);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(243, 156, 18, 0.2);
    animation: at-slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards, at-legendaryGlow 2s ease-in-out infinite;
}

@keyframes at-legendaryGlow {
    0%, 100% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(243, 156, 18, 0.15); }
    50% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(243, 156, 18, 0.3); }
}

.achievement-toast.legendary .toast-badge {
    border-color: rgba(243, 156, 18, 0.6);
    animation-name: at-badgePulseLegendary;
}

.achievement-toast.legendary .toast-badge::before {
    background: conic-gradient(from 0deg, transparent, rgba(243, 156, 18, 0.6), rgba(241, 196, 15, 0.4), transparent, transparent);
}

.achievement-toast.legendary .toast-badge svg {
    filter: drop-shadow(0 0 10px rgba(243, 156, 18, 0.6));
}

.achievement-toast.legendary .toast-label {
    background: linear-gradient(90deg, #c27c0e, #f1c40f, #f39c12, #f1c40f, #c27c0e);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

.achievement-toast.legendary .toast-progress {
    background: linear-gradient(90deg, #c27c0e, #f1c40f, #f39c12);
}

.achievement-toast.legendary::before {
    background: linear-gradient(90deg, transparent, rgba(243, 156, 18, 0.15), transparent);
}

@keyframes at-badgePulseLegendary {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(243, 156, 18, 0), 0 4px 30px rgba(243, 156, 18, 0.5);
    }
}


/* ============= ULTRA RARE ============= */
.achievement-toast.ultra {
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 10px 50px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(212, 175, 55, 0.25);
    animation: at-slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards, at-ultraGlow 2s ease-in-out infinite;
}

.achievement-toast.ultra::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(145deg, #d4af37, #a67c00, #f4e4a6, #d4af37);
    background-size: 300% 300%;
    animation: at-ultraBorder 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes at-ultraBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes at-ultraGlow {
    0%, 100% { box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6), 0 0 60px rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6), 0 0 100px rgba(212, 175, 55, 0.4); }
}

.achievement-toast.ultra .toast-badge {
    border: 2px solid rgba(212, 175, 55, 0.8);
    animation-name: at-badgePulseUltra;
}

.achievement-toast.ultra .toast-badge::before {
    background: conic-gradient(from 0deg, rgba(212, 175, 55, 0.8), rgba(244, 228, 166, 0.6), rgba(212, 175, 55, 0.8), transparent, transparent);
    animation: at-rotate 2s linear infinite;
}

.achievement-toast.ultra .toast-badge svg {
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.7));
}

.achievement-toast.ultra .toast-label {
    background: linear-gradient(90deg, #a67c00, #f4e4a6, #d4af37, #f4e4a6, #a67c00);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 11px;
    letter-spacing: 3px;
}

.achievement-toast.ultra .toast-progress {
    height: 4px;
    background: linear-gradient(90deg, #a67c00, #f4e4a6, #d4af37, #f4e4a6);
}

.achievement-toast.ultra::before {
    background: linear-gradient(90deg, transparent, rgba(244, 228, 166, 0.15), transparent);
}

@keyframes at-badgePulseUltra {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6), 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0), 0 4px 40px rgba(212, 175, 55, 0.6);
    }
}


/* ============= RESPONSIVE ============= */
@media (max-width: 400px) {
    #achievement-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .achievement-toast {
        width: 100%;
        padding: 12px;
        gap: 12px;
    }

    .achievement-toast .toast-badge {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .achievement-toast .toast-badge svg {
        width: 28px;
        height: 28px;
    }

    .achievement-toast .toast-title {
        font-size: 14px;
    }

    .achievement-toast .toast-description {
        font-size: 11px;
    }
}
