/* ================================================================
   LeanSpace — Motivation V2 CSS
   Quick Idea FAB, My Impact, Social Feed, Micro-Recognition,
   Department Challenge, Streak
   ================================================================ */

/* ── Quick Idea FAB ─────────────────────────────────────────────── */
#quick-idea-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(245,158,11,0.5);
    cursor: pointer;
    font-size: 26px;
    z-index: 9998;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#quick-idea-fab:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 20px rgba(245,158,11,0.7);
}
#quick-idea-fab .qi-tooltip {
    position: absolute;
    left: 64px;
    bottom: 12px;
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
#quick-idea-fab:hover .qi-tooltip { opacity: 1; }

/* ── Quick Idea Modal ───────────────────────────────────────────── */
.qi-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease;
}
.qi-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    padding: 28px 24px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.2s ease;
}
.qi-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.qi-modal-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.qi-modal-title { font-size: 18px; font-weight: 700; color: #111827; }
.qi-modal-subtitle { font-size: 13px; color: #6b7280; margin-top: 2px; }
.qi-close {
    margin-left: auto;
    background: none; border: none;
    color: #9ca3af; font-size: 22px; cursor: pointer;
    padding: 4px; line-height: 1;
}

/* Step indicator */
.qi-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}
.qi-step-dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    transition: background 0.3s;
}
.qi-step-dot.active { background: #f59e0b; }
.qi-step-dot.done { background: #16a34a; }

/* Category selector */
.qi-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.qi-cat-btn {
    padding: 10px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    font-size: 12px;
    color: #374151;
}
.qi-cat-btn .qi-cat-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.qi-cat-btn:hover { border-color: #f59e0b; background: #fffbeb; }
.qi-cat-btn.selected {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    font-weight: 600;
}

.qi-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    resize: none;
}
.qi-input:focus { outline: none; border-color: #f59e0b; }
.qi-input::placeholder { color: #9ca3af; }

/* AI estimate box */
.qi-ai-estimate {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
    display: none;
    animation: fadeIn 0.3s ease;
}
.qi-ai-estimate.visible { display: block; }
.qi-ai-estimate-label { font-size: 12px; color: #065f46; font-weight: 600; margin-bottom: 4px; }
.qi-ai-estimate-value { font-size: 20px; font-weight: 700; color: #059669; }
.qi-ai-estimate-detail { font-size: 12px; color: #6b7280; margin-top: 4px; }

.qi-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}
.qi-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }
.qi-submit-btn:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

/* Success state */
.qi-success {
    text-align: center;
    padding: 20px 0;
    animation: bounceIn 0.4s ease;
}
.qi-success-icon { font-size: 56px; margin-bottom: 12px; display: block; }
.qi-success-title { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.qi-success-effect {
    font-size: 24px;
    font-weight: 700;
    color: #059669;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    padding: 12px 20px;
    border-radius: 12px;
    display: inline-block;
    margin: 8px 0;
}
.qi-success-msg { font-size: 14px; color: #6b7280; margin-top: 8px; }

/* ── My Impact Screen ───────────────────────────────────────────── */
.impact-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    color: white;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.impact-hero::before {
    content: '';
    position: absolute; right: -20px; top: -20px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.impact-hero-msg {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}
.impact-hero-effect {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.impact-hero-sub { font-size: 13px; opacity: 0.8; }

.impact-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.impact-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.impact-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}
.impact-stat-label { font-size: 11px; color: #6b7280; margin-top: 2px; }

.impact-bonus-row {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.impact-bonus-item { text-align: center; }
.impact-bonus-amount { font-size: 18px; font-weight: 700; color: #92400e; }
.impact-bonus-label { font-size: 11px; color: #78350f; }

/* Ideas timeline */
.impact-timeline { margin-bottom: 20px; }
.impact-timeline-title {
    font-size: 15px; font-weight: 600; color: #374151;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.impact-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: flex-start;
}
.impact-timeline-item:last-child { border-bottom: none; }
.impact-timeline-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.impact-timeline-dot.validated { background: #d1fae5; }
.impact-timeline-dot.implemented { background: #dbeafe; }
.impact-timeline-dot.approved { background: #fef3c7; }
.impact-timeline-dot.submitted { background: #f3f4f6; }
.impact-timeline-dot.rejected { background: #fee2e2; }
.impact-timeline-info { flex: 1; min-width: 0; }
.impact-timeline-title-text {
    font-size: 13px; font-weight: 500; color: #111827;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.impact-timeline-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.impact-timeline-bonus {
    font-size: 13px; font-weight: 600; color: #059669;
    white-space: nowrap;
}

/* Belt certificate block */
.impact-belt-card {
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.impact-belt-icon { font-size: 36px; flex-shrink: 0; }
.impact-belt-info { flex: 1; }
.impact-belt-name { font-size: 16px; font-weight: 700; }
.impact-belt-date { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.impact-belt-link {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.25);
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.4);
    white-space: nowrap;
}

/* Recognitions received */
.impact-recog-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin-bottom: 8px;
}
.impact-recog-stars { font-size: 18px; flex-shrink: 0; }
.impact-recog-text { font-size: 13px; color: #374151; }
.impact-recog-from { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ── Social Feed ────────────────────────────────────────────────── */
.social-feed { }
.social-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.social-feed-item:last-child { border-bottom: none; }
.social-feed-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.social-feed-body { flex: 1; min-width: 0; }
.social-feed-msg { font-size: 14px; color: #111827; font-weight: 500; }
.social-feed-detail { font-size: 12px; color: #6b7280; margin-top: 2px; }
.social-feed-ts { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ── Micro-Recognition Panel ────────────────────────────────────── */
.recog-form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}
.recog-stars-selector {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    justify-content: center;
}
.recog-star-btn {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.1s, transform 0.1s;
    padding: 4px;
}
.recog-star-btn.lit { opacity: 1; }
.recog-star-btn:hover { transform: scale(1.2); }
.recog-bonus-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    font-size: 13px;
    color: #374151;
}
.recog-bonus-input {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.recog-send-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white; border: none; border-radius: 10px;
    font-weight: 600; font-size: 14px; cursor: pointer;
    transition: transform 0.15s;
}
.recog-send-btn:hover { transform: translateY(-1px); }

/* ── Department Challenge ───────────────────────────────────────── */
.challenge-card {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: 16px;
    padding: 20px;
    color: white;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.challenge-card::after {
    content: '🏆';
    position: absolute; right: 16px; top: 16px;
    font-size: 40px; opacity: 0.2;
}
.challenge-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.challenge-dates { font-size: 12px; opacity: 0.7; margin-bottom: 14px; }
.challenge-prize {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 14px;
    display: inline-block;
}
.challenge-leaderboard { }
.challenge-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.08);
    transition: background 0.15s;
}
.challenge-lb-row.leader {
    background: rgba(251,191,36,0.25);
    border: 1px solid rgba(251,191,36,0.4);
}
.challenge-lb-rank {
    font-size: 16px; font-weight: 700; width: 28px; text-align: center;
}
.challenge-lb-dept { flex: 1; font-size: 14px; }
.challenge-lb-score { font-size: 14px; font-weight: 600; }
.challenge-lb-bar {
    height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.15);
    margin-top: 4px;
    overflow: hidden;
}
.challenge-lb-bar-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 0.6s ease;
}
.challenge-no-data {
    text-align: center;
    padding: 20px;
    opacity: 0.7;
    font-size: 14px;
}

/* ── Streak Widget ──────────────────────────────────────────────── */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    cursor: pointer;
}
.streak-fire {
    animation: firePulse 1.5s ease-in-out infinite;
}
@keyframes firePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.streak-broken {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}
.streak-broken .streak-fire { animation: none; opacity: 0.5; }

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
    0% { transform: scale(0.7); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Belt Certificate Public Page ───────────────────────────────── */
.cert-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.cert-card {
    background: white;
    border-radius: 24px;
    max-width: 440px;
    width: 100%;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.cert-logo { font-size: 13px; color: #6b7280; margin-bottom: 24px; letter-spacing: 2px; text-transform: uppercase; }
.cert-belt-icon { font-size: 64px; margin-bottom: 12px; display: block; }
.cert-belt-name { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.cert-user-name { font-size: 18px; color: #374151; margin-bottom: 4px; }
.cert-company { font-size: 14px; color: #9ca3af; margin-bottom: 24px; }
.cert-divider { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0; }
.cert-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.cert-stat-item { text-align: center; }
.cert-stat-val { font-size: 24px; font-weight: 700; color: #111827; }
.cert-stat-lbl { font-size: 12px; color: #6b7280; }
.cert-date { font-size: 13px; color: #9ca3af; }
.cert-badge {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .qi-modal { background: #1f2937; color: white; }
    .qi-input { background: #374151; border-color: #4b5563; color: white; }
    .qi-input::placeholder { color: #6b7280; }
    .qi-cat-btn { background: #374151; border-color: #4b5563; color: #d1d5db; }
    .impact-stat-card { background: #1f2937; border-color: #374151; }
    .recog-form-card { background: #1f2937; border-color: #374151; }
}
