/* ═══════════════════════════════════════════════
   MODULE: Inbox — Styles + Gamification
   ═══════════════════════════════════════════════ */

/* ─── LAYOUT ─── */
.inbox-main { height: 100%; display: flex; overflow: hidden; }
.inbox-mail-panel { width: 55%; display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow: hidden; }
.inbox-detail-panel { width: 45%; background: var(--bg-detail); display: flex; flex-direction: column; overflow-y: auto; padding: 12px 16px; }

/* ─── MASCOT ─── */
.inbox-mascot {
    background: var(--bg-mascot); padding: 6px 12px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    position: relative; overflow: visible;
}
.inbox-mascot-sprite {
    font-size: 28px; transition: transform 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(0,210,255,0.3));
}
.inbox-mascot-sprite.bounce { animation: mascotBounce 0.5s ease; }
.inbox-mascot-sprite.level-up {
    animation: levelUpPulse 1.5s ease;
}
@keyframes mascotBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes levelUpPulse {
    0%   { transform: scale(1); filter: drop-shadow(0 0 6px rgba(0,210,255,0.3)); }
    15%  { transform: scale(1.8) rotate(-10deg); filter: drop-shadow(0 0 20px rgba(255,215,0,0.9)); }
    30%  { transform: scale(1.5) rotate(10deg); filter: drop-shadow(0 0 30px rgba(255,215,0,1)); }
    50%  { transform: scale(2.0) rotate(0deg); filter: drop-shadow(0 0 40px rgba(255,215,0,0.8)); }
    70%  { transform: scale(1.3) rotate(-5deg); filter: drop-shadow(0 0 20px rgba(255,215,0,0.5)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(0,210,255,0.3)); }
}
.inbox-mascot-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.inbox-mascot-name-row { display: flex; align-items: center; gap: 6px; }
.inbox-mascot-name { color: var(--col-yellow); font-weight: 700; font-size: 11px; }
.inbox-mascot-level { font-size: 9px; font-weight: 600; letter-spacing: 0.3px; }
.inbox-mascot-mood { font-size: 9px; }

/* ─── PROGRESS BAR (mini, no XP label) ─── */
.inbox-mascot-progress { display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.inbox-progress-track {
    flex: 1; height: 4px; background: rgba(255,255,255,0.08);
    border-radius: 2px; overflow: hidden; max-width: 100px;
}
.inbox-progress-fill {
    height: 100%; border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
    box-shadow: 0 0 6px currentColor;
}
.inbox-progress-text { font-size: 8px; color: var(--col-dark-gray); font-weight: 600; }

/* ─── MASCOT RIGHT ─── */
.inbox-mascot-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.inbox-mascot-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.inbox-stat-unread { color: var(--col-cyan); font-size: 10px; font-weight: 700; }
.inbox-stat-total { color: var(--col-dark-gray); font-size: 9px; }

/* ─── ACHIEVEMENTS RIBBON ─── */
.inbox-mascot-achievements {
    display: flex; gap: 2px; font-size: 10px;
    filter: drop-shadow(0 0 3px rgba(255,215,0,0.4));
}
.inbox-achievement-icon {
    cursor: default; transition: transform 0.2s;
}
.inbox-achievement-icon:hover { transform: scale(1.4); }
.inbox-no-achievements { color: var(--col-dark-gray); font-size: 8px; }

/* ─── PIPOU SPEECH BUBBLE ─── */
.pipou-bubble {
    position: absolute; top: -28px; left: 10px;
    background: rgba(0,210,255,0.15); border: 1px solid rgba(0,210,255,0.4);
    color: var(--col-cyan); font-size: 10px; font-weight: 700;
    padding: 4px 10px; border-radius: 10px;
    white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translateY(8px) scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
    box-shadow: 0 0 15px rgba(0,210,255,0.2);
}
.pipou-bubble::after {
    content: ''; position: absolute; bottom: -5px; left: 18px;
    width: 8px; height: 8px;
    background: rgba(0,210,255,0.15); border-right: 1px solid rgba(0,210,255,0.4);
    border-bottom: 1px solid rgba(0,210,255,0.4);
    transform: rotate(45deg);
}
.pipou-bubble.show {
    opacity: 1; transform: translateY(0) scale(1);
}

/* ─── ACHIEVEMENT TOAST ─── */
.pipou-achievement-toast {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    background: linear-gradient(135deg, rgba(20,20,40,0.98) 0%, rgba(30,30,60,0.95) 100%);
    border: 1px solid rgba(255,215,0,0.4);
    border-radius: 12px; padding: 12px 18px;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(255,215,0,0.15), 0 0 60px rgba(255,215,0,0.08);
    opacity: 0; transform: translateX(100px);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.pipou-achievement-toast.show {
    opacity: 1; transform: translateX(0);
}
.pipou-toast-header { font-size: 11px; color: var(--col-yellow); margin-bottom: 4px; }
.pipou-toast-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.pipou-toast-desc { font-size: 10px; color: var(--col-gray); }

/* ─── MAIL LIST ─── */
.inbox-mail-list { flex: 1; overflow-y: auto; padding: 6px; }
.inbox-loading { text-align: center; color: var(--col-gray); font-size: 11px; padding: 30px; }

.inbox-mail-item {
    background: var(--bg-mail-item); padding: 8px 10px; margin-bottom: 4px;
    border-radius: 6px; cursor: pointer; border: 1px solid transparent;
    transition: all 0.15s ease; animation: fadeIn 0.2s ease forwards;
}
.inbox-mail-item:hover { background: var(--bg-hover); }
.inbox-mail-item.selected { background: var(--bg-selected); border-color: var(--col-cyan); box-shadow: 0 0 12px rgba(0,210,255,0.15); }
.inbox-mail-item.unread { border-left: 3px solid var(--col-cyan); }
.inbox-mail-item.read-item { opacity: 0.7; }
.inbox-mail-item.deleting {
    animation: slideOutLeft 0.3s ease forwards;
    pointer-events: none;
}
@keyframes slideOutLeft {
    to { transform: translateX(-100%); opacity: 0; height: 0; padding: 0; margin: 0; overflow: hidden; }
}

.inbox-mail-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.inbox-mail-sender { color: var(--col-white); font-size: 11px; font-weight: 600; }
.inbox-mail-time { color: var(--col-dark-gray); font-size: 9px; }
.inbox-mail-tag { font-size: 8px; padding: 2px 6px; border-radius: 3px; color: white; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.inbox-mail-tag.important { background: var(--tag-urgent); }
.inbox-mail-tag.normal { background: var(--tag-info); }
.inbox-mail-tag.read { background: var(--col-dark-gray); }
.inbox-mail-subject { color: var(--col-white); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.inbox-mail-preview { color: var(--col-gray); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── DETAIL ─── */
.inbox-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--col-dark-gray); }
.inbox-detail-empty-icon { font-size: 50px; margin-bottom: 10px; opacity: 0.4; filter: drop-shadow(0 0 15px rgba(0,210,255,0.2)); }
.inbox-detail-empty-text { font-size: 12px; opacity: 0.5; }
.inbox-detail-content { display: flex; flex-direction: column; gap: 10px; }
.inbox-detail-header { display: flex; justify-content: space-between; align-items: center; }
.inbox-detail-sender { color: var(--col-cyan); font-size: 14px; font-weight: 700; }
.inbox-detail-tag { font-size: 9px; padding: 3px 8px; border-radius: 4px; color: white; font-weight: 700; }
.inbox-detail-subject { color: var(--col-white); font-size: 13px; font-weight: 600; line-height: 1.3; }
.inbox-detail-date { color: var(--col-dark-gray); font-size: 9px; }

.inbox-ia-summary { background: rgba(0,210,255,0.08); border: 1px solid rgba(0,210,255,0.2); border-radius: 8px; padding: 10px 12px; }
.inbox-ia-summary-label { color: var(--col-cyan); font-size: 10px; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.inbox-ia-summary-text { color: var(--col-white); font-size: 11px; line-height: 1.5; opacity: 0.9; }

.inbox-suggestion-box { background: rgba(255,211,42,0.08); border: 1px solid rgba(255,211,42,0.2); padding: 10px 12px; border-radius: 8px; }
.inbox-suggestion-label { color: var(--col-yellow); font-size: 10px; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.inbox-suggestion-text { color: var(--col-white); font-size: 11px; line-height: 1.4; }

/* ─── ACTION BAR ─── */
.inbox-action-bar { display: flex; gap: 8px; padding: 8px 0; }
.inbox-btn-delete {
    background: rgba(232,65,24,0.12); border: 1px solid rgba(232,65,24,0.3);
    color: var(--col-red); padding: 7px 14px; border-radius: 6px;
    cursor: pointer; font-size: 10px; font-weight: 700;
    font-family: 'Montserrat', sans-serif; transition: all 0.2s;
    display: flex; align-items: center; gap: 5px;
}
.inbox-btn-delete:hover { background: rgba(232,65,24,0.25); }
.inbox-btn-delete:active { transform: scale(0.96); }
.inbox-btn-reply {
    background: rgba(0,210,255,0.12); border: 1px solid rgba(0,210,255,0.3);
    color: var(--col-cyan); padding: 7px 14px; border-radius: 6px;
    cursor: pointer; font-size: 10px; font-weight: 700;
    font-family: 'Montserrat', sans-serif; transition: all 0.2s;
    display: flex; align-items: center; gap: 5px; flex: 1; justify-content: center;
}
.inbox-btn-reply:hover { background: rgba(0,210,255,0.22); }
.inbox-btn-reply:active { transform: scale(0.96); }
.inbox-btn-reply:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── REPLY OPTIONS ─── */
.inbox-reply-options { display: flex; flex-direction: column; gap: 8px; animation: fadeIn 0.3s ease; }
.inbox-reply-options-title {
    color: var(--col-cyan); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 6px;
}
.inbox-reply-card {
    background: var(--bg-mail-item); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 12px; transition: all 0.2s; cursor: default;
}
.inbox-reply-card:hover { border-color: rgba(0,210,255,0.3); }
.inbox-reply-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.inbox-reply-tone {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 2px 8px; border-radius: 4px;
}
.inbox-reply-tone.formal { background: rgba(108,99,255,0.2); color: #a5a0ff; }
.inbox-reply-tone.friendly { background: rgba(76,209,55,0.15); color: var(--col-green); }
.inbox-reply-tone.concise { background: rgba(255,211,42,0.15); color: var(--col-yellow); }
.inbox-reply-body {
    color: var(--col-gray); font-size: 10px; line-height: 1.5;
    white-space: pre-wrap; max-height: 60px; overflow-y: auto; margin-bottom: 6px;
}
.inbox-btn-draft {
    background: rgba(76,209,55,0.12); border: 1px solid rgba(76,209,55,0.3);
    color: var(--col-green); padding: 5px 12px; border-radius: 5px;
    cursor: pointer; font-size: 9px; font-weight: 700;
    font-family: 'Montserrat', sans-serif; transition: all 0.2s;
    display: flex; align-items: center; gap: 4px;
}
.inbox-btn-draft:hover { background: rgba(76,209,55,0.25); }
.inbox-btn-draft:active { transform: scale(0.96); }
.inbox-btn-draft:disabled { opacity: 0.5; cursor: not-allowed; }
.inbox-btn-draft.saved { background: rgba(76,209,55,0.3); border-color: var(--col-green); cursor: default; }

/* ─── SPINNER ─── */
.inbox-spinner {
    display: flex; align-items: center; justify-content: center;
    padding: 20px; color: var(--col-cyan); font-size: 11px; gap: 8px;
}
.inbox-spinner-dot {
    width: 6px; height: 6px; background: var(--col-cyan);
    border-radius: 50%; animation: pulse 1s infinite;
}

/* ─── TOGGLE BODY ─── */
.inbox-btn-toggle-body {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--col-gray); padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 10px; font-weight: 600;
    font-family: 'Montserrat', sans-serif; text-align: left; transition: all 0.2s;
}
.inbox-btn-toggle-body:hover { background: rgba(255,255,255,0.1); }
.inbox-detail-body {
    color: var(--col-gray); font-size: 10px; line-height: 1.5;
    white-space: pre-wrap; max-height: 200px; overflow-y: auto;
    padding: 10px; background: rgba(0,0,0,0.2); border-radius: 6px; border: 1px solid var(--border);
}

/* ─── INBOX FILTERS ─── */
.inbox-filters { display: flex; gap: 6px; }
