/**
 * FlyMacroPilot - Daily Challenge Widget Styles
 * Retention-boosting daily challenge system
 * 
 * © 2026 ScrewCap, LLC
 * Created: March 6, 2026
 */

/* ============================================
   DAILY CHALLENGE WIDGET - HOME SCREEN
   ============================================ */

.daily-challenge-widget {
    background: linear-gradient(135deg, rgba(0, 40, 80, 0.95), rgba(0, 20, 40, 0.98));
    border: 2px solid #00ff88;
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px auto;
    max-width: 420px;
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: widgetSlideIn 0.5s ease-out;
}

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

/* Subtle animated background gradient */
.daily-challenge-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.05) 0%, transparent 60%);
    animation: pulseGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Completed state */
.daily-challenge-widget.completed {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(40, 40, 0, 0.95), rgba(20, 20, 0, 0.98));
}

.daily-challenge-widget.completed::before {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 60%);
}

/* ============================================
   CHALLENGE HEADER
   ============================================ */

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.challenge-status {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.completed .challenge-status {
    color: #ffd700;
}

.challenge-streak {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   CHALLENGE CONTENT
   ============================================ */

.challenge-content {
    position: relative;
    z-index: 1;
}

.challenge-scenario {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.scenario-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
    animation: iconBounce 3s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.scenario-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.challenge-goal {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #e0e0e0;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #00ff88;
}

.completed .challenge-goal {
    border-left-color: #ffd700;
}

.challenge-attempts {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.challenge-result {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: #ffd700;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   PLAY BUTTON
   ============================================ */

.challenge-play-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: #000;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 4px 15px rgba(0, 255, 136, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.challenge-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(0, 255, 136, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #00ff99, #00dd77);
}

.challenge-play-btn:active {
    transform: translateY(0);
}

/* ============================================
   COMPLETED MESSAGE
   ============================================ */

.challenge-complete-msg {
    margin-top: 16px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #aaa;
    text-align: center;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

/* ============================================
   COUNTDOWN TIMER (Optional Enhancement)
   ============================================ */

.challenge-countdown {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

.challenge-countdown span {
    color: #00ff88;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 480px) {
    .daily-challenge-widget {
        margin: 16px 12px;
        padding: 16px 18px;
    }
    
    .challenge-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .challenge-status {
        font-size: 0.8rem;
    }
    
    .scenario-icon {
        font-size: 1.6rem;
    }
    
    .scenario-name {
        font-size: 1rem;
    }
    
    .challenge-goal {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .challenge-play-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   DARK MODE COMPATIBILITY
   ============================================ */

@media (prefers-color-scheme: light) {
    .daily-challenge-widget {
        background: linear-gradient(135deg, rgba(240, 245, 250, 0.98), rgba(220, 230, 240, 0.98));
        border-color: #0088ff;
    }
    
    .scenario-name {
        color: #1a1a2e;
    }
    
    .challenge-goal {
        background: rgba(0, 0, 0, 0.05);
        color: #333;
        border-left-color: #0088ff;
    }
    
    .challenge-status {
        color: #0088ff;
    }
}

/* ============================================
   CELEBRATION ANIMATION (On Completion)
   ============================================ */

.daily-challenge-widget.just-completed {
    animation: celebrationBurst 0.6s ease-out;
}

@keyframes celebrationBurst {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); }
    60% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* Confetti-like particles (CSS only) */
.daily-challenge-widget.completed::after {
    content: '🎉';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    animation: confettiFloat 2s ease-in-out infinite;
}

@keyframes confettiFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(10deg); }
}
