/* css/dashboard.css */

/* --- HEADER --- */
.dash-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px;
}
.dash-header h1 { font-size: 2rem; font-weight: 700; color: white; }

/* Subtítulo com gradiente usando a cor do tema */
.subtitle-animada {
    background: linear-gradient(90deg, #A1A1AA, var(--brand-pink), #FFFFFF);
    background-size: 200% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite; font-weight: 500; margin-top: 4px;
}
@keyframes shine { to { background-position: 200% center; } }

.date-badge {
    background: rgba(255, 255, 255, 0.05); padding: 8px 16px; border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-secondary);
    font-size: 0.9rem; white-space: nowrap;
}

/* --- KPIs (Cards Topo) --- */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px; margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-card); padding: 24px; border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05); position: relative; overflow: hidden;
    transition: transform 0.3s, border-color 0.3s; cursor: default;
}
.kpi-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-pink); /* Borda brilha na cor do tema */
}

/* Ícones agora usam a variável e fundo neutro para combinar com tudo */
.kpi-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; font-size: 20px;
    background: rgba(255, 255, 255, 0.05); /* Fundo neutro */
}
.kpi-icon.pink { color: var(--brand-pink); } /* Usa a cor do tema */
.kpi-icon.purple { color: #D500F9; }
.kpi-icon.green { color: #00E676; }

.kpi-card span { display: block; color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 4px; }
.kpi-card h2 { color: white; font-size: 1.5rem; }
.edit-icon { font-size: 12px; opacity: 0.5; cursor: pointer; }

/* --- Middle Grid --- */
.middle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.feature-card { background: #1E1E24; border-radius: 20px; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.05); }

/* Card VR */
.vr-card { background: linear-gradient(145deg, #1E1E24, #151816); }
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.icon-box-vr {
    width: 40px; height: 40px; background: rgba(101, 31, 255, 0.2); color: #D500F9;
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.card-header h3 { font-size: 1rem; color: white; margin: 0; }
.card-header small { color: var(--text-secondary); font-size: 0.8rem; }
.badge-vr { margin-left: auto; font-size: 0.75rem; color: #00E676; background: rgba(0, 230, 118, 0.1); padding: 4px 8px; border-radius: 4px; }
.vr-values { display: flex; justify-content: space-between; margin-bottom: 12px; }
.vr-values h3 { font-size: 1.5rem; color: white; }
.text-green { color: #00E676 !important; }
.progress-bg { height: 8px; background: #333; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: #00E676; transition: width 1s; }
.footer-text { font-size: 0.75rem; color: #666; cursor: pointer; }
.footer-text:hover { color: #aaa; text-decoration: underline; }

/* Card Saúde */
.health-content { display: flex; align-items: center; gap: 24px; }
.score-circle { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.score-circle svg { width: 80px; height: 80px; transform: rotate(-90deg); }
.score-circle circle { fill: none; stroke-width: 6; stroke: #333; stroke-dasharray: 220; stroke-dashoffset: 0; }
.score-circle circle:nth-child(2) { stroke: #00E676; stroke-dashoffset: 220; transition: stroke-dashoffset 1.5s ease-in-out; }
.score-number { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-number span { font-weight: 700; font-size: 1.2rem; color: white; }
.score-number small { font-size: 0.6rem; color: #aaa; }
.health-text h4 { font-size: 1.1rem; margin-bottom: 4px; }
.health-text p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 12px; }
.mini-stats { display: flex; gap: 16px; font-size: 0.8rem; color: #888; flex-wrap: wrap; }
.mini-stats b { color: white; }

/* --- META PRINCIPAL (RESPONSIVA & TEMÁTICA) --- */
.main-goal-card {
    /* Gradiente suave usando a cor do tema */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(30, 30, 36, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px; padding: 32px; margin-bottom: 32px; text-align: center;
}

.main-goal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

.main-goal-icon {
    width: 40px; height: 40px; 
    background: var(--brand-pink); /* Ícone usa cor do tema */
    color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.goal-values-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding: 0 5%; flex-wrap: wrap; gap: 20px; }
.goal-values-row > div { flex: 1; min-width: 120px; }
.goal-values-row span { color: #ccc; font-size: 0.9rem; display: block; margin-top: 4px; }
.goal-values-row h2 { color: white; font-size: 1.8rem; margin: 0; }

/* Barra Neon Temática */
.bar-container-glow {
    height: 12px; background: #333; border-radius: 6px; overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); position: relative; margin-bottom: 16px;
}
.bar-fill-glow {
    height: 100%; 
    background: var(--brand-pink); /* Cor do tema */
    border-radius: 6px;
    box-shadow: 0 0 15px var(--brand-pink); /* Brilho na cor do tema */
    width: 0%; transition: width 1s;
}

.motivation-text { font-size: 0.9rem; color: #aaa; }
.motivation-text b { color: var(--brand-pink); } /* Texto em destaque na cor do tema */

/* --- Bottom Grid --- */
.bottom-grid-dash { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; }
.list-card { background: #1E1E24; border-radius: 20px; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.05); }
.list-card h3 { font-size: 1rem; color: white; margin-bottom: 16px; }
.recent-item, .source-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.recent-item:last-child { border: none; }
.ri-left { display: flex; gap: 12px; align-items: center; }
.ri-icon { width: 32px; height: 32px; background: rgba(255, 255, 255, 0.05); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.ri-info strong { display: block; color: white; font-size: 0.9rem; }
.ri-info small { color: #666; font-size: 0.75rem; }
.ri-value { font-weight: 600; color: #fff; white-space: nowrap; }
.see-more { display: block; text-align: center; color: var(--brand-pink); margin-top: 16px; text-decoration: none; font-size: 0.9rem; }

@media (max-width: 768px) {
    .dash-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .date-badge { align-self: flex-start; }
    .middle-grid, .bottom-grid-dash { grid-template-columns: 1fr; }
    .main-goal-card { padding: 20px; text-align: left; }
    .main-goal-header { justify-content: flex-start; margin-bottom: 20px; }
    .main-goal-header div:last-child { margin-left: 0; width: 100%; text-align: right; font-size: 1.2rem; }
    .goal-values-row { flex-direction: column; align-items: flex-start; gap: 16px; padding: 0; }
    .goal-values-row > div { text-align: left !important; }
    .goal-values-row h2 { font-size: 1.5rem; }
    .kpi-grid { grid-template-columns: 1fr; }
}
/* --- Modal de Edição na Dashboard --- */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); 
    display: flex; justify-content: center; align-items: center; 
    z-index: 2000; opacity: 0; pointer-events: none; transition: 0.3s; 
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal { 
    background: #1E1E24; padding: 32px; border-radius: 20px; 
    width: 100%; max-width: 400px; 
    border: 1px solid color-mix(in srgb, var(--brand-pink) 30%, transparent); 
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); 
    transform: translateY(20px); transition: 0.3s; 
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.btn-icon { background: none; border: none; color: var(--text-secondary); cursor: pointer; transition: 0.2s;}
.btn-icon:hover { color: white; }

.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.input-group label { font-size: 0.85rem; color: var(--text-secondary); }
.input-group input { 
    background: #121214; border: 1px solid #333; padding: 12px; 
    border-radius: 8px; color: white; outline: none; font-size: 1rem; transition: 0.3s; 
}
.input-group input:focus { border-color: var(--brand-pink); }

.modal-actions { display: flex; gap: 12px; }
.btn-secondary { 
    flex: 1; background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--text-secondary); padding: 12px; border-radius: 8px; 
    cursor: pointer; font-weight: 600; transition: 0.3s; 
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.05); color: white; }

.btn-primary { 
    flex: 1; display: flex; align-items: center; justify-content: center;
    background: var(--brand-pink); color: white; border: none; 
    padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600; 
    box-shadow: 0 4px 15px color-mix(in srgb, var(--brand-pink) 40%, transparent); transition: 0.3s; 
}
.btn-primary:hover { 
    background: var(--brand-pink-hover); transform: translateY(-2px); 
    box-shadow: 0 6px 20px color-mix(in srgb, var(--brand-pink) 60%, transparent); 
}