/**
 * BERKEI Gamification – Frontend Styles
 */

/* ══════════════════════════════════════
 * Progress Bar
 * ══════════════════════════════════════ */

.berkei-progress-bar-wrap {
    margin: 16px 0 24px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.berkei-progress-inner {
    max-width: 100%;
    min-height: 20px;
}

/* Track */
.berkei-progress-track {
    position: relative;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: visible;
    margin: 42px 48px 32px 28px;
}

.berkei-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.berkei-progress-fill--active {
    border-radius: 0 6px 6px 0;
    box-shadow: none;
}

/* Milestones */
.berkei-progress-milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}


.berkei-progress-milestone-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 3px solid #d1d5db;
    border-radius: 50%;
    font-size: 11px;
    color: transparent;
    transition: all 0.4s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.berkei-progress-milestone.reached .berkei-progress-milestone-dot {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.berkei-progress-milestone-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}


.berkei-progress-milestone.reached .berkei-progress-milestone-label {
    color: #22c55e;
}

.berkei-progress-milestone-reward {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 9px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.berkei-progress-milestone.reached .berkei-progress-milestone-reward {
    color: #065f46;
    background: #d1fae5;
    border-color: #6ee7b7;
}


/* Status */
.berkei-progress-status {
    text-align: center;
    font-size: 14px;
    color: #374151;
    margin-top: 4px;
}

.berkei-progress-complete {
    font-size: 16px;
    font-weight: 700;
    color: #22c55e;
}

.berkei-progress-message strong {
    color: #667eea;
    font-size: 15px;
}

.berkei-progress-message em {
    font-style: normal;
    font-weight: 600;
}

/* Suggestion */
.berkei-progress-suggestion {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
}

.berkei-progress-suggestion a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

.berkei-progress-suggestion a:hover {
    color: #78350f;
}

.berkei-progress-suggestion em {
    font-style: normal;
    font-weight: 700;
}

.berkei-progress-suggestion-icon {
    font-size: 16px;
}

.berkei-progress-suggestion-thumb {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 4px;
    object-fit: cover;
}

/* ══════════════════════════════════════
 * Confetti Canvas
 * ══════════════════════════════════════ */

.berkei-confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
}

/* ══════════════════════════════════════
 * Hunt: Hidden eggs
 * ══════════════════════════════════════ */

.berkei-hunt-egg {
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.berkei-hunt-egg img {
    display: block;
    pointer-events: none;
}

.berkei-hunt-egg:not(.found):hover {
    transform: scale(1.2) !important;
    opacity: 1 !important;
}

/* Floating animation for unfound eggs */
@keyframes berkeiHuntFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.berkei-hunt-egg-float {
    animation: berkeiHuntFloat 3s ease-in-out infinite;
}

/* Hunt hint banner */
.berkei-hunt-hint {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
    color: #78350f;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid #fbbf24;
}

.berkei-hunt-hint-icon {
    font-size: 18px;
    vertical-align: middle;
}

.berkei-hunt-hint-count {
    font-weight: 700;
    color: #92400e;
}

/* Hunt message toast */
.berkei-hunt-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.berkei-hunt-message.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.berkei-hunt-message.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    font-size: 16px;
}

.berkei-hunt-message a,
.berkei-hunt-message a:visited {
    color: #93c5fd !important;
    text-decoration: underline;
    pointer-events: auto;
}

.berkei-hunt-message a:hover {
    color: #bfdbfe !important;
}

.berkei-hunt-message.success a,
.berkei-hunt-message.success a:visited {
    color: #ecfccb !important;
}

.berkei-hunt-message.success a:hover {
    color: #fff !important;
}

/* ══════════════════════════════════════
 * Responsive
 * ══════════════════════════════════════ */

@media (max-width: 600px) {
    .berkei-progress-bar-wrap {
        padding: 12px 14px;
    }

    .berkei-progress-milestone-label {
        font-size: 9px;
    }

    .berkei-progress-milestone-dot {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }

    .berkei-progress-suggestion {
        font-size: 12px;
    }
}
