:root {
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --gradient-level: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-streak: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-achievement: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-card: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.hidden {
    display: none !important;
}

/* Achievement Toast Notifications */
.achievement-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: 1rem;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transform: translateY(150%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    max-width: 400px;
    border: 2px solid var(--accent-primary);
}

[data-bs-theme="dark"] .achievement-toast {
    background: var(--bs-card-bg);
}

.achievement-toast.show {
    transform: translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    gap: 1rem;
}

.toast-icon {
    font-size: 2.5rem;
    background: var(--gradient-level);
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.toast-details {
    flex: 1;
}

.toast-title {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.toast-name {
    margin: 0.3rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bs-body-color);
    line-height: 1.3;
}

.toast-points {
    margin: 0.3rem 0 0;
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 700;
}

.toast-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
}

[data-bs-theme="dark"] .toast-progress {
    background: rgba(255, 255, 255, 0.1);
}

.toast-progress-bar {
    height: 100%;
    background: var(--gradient-level);
    width: 0%;
    transition: width linear;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* Reduced motion for toast */
@media (prefers-reduced-motion: reduce) {
    .achievement-toast {
        transition: opacity 0.3s ease;
        transform: none !important;
        opacity: 0;
        bottom: 2rem;
    }

    .achievement-toast.show {
        opacity: 1;
    }

    .toast-icon {
        animation: none;
    }

    .toast-progress-bar {
        transition: none;
    }
}

body.reduced-motion .achievement-toast {
    transition: opacity 0.3s ease;
    transform: none !important;
    opacity: 0;
}

body.reduced-motion .achievement-toast.show {
    opacity: 1;
}

body.reduced-motion .toast-icon {
    animation: none;
}

body.reduced-motion .toast-progress-bar {
    transition: none;
}

/* Toast mobile responsiveness */
@media (max-width: 768px) {
    .achievement-toast {
        left: 1rem;
        right: 1rem;
        min-width: unset;
        bottom: 1rem;
    }

    .toast-content {
        padding: 1rem;
    }

    .toast-icon {
        width: 55px;
        height: 55px;
        font-size: 2rem;
    }
}

/* Achievement Modal Notifications */
.achievement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.achievement-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.achievement-modal .modal-content {
    position: relative;
    z-index: 2001;
    background: white;
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.7);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

[data-bs-theme="dark"] .achievement-modal .modal-content {
    background: var(--bs-card-bg);
}

.achievement-modal.show .modal-content {
    transform: scale(1);
}

.confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2002;
}

#achievement-modal .modal-body {
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

#achievement-modal .modal-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

#achievement-modal .modal-icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

#achievement-modal .modal-icon {
    font-size: 5rem;
    display: block;
    position: relative;
    animation: modalIconBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#achievement-modal .modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-level);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: slideDown 0.6s ease-out 0.2s both;
}

#achievement-modal .modal-achievement-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
    animation: slideDown 0.6s ease-out 0.3s both;
}

#achievement-modal .modal-description {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
    animation: slideDown 0.6s ease-out 0.4s both;
}

#achievement-modal .modal-points {
    background: var(--gradient-level);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    animation: slideUp 0.6s ease-out 0.5s both;
}

#achievement-modal .points-label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

#achievement-modal .points-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
}

#achievement-modal .modal-close-x {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2003;
    transition: all 0.3s ease;
    color: var(--bs-body-color);
    font-size: 1.2rem;
}

[data-bs-theme="dark"] #achievement-modal .modal-close-x {
    background: rgba(255, 255, 255, 0.1);
}

#achievement-modal .modal-close-x:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

[data-bs-theme="dark"] #achievement-modal .modal-close-x:hover {
    background: rgba(255, 255, 255, 0.2);
}

#achievement-modal .modal-close-x:active {
    transform: rotate(90deg) scale(0.95);
}


@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

@keyframes modalIconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(0deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced motion for modals */
@media (prefers-reduced-motion: reduce) {

    .achievement-modal,
    .modal-content,
    .modal-icon,
    .modal-title,
    .modal-achievement-name,
    .modal-description,
    .modal-points,
    .modal-close-btn {
        animation: none !important;
        transition: opacity 0.3s ease !important;
    }

    .modal-icon-glow {
        animation: none !important;
    }

    .modal-content {
        transform: none !important;
    }
}

body.reduced-motion .achievement-modal,
body.reduced-motion .modal-content,
body.reduced-motion .modal-icon,
body.reduced-motion .modal-title,
body.reduced-motion .modal-achievement-name,
body.reduced-motion .modal-description,
body.reduced-motion .modal-points,
body.reduced-motion .modal-close-btn {
    animation: none !important;
    transition: opacity 0.3s ease !important;
}

body.reduced-motion .modal-icon-glow {
    animation: none !important;
}

body.reduced-motion .modal-content {
    transform: none !important;
}