/* DGC Onboarding Gamification & Animation Styles
 * Adds playful, animated guidance for new user profile completion
 * ================================================================ */

:root {
    --dgc-gamify-primary: #ff5c8d;
    --dgc-gamify-secondary: #66e3ff;
    --dgc-gamify-success: #22c55e;
    --dgc-gamify-gold: #ffd36a;
    --dgc-gamify-purple: #b45aff;
    --dgc-gamify-transition: 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
    --dgc-gamify-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   PROGRESS & ACHIEVEMENTS
   ======================================== */

.dgc-onboarding-achievements {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 12px 0 16px;
    flex-wrap: wrap;
}

.dgc-achievement-badge {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--dgc-gamify-transition);
    opacity: 0.4;
    transform: scale(0.9);
}

.dgc-achievement-badge.is-unlocked {
    opacity: 1;
    transform: scale(1);
    background: linear-gradient(135deg, rgba(255, 92, 141, 0.25), rgba(180, 90, 255, 0.20));
    border-color: var(--dgc-gamify-gold);
    box-shadow: 
        0 0 20px rgba(255, 211, 106, 0.4),
        0 4px 10px rgba(0, 0, 0, 0.3);
    animation: dgcBadgeUnlock 600ms var(--dgc-gamify-bounce);
}

@keyframes dgcBadgeUnlock {
    0% {
        transform: scale(0.3) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.dgc-achievement-badge.is-unlocked::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 211, 106, 0.6) 0%, transparent 70%);
    animation: dgcBadgePulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes dgcBadgePulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.2; }
}

.dgc-achievement-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(10, 12, 20, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 200ms ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

.dgc-achievement-badge:hover .dgc-achievement-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dgc-achievement-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(10, 12, 20, 0.95);
}

/* Points Counter */
.dgc-onboarding-points {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 211, 106, 0.20), rgba(255, 179, 0, 0.15));
    border: 1.5px solid rgba(255, 211, 106, 0.35);
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(255, 211, 106, 0.25);
}

.dgc-onboarding-points-value {
    font-size: 18px;
    color: var(--dgc-gamify-gold);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 200ms var(--dgc-gamify-bounce);
}

.dgc-onboarding-points.is-updating .dgc-onboarding-points-value {
    animation: dgcPointsBounce 500ms var(--dgc-gamify-bounce);
}

@keyframes dgcPointsBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.5) translateY(-3px); }
    50% { transform: scale(1.3); }
}

/* ========================================
   STEP ANIMATIONS & TRANSITIONS
   ======================================== */

.dgc-onboarding-step {
    animation: dgcStepFadeIn 400ms ease-out;
}

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

.dgc-onboarding-step.is-exiting {
    animation: dgcStepFadeOut 300ms ease-in forwards;
}

@keyframes dgcStepFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Field Focus Highlight */
.dgc-onboarding-form-group {
    position: relative;
    margin-bottom: 20px;
    transition: all 300ms ease;
}

.dgc-onboarding-form-group.is-focused {
    transform: translateY(-2px);
}

.dgc-onboarding-form-group.is-focused::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 92, 141, 0.15), rgba(102, 227, 255, 0.12));
    animation: dgcFieldGlow 2s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes dgcFieldGlow {
    0%, 100% {
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(255, 92, 141, 0.3);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 30px rgba(102, 227, 255, 0.4);
    }
}

.dgc-onboarding-input.is-valid {
    border-color: var(--dgc-gamify-success) !important;
    background: rgba(34, 197, 94, 0.08);
    animation: dgcInputSuccess 500ms ease;
}

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

.dgc-onboarding-input.is-valid::after {
    content: '✓';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dgc-gamify-success);
    font-size: 18px;
    font-weight: bold;
}

/* ========================================
   HELPFUL TIPS & GUIDANCE
   ======================================== */

.dgc-onboarding-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    margin: 12px 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 227, 255, 0.12), rgba(180, 90, 255, 0.08));
    border: 1px solid rgba(102, 227, 255, 0.25);
    animation: dgcTipSlideIn 400ms ease-out;
}

@keyframes dgcTipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dgc-onboarding-tip-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.dgc-onboarding-tip-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(245, 245, 255, 0.9);
}

.dgc-onboarding-tip-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--dgc-gamify-secondary);
}

/* Progress Step Indicators */
.dgc-onboarding-step-indicator {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.dgc-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all var(--dgc-gamify-transition);
}

.dgc-step-dot.is-active {
    width: 32px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--dgc-gamify-primary), var(--dgc-gamify-purple));
    box-shadow: 0 0 12px rgba(255, 92, 141, 0.6);
}

.dgc-step-dot.is-completed {
    background: var(--dgc-gamify-success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* ========================================
   INTERACTIVE PILLS & CHOICES
   ======================================== */

.dgc-onboarding-pill {
    position: relative;
    overflow: hidden;
}

.dgc-onboarding-pill::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 92, 141, 0.3);
    transform: translate(-50%, -50%);
    transition: width 400ms ease, height 400ms ease;
}

.dgc-onboarding-pill:active::before {
    width: 300px;
    height: 300px;
}

.dgc-onboarding-pill.is-selected {
    animation: dgcPillSelect 400ms var(--dgc-gamify-bounce);
}

@keyframes dgcPillSelect {
    0% { transform: scale(1); }
    40% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Checkbox Animation */
.dgc-onboarding-checkbox {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: all 250ms ease;
    position: relative;
}

.dgc-onboarding-checkbox:hover {
    transform: translateX(4px);
    border-color: rgba(102, 227, 255, 0.35);
    background: rgba(102, 227, 255, 0.05);
}

.dgc-onboarding-checkbox input:checked ~ span {
    color: var(--dgc-gamify-secondary);
    font-weight: 600;
}

.dgc-onboarding-checkbox input:checked {
    accent-color: var(--dgc-gamify-primary);
}

.dgc-onboarding-interests-grid {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.dgc-onboarding-interests-grid .dgc-onboarding-checkbox {
    transition: all 300ms var(--dgc-gamify-bounce);
}

.dgc-onboarding-interests-grid .dgc-onboarding-checkbox:has(input:checked) {
    background: linear-gradient(135deg, rgba(255, 92, 141, 0.15), rgba(180, 90, 255, 0.10));
    border-color: rgba(255, 92, 141, 0.45);
    transform: translateX(6px) scale(1.02);
}

/* ========================================
   CELEBRATION EFFECTS
   ======================================== */

.dgc-confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.dgc-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color, #ff5c8d);
    top: -20px;
    left: var(--x, 50%);
    opacity: 0;
    animation: dgcConfettiFall var(--duration, 3s) var(--delay, 0s) ease-out forwards;
    transform-origin: center;
}

@keyframes dgcConfettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(var(--rotation, 720deg));
    }
}

/* Sparkle Effect */
.dgc-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    animation: dgcSparkle 800ms ease-out forwards;
}

@keyframes dgcSparkle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(var(--dx, 0), var(--dy, 0)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--dx, 0) * 1.5), calc(var(--dy, 0) * 1.5)) scale(0.5);
    }
}

/* ========================================
   COMPLETION CELEBRATION
   ======================================== */

.dgc-onboarding-celebration {
    position: relative;
    text-align: center;
    padding: 24px 0;
}

.dgc-celebration-trophy {
    font-size: 72px;
    display: block;
    margin: 0 auto 16px;
    animation: dgcTrophyBounce 1s var(--dgc-gamify-bounce) infinite;
    filter: drop-shadow(0 10px 20px rgba(255, 211, 106, 0.4));
}

@keyframes dgcTrophyBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-12px) rotate(-5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) rotate(5deg);
    }
}

.dgc-celebration-title {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--dgc-gamify-gold), var(--dgc-gamify-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    animation: dgcTitleShine 2s ease-in-out infinite;
}

@keyframes dgcTitleShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

.dgc-celebration-message {
    font-size: 16px;
    color: rgba(245, 245, 255, 0.85);
    margin-bottom: 20px;
}

.dgc-celebration-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.dgc-celebration-stat {
    padding: 12px 20px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dgc-celebration-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--dgc-gamify-gold);
    display: block;
}

.dgc-celebration-stat-label {
    font-size: 12px;
    color: rgba(245, 245, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   BUTTON ENHANCEMENTS
   ======================================== */

.dgc-onboarding-btn--primary {
    position: relative;
    overflow: hidden;
    font-weight: 700;
    transition: all 250ms ease;
}

.dgc-onboarding-btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 92, 141, 0.35);
}

.dgc-onboarding-btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.dgc-onboarding-btn--primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 500ms ease, height 500ms ease;
}

.dgc-onboarding-btn--primary:active:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

/* Success checkmark animation */
.dgc-success-checkmark {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--dgc-gamify-success);
    margin: 20px auto;
    position: relative;
    animation: dgcCheckmarkPop 500ms var(--dgc-gamify-bounce);
}

@keyframes dgcCheckmarkPop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.dgc-success-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: var(--dgc-gamify-success);
    font-weight: bold;
}

/* ========================================
   PROGRESS PERCENTAGE
   ======================================== */

.dgc-onboarding-progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(245, 245, 255, 0.8);
    letter-spacing: 0.5px;
}

.dgc-onboarding-progress-text .percentage {
    color: var(--dgc-gamify-secondary);
    font-size: 15px;
}

/* Loading spinner for async operations */
.dgc-onboarding-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dgcSpin 600ms linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* Mobile optimizations */
@media (max-width: 640px) {
    .dgc-achievement-badge {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .dgc-celebration-trophy {
        font-size: 56px;
    }
    
    .dgc-onboarding-points {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .dgc-onboarding-points-value {
        font-size: 16px;
    }
}
