/* ============================================================
   chatbox_condividi.css
   Pannello Condividi & Engagement (#ce-panel)
   Stile coerente con gli altri pannelli chatbox
   ============================================================ */

#ce-panel {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #eee;
    font-size: 0.88em;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
#ce-panel .ce-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 15px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}
#ce-panel .ce-title {
    color: #fff;
    font-weight: bold;
}
#ce-panel .ce-close {
    color: #aaa;
    cursor: pointer;
}
#ce-panel .ce-close:hover { color: #fff; }

/* ── Footer con 4 filtri ── */
#ce-panel .ce-footer {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #333;
    flex-shrink: 0;
}
#ce-panel .ce-filter-btn {
    flex: 1;
    height: 34px;
    background: #2a2a3e;
    border: 1px solid #444;
    border-radius: 6px;
    color: #aaa;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    text-align: center;
    transition: background .2s, color .2s;
}
#ce-panel .ce-filter-btn:hover  { background: #333; color: #fff; }
#ce-panel .ce-filter-btn.active { background: #2B87F2; border-color: #2B87F2; color: #fff; }

/* ── Badge artista nella card ── */
#ce-panel .ce-req-artist {
    background: #2a2a3a;
    border: 1px solid #444;
    color: #8ab4f8;
    font-size: 0.75em;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Selects artista / brano ── */
#ce-panel .ce-selects {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}
#ce-panel .ce-select {
    flex: 1;
    background: #222;
    border: 1px solid #444;
    border-radius: 5px;
    color: #eee;
    font-size: 0.85em;
    padding: 5px 8px;
    cursor: pointer;
    outline: none;
    min-width: 0;
}
#ce-panel .ce-select:focus { border-color: #2B87F2; }
#ce-panel .ce-select option { background: #222; }

/* ── Body scrollabile ── */
#ce-panel .ce-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
#ce-panel .ce-body::-webkit-scrollbar { width: 4px; }
#ce-panel .ce-body::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

/* ── Stato vuoto / loading ── */
#ce-panel .ce-empty {
    color: #555;
    text-align: center;
    padding: 40px 20px;
    font-size: 0.9em;
}

/* ── Sezione generica ── */
#ce-panel .ce-section {
    padding: 12px 15px;
    border-bottom: 1px solid #222;
}
#ce-panel .ce-section-title {
    font-size: 0.72em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

/* ── Sezione CONDIVIDI ── */
#ce-panel .ce-url-box {
    background: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 0.8em;
    color: #2B87F2;
    word-break: break-all;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
}
#ce-panel .ce-url-box:hover { border-color: #2B87F2; }

#ce-panel .ce-share-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
#ce-panel .ce-s-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1e1e1e;
    border: 2px solid #444;
    color: #eee;
    font-size: 0.82em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
#ce-panel .ce-s-btn:hover           { border-color: #2B87F2; color: #fff; }
#ce-panel .ce-s-btn.ce-copy:hover   { border-color: #2B87F2; background: #2B87F2; }
#ce-panel .ce-s-btn.ce-wa:hover     { border-color: #25D366; background: #25D366; }
#ce-panel .ce-s-btn.ce-tg:hover     { border-color: #229ED9; background: #229ED9; }
#ce-panel .ce-s-btn.ce-x:hover      { border-color: #eee;    background: #111; }
#ce-panel .ce-s-btn.ce-fb:hover     { border-color: #1877F2; background: #1877F2; }

/* ── Sezione VOTI ── */
#ce-panel .ce-vote-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
#ce-panel .ce-vote-avg {
    font-size: 1.6em;
    font-weight: bold;
    color: #FFD700;
    line-height: 1;
}
#ce-panel .ce-vote-of5 {
    font-size: 0.78em;
    color: #666;
}
#ce-panel .ce-vote-total {
    font-size: 0.78em;
    color: #888;
    margin-left: auto;
}

#ce-panel .ce-vote-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.75em;
}
#ce-panel .ce-vote-bar-label {
    color: #888;
    width: 18px;
    text-align: right;
    flex-shrink: 0;
}
#ce-panel .ce-vote-bar-track {
    flex: 1;
    height: 6px;
    background: #2a2a2a;
    border-radius: 3px;
    overflow: hidden;
}
#ce-panel .ce-vote-bar-fill {
    height: 100%;
    background: #FFD700;
    border-radius: 3px;
    transition: width 0.3s;
}
#ce-panel .ce-vote-bar-count {
    color: #666;
    width: 20px;
    text-align: left;
    flex-shrink: 0;
}
#ce-panel .ce-vote-zero { color: #333; font-size: 0.82em; padding: 4px 0; }

/* ── Sezione RICHIESTE FAN ── */
#ce-panel .ce-req-card {
    background: #222;
    border-radius: 6px;
    padding: 9px 11px;
    margin-bottom: 6px;
    border-left: 3px solid #444;
}
#ce-panel .ce-req-card.ce-pending  { border-left-color: #e67e22; }
#ce-panel .ce-req-card.ce-done     { border-left-color: #38a852; }
#ce-panel .ce-req-card.ce-failed   { border-left-color: #c0392b; }

#ce-panel .ce-req-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
#ce-panel .ce-req-name {
    font-weight: bold;
    color: #ddd;
    font-size: 0.88em;
}
#ce-panel .ce-req-date {
    font-size: 0.72em;
    color: #555;
}
#ce-panel .ce-req-wa {
    font-size: 0.78em;
    color: #888;
    margin-bottom: 4px;
}
#ce-panel .ce-req-goal {
    font-size: 0.82em;
    color: #aaa;
    line-height: 1.4;
    margin-bottom: 7px;
}
#ce-panel .ce-req-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
#ce-panel .ce-req-btn {
    height: 26px;
    padding: 0 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background: #1e1e1e;
    color: #aaa;
    font-size: 0.78em;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
#ce-panel .ce-req-btn:hover { border-color: #2B87F2; color: #fff; }
#ce-panel .ce-req-btn.ce-wa-btn:hover  { border-color: #25D366; background: #25D366; color: #fff; }
#ce-panel .ce-req-btn.ce-gen-btn       { border-color: #2B87F2; color: #2B87F2; }
#ce-panel .ce-req-btn.ce-gen-btn:hover { background: #2B87F2; color: #fff; }

#ce-panel .ce-req-status {
    font-size: 0.72em;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: bold;
    margin-left: auto;
}
#ce-panel .ce-req-status.pending    { background: #2a1a00; color: #e67e22; }
#ce-panel .ce-req-status.done       { background: #0a2a12; color: #38a852; }
#ce-panel .ce-req-status.processing { background: #0a1a2a; color: #2B87F2; }
#ce-panel .ce-req-status.failed     { background: #2a0a0a; color: #c0392b; }

/* ── Nessuna richiesta ── */
#ce-panel .ce-no-req {
    color: #444;
    font-size: 0.82em;
    text-align: center;
    padding: 10px 0;
}

/* ── Classifica brani ── */
#ce-panel .ce-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
#ce-panel .ce-rank-medal {
    font-size: 1em;
    width: 24px;
    flex-shrink: 0;
    text-align: center;
}
#ce-panel .ce-rank-info {
    flex: 1;
    min-width: 0;
}
#ce-panel .ce-rank-title {
    font-size: 0.82em;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
#ce-panel .ce-rank-bar-track {
    height: 5px;
    background: #2a2a2a;
    border-radius: 3px;
    overflow: hidden;
}
#ce-panel .ce-rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2B87F2, #38a852);
    border-radius: 3px;
    transition: width 0.4s;
}
#ce-panel .ce-rank-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    font-size: 0.72em;
}
#ce-panel .ce-an-avg    { color: #FFD700; }
#ce-panel .ce-an-clicks { color: #666; }
#ce-panel .ce-an-reqs   { color: #2B87F2; }

/* ── Trend chart ── */
#ce-panel .ce-section-title .ce-legend {
    float: right;
    font-size: 0.85em;
    text-transform: none;
    letter-spacing: 0;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}
#ce-panel .ce-leg-v,
#ce-panel .ce-leg-r {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
#ce-panel .ce-leg-v { background: #2B87F2; }
#ce-panel .ce-leg-r { background: #38a852; }

#ce-panel .ce-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding-top: 4px;
    overflow-x: auto;
}
#ce-panel .ce-trend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 32px;
}
#ce-panel .ce-trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
}
#ce-panel .ce-trend-bar {
    width: 8px;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}
#ce-panel .ce-bar-v { background: #2B87F2; }
#ce-panel .ce-bar-r { background: #38a852; }
#ce-panel .ce-trend-label {
    font-size: 0.68em;
    color: #555;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    #ce-panel .ce-selects {
        flex-direction: column;
        gap: 6px;
    }
    #ce-panel .ce-s-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75em;
    }
}
