/* score-historico-modal.css
 * Componente: Score Card com Alternância In-Place (Gauge <-> Barras Históricas)
 * Compatível com tema claro e escuro.
 */

/* ── Card Container ──────────────────────────────────────────────────────── */
.score-gauge-card {
    position: relative;
    cursor: pointer;
    user-select: none;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
}

.score-gauge-card:hover {
    border: none !important;
    box-shadow: none !important;
}

/* Indicador sutil de alternância no card */
.score-card-toggle-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 15px;
    color: #94a3b8;
    transition: transform 0.3s ease, color 0.2s ease;
    z-index: 5;
}

.score-gauge-card:hover .score-card-toggle-icon {
    color: #2563eb;
    transform: rotate(180deg);
}

/* ── Trilho Deslizante (Slide Animation) ─────────────────────────────────── */
.score-carousel-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.score-slider-track {
    display: flex;
    width: 200%;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: pan-y;
}

.score-slider-track.dragging {
    transition: none !important;
}

/* ── Views Alternáveis (Slides) ─────────────────────────────────────────── */
.score-view-mode {
    width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* ── Indicadores de Paginação (Dots) ─────────────────────────────────────── */
.score-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 2px 0;
}

.score-carousel-dots .score-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.35);
    cursor: pointer;
    transition: all 0.25s ease;
}

.score-carousel-dots .score-dot.active {
    width: 16px;
    border-radius: 99px;
    background: #e11d48;
}

/* ── Vista de Histórico (Barras) ─────────────────────────────────────────── */
.score-view-history {
    min-height: 160px;
    justify-content: space-between;
}

.score-history-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.score-history-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.score-history-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
}

.score-history-badge.up   { background: #d1fae5; color: #059669; }
.score-history-badge.down { background: #fee2e2; color: #dc2626; }
.score-history-badge.flat { background: #f1f5f9; color: #64748b; }

/* ── Área das Barras (5 Colunas Fixas) ────────────────────────────────────── */
.score-bars-wrapper {
    width: 100%;
    height: 100px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: flex-end;
    gap: 8px;
    padding: 4px 2px 2px;
    box-sizing: border-box;
}

/* Coluna individual */
.score-bar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 4px;
    min-width: 0;
}

.score-bar-track {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: flex-end;
}

/* Slots vazios aguardando análises */
.score-bar-slot-empty .score-bar-track {
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.04);
    height: 80px;
}

.score-bar-slot-empty .score-bar-month {
    color: #94a3b8;
    opacity: 0.6;
}

.score-bar-fill {
    width: 100%;
    border-radius: 6px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    transition: height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 24px;
}

.score-bar-fill.score-otimo {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.score-bar-fill.score-bom {
    background: #e0e7ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
}

.score-bar-fill.score-regular {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #b45309;
}

.score-bar-fill.score-ruim {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.score-bar-val {
    font-size: 11px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

.score-bar-month {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Indicador de Variação de Score ─────────────────────────────────────── */
.score-variation-indicator {
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 99px;
    transition: all 0.2s ease;
    user-select: none;
}

.score-variation-indicator i {
    font-size: 15px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.score-variation-indicator.positivo {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.score-variation-indicator.negativo {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.score-variation-indicator.negativo i {
    transform: rotate(180deg);
}

.score-variation-indicator.neutro {
    color: #64748b;
    background: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .score-variation-indicator.positivo {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .score-variation-indicator.negativo {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .score-variation-indicator.neutro {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
}

/* ── Estado Vazio / Carregando ───────────────────────────────────────────── */
.score-bars-empty,
.score-bars-loading {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
    width: 100%;
}

.score-bars-loading span {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: score-spin 0.7s linear infinite;
}

@keyframes score-spin {
    to { transform: rotate(360deg); }
}

/* ── Tema Escuro ─────────────────────────────────────────────────────────── */
[data-theme="dark"] .score-gauge-card,
body.dark-theme .score-gauge-card {
    background: #1e293b;
    border: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .score-gauge-card:hover,
body.dark-theme .score-gauge-card:hover {
    border: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .score-bar-slot-empty .score-bar-track {
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .score-bar-slot-empty .score-bar-month {
    color: #64748b;
    opacity: 0.7;
}

[data-theme="dark"] .score-carousel-dots .score-dot {
    background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .score-carousel-dots .score-dot.active {
    background: #f43f5e;
}

[data-theme="dark"] .score-history-title,
body.dark-theme .score-history-title {
    color: #94a3b8;
}

[data-theme="dark"] .score-bar-month,
body.dark-theme .score-bar-month {
    color: #94a3b8;
}

[data-theme="dark"] .score-bar-fill.score-otimo,
body.dark-theme .score-bar-fill.score-otimo {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.4);
    color: #60a5fa;
}

[data-theme="dark"] .score-bar-fill.score-bom,
body.dark-theme .score-bar-fill.score-bom {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #818cf8;
}

[data-theme="dark"] .score-bar-fill.score-regular,
body.dark-theme .score-bar-fill.score-regular {
    background: rgba(217, 119, 6, 0.2);
    border-color: rgba(217, 119, 6, 0.4);
    color: #fbbf24;
}

[data-theme="dark"] .score-bar-fill.score-ruim,
body.dark-theme .score-bar-fill.score-ruim {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
    color: #f87171;
}
