/* Challenge Popup Overlay */
.challenge-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.challenge-popup-overlay.show {
    opacity: 1;
}

/* Container */
.challenge-popup-container {
    width: 100%;
    max-width: 450px;
    animation: popup-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popup-bounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Content */
.challenge-popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    color: white;
}

/* Close Button */
.challenge-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.challenge-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Icon */
.challenge-icon-wrapper {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.challenge-icon {
    font-size: 64px;
    display: inline-block;
    animation: icon-float 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.challenge-icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    animation: glow-pulse 2s ease-in-out infinite;
}

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

/* Title */
.challenge-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.challenge-subtitle {
    font-size: 16px;
    margin: 0 0 25px 0;
    text-align: center;
    opacity: 0.95;
}

/* Challenger Info */
.challenger-info {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
}

.challenger-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.challenger-avatar,
.challenger-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.challenger-avatar-placeholder {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.challenger-level-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.challenger-details {
    flex: 1;
}

.challenger-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.challenger-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Topic */
.challenge-topic {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topic-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.topic-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topic-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.topic-text {
    font-size: 16px;
    font-weight: 600;
}

/* Timer */
.challenge-timer {
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Action Buttons */
.challenge-actions {
    display: flex;
    gap: 12px;
}

.challenge-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.challenge-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.challenge-btn-accept {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.challenge-btn-accept:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.6);
}

.challenge-btn-decline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.challenge-btn-decline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Spinner */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

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

/* Toast Notifications */
.challenge-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 600;
    max-width: 300px;
}

.challenge-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.challenge-toast-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.challenge-toast-error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.challenge-toast-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .challenge-popup-content {
        padding: 20px;
    }
    
    .challenge-title {
        font-size: 24px;
    }
    
    .challenge-subtitle {
        font-size: 14px;
    }
    
    .challenger-info {
        padding: 15px;
    }
    
    .challenger-avatar,
    .challenger-avatar-placeholder {
        width: 56px;
        height: 56px;
    }
    
    .challenger-name {
        font-size: 18px;
    }
    
    .challenge-actions {
        flex-direction: column;
    }
    
    .challenge-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}