/**
 * DJC-Hub Notification Styles
 * Toast, Modals, Animations
 */

/* Toast Container */
#djc-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

/* Toast Styles */
.djc-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transform: translateX(450px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 320px;
    border-left: 4px solid #3b82f6;
}

.djc-toast.djc-toast-show {
    transform: translateX(0);
}

.djc-toast-low {
    border-left-color: #6b7280;
}

.djc-toast-medium {
    border-left-color: #3b82f6;
}

.djc-toast-high {
    border-left-color: #f59e0b;
}

.djc-toast-urgent {
    border-left-color: #ef4444;
    animation: djc-pulse 1s ease-in-out infinite;
}

.djc-toast-icon {
    font-size: 28px;
    line-height: 1;
}

.djc-toast-content {
    flex: 1;
}

.djc-toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.djc-toast-message {
    font-size: 13px;
    color: #6b7280;
}

.djc-toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.djc-toast-close:hover {
    color: #1f2937;
}

/* Modal Base Styles */
.djc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.djc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
}

.djc-modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 10101;
}

.djc-modal-enter {
    animation: djc-modal-enter 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.djc-modal-exit {
    animation: djc-modal-exit 0.3s ease-out;
}

@keyframes djc-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes djc-modal-exit {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.djc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.djc-modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #1f2937;
    transform: rotate(90deg);
}

/* Achievement Modal */
.djc-achievement-content .djc-achievement-header {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    padding: 24px;
    text-align: center;
    border-radius: 24px 24px 0 0;
}

.djc-achievement-content .djc-achievement-header h2 {
    color: white;
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.djc-achievement-content .djc-achievement-body {
    padding: 32px 24px;
    text-align: center;
}

.djc-achievement-content .djc-achievement-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
    animation: djc-bounce 0.6s ease-in-out;
}

.djc-achievement-content .djc-achievement-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.djc-achievement-content .djc-achievement-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.djc-achievement-content .djc-achievement-description {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.djc-achievement-content .djc-achievement-rewards {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.djc-achievement-content .djc-achievement-footer {
    padding: 20px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Level-Up Modal */
.djc-levelup-content .djc-levelup-header {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    padding: 24px;
    text-align: center;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.djc-levelup-content .djc-levelup-header h2 {
    color: white;
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: djc-glow 2s ease-in-out infinite;
}

.djc-levelup-content .djc-levelup-body {
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(251, 191, 36, 0.1) 0%, transparent 100%);
}

.djc-levelup-content .djc-level-badge-animated {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
    animation: djc-level-pulse 2s ease-in-out infinite;
    position: relative;
}

.djc-levelup-content .djc-level-badge-animated::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    border-radius: 50%;
    z-index: -1;
    animation: djc-rotate 3s linear infinite;
}

.djc-levelup-content .djc-level-number {
    font-size: 56px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.djc-levelup-content .djc-level-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.djc-levelup-content .djc-levelup-rewards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.djc-levelup-content .djc-levelup-footer {
    padding: 20px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Quest Modal */
.djc-quest-content .djc-quest-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 24px;
    text-align: center;
    border-radius: 24px 24px 0 0;
}

.djc-quest-content .djc-quest-header h2 {
    color: white;
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.djc-quest-content .djc-quest-body {
    padding: 32px 24px;
    text-align: center;
}

.djc-quest-content .djc-quest-icon {
    font-size: 80px;
    margin-bottom: 16px;
    animation: djc-bounce 0.6s ease-in-out;
}

.djc-quest-content .djc-quest-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.djc-quest-content .djc-quest-description {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.djc-quest-content .djc-quest-rewards {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.djc-quest-content .djc-quest-footer {
    padding: 20px 24px 24px;
    text-align: center;
}

/* Reward Badges */
.djc-reward-xp,
.djc-reward-coins,
.djc-reward-title {
    display: inline-block;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.djc-reward-coins {
    color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
    border-color: rgba(245, 158, 11, 0.3);
}

.djc-reward-title {
    color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
}

/* Confetti Animation */
.djc-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    animation: djc-confetti-fall 3s linear forwards;
    z-index: 1000;
}

@keyframes djc-confetti-fall {
    0% {
        top: -10px;
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(100px) rotate(720deg);
    }
}

/* Animations */
@keyframes djc-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

@keyframes djc-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes djc-level-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 48px rgba(59, 130, 246, 0.6);
    }
}

@keyframes djc-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes djc-glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255,255,255,0.5);
    }
    50% {
        text-shadow: 0 0 40px rgba(255,255,255,0.8);
    }
}

/* Fireworks Effect */
.djc-fireworks-active::before {
    content: '✨';
    position: absolute;
    font-size: 48px;
    animation: djc-firework-1 2s ease-out;
    top: 50%;
    left: 50%;
}

.djc-fireworks-active::after {
    content: '🎆';
    position: absolute;
    font-size: 48px;
    animation: djc-firework-2 2s ease-out 0.3s;
    top: 50%;
    left: 50%;
}

@keyframes djc-firework-1 {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-150%, -150%) scale(2);
        opacity: 0;
    }
}

@keyframes djc-firework-2 {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(100%, -100%) scale(2);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 640px) {
    #djc-toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .djc-toast {
        min-width: auto;
    }

    .djc-modal-content {
        width: 95%;
        margin: 20px;
    }

    .djc-achievement-content .djc-achievement-header h2,
    .djc-levelup-content .djc-levelup-header h2,
    .djc-quest-content .djc-quest-header h2 {
        font-size: 18px;
    }

    .djc-levelup-content .djc-level-badge-animated {
        width: 100px;
        height: 100px;
    }

    .djc-levelup-content .djc-level-number {
        font-size: 42px;
    }
}

/* Modal Buttons */
.djc-modal .djc-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.djc-modal .djc-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.djc-modal .djc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.djc-modal .djc-btn-outline {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.djc-modal .djc-btn-outline:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Achievement icon fallback */
.djc-achievement-icon-fallback {
    width: 120px;
    height: 120px;
    margin: 0 auto;
}
