/* =========================================================================
   Gamification — Delivery Confirmation Loyalty & Content
   Extends app.css Key Visual. Requires Signika Negative font.
   ========================================================================= */

:root {
    --kv-gold: #D4A843;
    --kv-silver: #A8A8A8;
    --kv-bronze: #CD7F32;
    --kv-streak: #FF6B35;
    --kv-green: #27AE60;
}

/* === Loyalty Teaser (checklist page) === */
.dc-loyalty-teaser {
    background: var(--kv-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(107, 27, 30, 0.06);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dc-loyalty-teaser .dc-streak-badge {
    flex-shrink: 0;
}
.dc-loyalty-teaser .dc-loyalty-info {
    flex: 1;
    min-width: 0;
}
.dc-loyalty-info .dc-progress-label {
    font-size: 0.8rem;
    color: var(--kv-text-light);
    margin-bottom: 0.25rem;
    font-weight: 400;
}

/* === Streak Display === */
.dc-streak-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--kv-bg);
    border: 2px solid var(--kv-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.dc-streak-badge--hot {
    border-color: var(--kv-streak);
    animation: streak-glow 1.5s ease-in-out infinite alternate;
}
.dc-streak-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--kv-burgundy);
    line-height: 1;
}
.dc-streak-badge--hot .dc-streak-number {
    color: var(--kv-streak);
}
.dc-streak-label {
    font-size: 0.5rem;
    color: var(--kv-text-light);
    font-weight: 400;
    line-height: 1.1;
    margin-top: 1px;
}

@keyframes streak-glow {
    from { box-shadow: 0 0 4px rgba(255, 107, 53, 0.3); }
    to   { box-shadow: 0 0 12px rgba(255, 107, 53, 0.6); }
}

/* === Progress Bar (gamification variant: 6px, rounded) === */
.dc-loyalty-teaser .dc-progress {
    height: 6px;
    border-radius: 3px;
}
.dc-loyalty-teaser .dc-progress-bar {
    border-radius: 3px;
    background: var(--kv-burgundy);
}

/* === Badge Grid === */
.dc-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    padding: 0.5rem 0;
}
.dc-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.dc-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--kv-bg);
    border: 2px solid var(--kv-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.dc-badge--earned .dc-badge-icon {
    border-color: var(--kv-burgundy);
    background: var(--kv-white);
}
.dc-badge--locked .dc-badge-icon {
    opacity: 0.35;
    filter: grayscale(1);
}
.dc-badge-name {
    font-size: 0.65rem;
    color: var(--kv-text-light);
    font-weight: 400;
    text-align: center;
    max-width: 56px;
    line-height: 1.2;
}

/* Badge icons — PNG images */
.dc-badge-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* === New Badge Pulse === */
.dc-badge--new .dc-badge-icon {
    border-color: var(--kv-gold);
    animation: badge-pulse 1.2s ease-in-out 3;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(212, 168, 67, 0); }
}

/* === Team Photo in thank-you card === */
.dc-team-photo {
    margin: 0.6rem 0 0.8rem;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
.dc-team-photo img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* === Content Card (quiz / MOTD / joke) === */
.dc-content-card {
    background: var(--kv-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(107, 27, 30, 0.06);
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.dc-content-card h5 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kv-burgundy);
}
.dc-content-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 0.8rem;
}

/* === Quiz Options === */
.dc-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.dc-quiz-opt {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--kv-border);
    border-radius: 0;
    background: var(--kv-white);
    font-family: 'Signika Negative', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--kv-text);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}
.dc-quiz-opt + .dc-quiz-opt {
    border-top: none;
}
.dc-quiz-opt:first-child {
    border-radius: 6px 6px 0 0;
}
.dc-quiz-opt:last-child {
    border-radius: 0 0 6px 6px;
}
.dc-quiz-opt:hover {
    border-color: var(--kv-burgundy) !important;
    background: var(--kv-info-bg) !important;
    color: var(--kv-burgundy);
}
.dc-quiz-opt.correct {
    background: var(--kv-success-bg) !important;
    border-color: var(--kv-green) !important;
    color: #1B5E20 !important;
    opacity: 1;
    font-weight: 600;
}
.dc-quiz-opt.incorrect {
    background: var(--kv-error-bg) !important;
    border-color: var(--kv-red) !important;
    color: var(--kv-red) !important;
    opacity: 1;
}
.dc-quiz-opt.disabled {
    pointer-events: none;
    opacity: 0.6;
    cursor: default;
}
.dc-quiz-opt.disabled.correct,
.dc-quiz-opt.disabled.incorrect {
    opacity: 1;
}
.dc-quiz-opt.disabled:hover {
    border-color: var(--kv-border) !important;
    background: var(--kv-white) !important;
    color: var(--kv-text);
}

/* === Quiz Result === */
.dc-quiz-result {
    margin-top: 0.6rem;
    padding: 0.7rem;
    background: var(--kv-info-bg);
    border-left: 3px solid var(--kv-burgundy);
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: var(--kv-text);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s, transform 0.3s;
}
.dc-quiz-result.visible {
    opacity: 1;
    transform: translateY(0);
}
.dc-quiz-result.dc-quiz-correct {
    background: var(--kv-success-bg);
    border-left-color: var(--kv-green);
    color: #1B5E20;
}
.dc-quiz-result.dc-quiz-incorrect {
    background: var(--kv-error-bg);
    border-left-color: var(--kv-red);
    color: var(--kv-red);
}

/* === Checkmark Animation === */
.dc-checkmark-anim {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 0.6rem;
}
.dc-checkmark-anim .circle {
    stroke: var(--kv-green);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
}
.dc-checkmark-anim .check {
    stroke: var(--kv-green);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}
.dc-checkmark-anim.animate .circle {
    animation: checkmark-circle 0.5s ease-in-out forwards;
}
.dc-checkmark-anim.animate .check {
    animation: checkmark-draw 0.35s 0.4s ease-in-out forwards;
}
@keyframes checkmark-circle {
    to { stroke-dashoffset: 0; }
}
@keyframes checkmark-draw {
    to { stroke-dashoffset: 0; }
}

/* === Confetti Canvas === */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* === Collective Goal === */
.dc-collective-goal {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--kv-border);
}
.dc-collective-label {
    font-size: 0.8rem;
    color: var(--kv-text-light);
    display: block;
    margin-bottom: 0.25rem;
}
.dc-collective-goal-card {
    text-align: center;
}
.dc-collective-goal-card h5 {
    margin-bottom: 0.4rem;
}
.dc-progress--large {
    height: 12px;
}
.dc-progress-bar--collective {
    background: linear-gradient(90deg, var(--kv-burgundy), var(--kv-red));
}
.dc-progress-bar--reached {
    background: linear-gradient(90deg, var(--kv-green), #2ECC71) !important;
}
.dc-collective-congrats {
    color: var(--kv-green);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.dc-collective-encourage {
    color: var(--kv-text-light);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* === Seasonal Event Banner === */
.dc-event-banner {
    background: linear-gradient(135deg, #6B1B1E 0%, #A62B31 100%);
    color: #fff;
    text-align: center;
    border-radius: 8px;
}
.dc-event-banner h5 {
    color: #fff;
    margin-bottom: 0.3rem;
}
.dc-event-label {
    display: inline-block;
    background: var(--kv-gold);
    color: #2A2A2A;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}
.dc-event-perks {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.dc-event-perk {
    background: rgba(255,255,255,0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* === Monthly Challenge === */
.dc-challenge-card {
    text-align: center;
}
.dc-challenge-card h5 {
    margin-bottom: 0.4rem;
}
.dc-progress-bar--challenge {
    background: linear-gradient(90deg, var(--kv-gold), #E6C358);
}

/* === Mobile === */
@media (max-width: 640px) {
    .dc-loyalty-teaser { padding: 0.8rem 1rem; }
    .dc-streak-badge { width: 48px; height: 48px; }
    .dc-streak-number { font-size: 1.1rem; }
    .dc-badge-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .dc-content-card { padding: 1rem; }
}
