/* ═══════════════════════════════════════════════════════════════
   Dashboard.css  —  PsiAssist
   Caricato DOPO style.css — sovrascrive solo ciò che serve
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout dashboard ─────────────────────────────────────────── */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ── Card header ──────────────────────────────────────────────── */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--space-md);
}

.card-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* ── Welcome card ─────────────────────────────────────────────── */
.welcome-card {
    background: linear-gradient(145deg, #faf9f7 0%, #f3f0eb 55%, #ebe6df 100%);
    color: var(--text-main);
    border: 1px solid rgba(91, 124, 135, 0.12);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(44, 62, 71, 0.06);
    position: relative;
    overflow: hidden;
    padding: var(--space-lg) var(--space-xl);
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -8%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(91, 124, 135, 0.07) 0%, transparent 68%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 14px 0 0 14px;
}

.welcome-card--mattina::after {
    background: linear-gradient(180deg, #d4a574 0%, var(--primary) 100%);
}

.welcome-card--pomeriggio::after {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
}

.welcome-card--sera::after {
    background: linear-gradient(180deg, #7a8fa0 0%, #5b6f7d 100%);
}

.welcome-card__greeting {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #2c3e47;
    position: relative;
    z-index: 1;
}

.welcome-card__message {
    margin: 0;
    max-width: 52ch;
    font-size: 1rem;
    line-height: 1.65;
    color: #5a6c74;
    position: relative;
    z-index: 1;
}

/* ── Progress card ────────────────────────────────────────────── */
.progress-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a7b 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.progress-card h3 {
    margin: 0 0 var(--space-md);
    color: white;
    font-size: 1.125rem;
    position: relative;
    z-index: 1;
}

.progress-card p { color: #8298a6; margin-bottom: 0; }

.progress-bar-wrapper {
    margin-bottom: var(--space-xl);
    position: relative;
    z-index: 1;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.progress-label span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.progress-percentage {
    font-weight: 700;
    color: white;
    font-size: 1.5rem;
}

.progress-bar {
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f0d57d 0%, #FFEFBA 50%, #FFFFFF 100%);
    border-radius: 25px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 0; top: 0; bottom: 0;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2.5s infinite;
}

.progress-bar-text {
    position: relative;
    z-index: 2;
    color: #8298a6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes shimmer {
    0%   { left: -100%; }
    100% { left: 200%; }
}

/* ── Pillars ──────────────────────────────────────────────────── */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
    margin-bottom: var(--space-lg);
}

/* Pillar come link — reset stili <a> e ripristino layout */
.pillar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    /* rimuove outline di default su focus */
}
.pillar-container:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 4px;
    border-radius: 6px;
}
.pillar-container:hover { transform: translateY(-4px); }

.pillar-cylinder {
    width: 100%;
    max-width: 80px;
    height: 140px;
    position: relative;
    margin-bottom: 4px;
}

.cylinder-glass {
    position: absolute;
    width: 100%; height: 100%;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.05) 0%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.1);
}

.cylinder-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    border-radius: 0 0 6px 6px;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    /* altezza minima visibile anche a 0% */
    min-height: 4px;
}

.cylinder-fill::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%; height: 12px;
    border-radius: 50%;
    background: inherit;
    filter: brightness(1.3);
}

/* Colori per pilastro — TUTTI e 4 dichiarati */
.pillar-container[data-pillar="soma"]      .cylinder-fill { background: linear-gradient(180deg, #34d399 0%, #10b981 100%); }
.pillar-container[data-pillar="origine"]   .cylinder-fill { background: linear-gradient(180deg, #a78bfa 0%, #8b5cf6 100%); }
.pillar-container[data-pillar="realta"]    .cylinder-fill { background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%); }
.pillar-container[data-pillar="evoluzione"].cylinder-fill { background: linear-gradient(180deg, #a3e635 0%, #4b9502 100%); }

.cylinder-particles {
    position: absolute;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px; height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: float 3s infinite;
}

@keyframes float {
    0%, 100% { opacity: 0; transform: translateY(0); }
    10%       { opacity: 0.8; }
    90%       { opacity: 0; }
    100%      { transform: translateY(-100%); }
}

.pillar-pct {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin-bottom: 2px;
}

.pillar-name {
    font-weight: 600;
    color: white;
    font-size: 0.7rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Vitality bar ─────────────────────────────────────────────── */
.vitality-bar-container {
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vitality-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, #d6d2c6 0%, #fcf9ee 50%, #c2bfbf 100%);
    border-radius: 25px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.vitality-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2.5s infinite;
}

.vitality-bar-label {
    position: relative;
    z-index: 2;
    color: #8298a6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
    text-align: center;
}

.vitality-bar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.vitality-index-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    text-decoration: none;
}
.vitality-index-value em {
    font-style: normal;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ── Pulsante Ricalcola — molto più evidente ──────────────────── */
.btn-ricalcola {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(6px);
}
.btn-ricalcola:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-1px);
    text-decoration: none;
}
.btn-ricalcola--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    padding: 10px 22px;
    font-size: 0.9rem;
}
.btn-ricalcola--primary:hover { background: var(--primary-light); }

/* ── Daily insight card ───────────────────────────────────────── */
.daily-insight-card { border-left: 4px solid var(--primary); }

.insight-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.daily-insight-card h4 {
    margin: 0 0 var(--space-sm);
    color: var(--text-main);
    font-size: 1rem;
}

.daily-insight-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.insight-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--space-md);
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: auto;
}
.insight-cta:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.insight-cta:active { transform: translateY(0); }

.insight-cta.full-width {
    display: flex;
    width: 100%;
    justify-content: center;
    background: #1e3a5f;
    text-align: center;
}
.insight-cta.full-width:hover { background: #41699e; }

/* ── Professionisti ───────────────────────────────────────────── */
.pro-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.pro-slider::-webkit-scrollbar { display: none; }

.pro-item-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    flex: 0 0 220px;
    background: var(--primary-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    animation: none;
}
.pro-item-link:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    transform: translateY(-2px);
}
.pro-item-card--spotlight {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(44, 74, 82, 0.15);
}
.pro-promo-badges {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.pro-image {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-soft);
}

.pro-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pro-info { flex: 1; min-width: 0; }

.pro-info h4 {
    font-size: .92rem;
    font-weight: 700;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.pro-specialization { font-size: .78rem; color: var(--text-muted); margin: 0 0 3px; }
.pro-location       { font-size: .75rem; color: var(--text-muted); margin: 0 0 3px; }
.pro-modality       { font-size: .72rem; color: var(--primary); margin: 2px 0 0; font-weight: 500; }
.pro-rating         { font-size: .78rem; color: var(--text-muted); margin: 0; }
.pro-rating .star   { color: #f4a726; }

.pro-cta-btn {
    display: block;
    text-align: center;
    margin-top: auto;
    font-size: .8rem;
    padding: 8px 12px;
    min-height: auto;
}

.pro-footer-link { text-align: right; margin-top: 12px; font-size: .84rem; }

.pro-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.pro-link:hover { text-decoration: underline; }

.pro-empty-state    { text-align: center; padding: 28px 16px; }
.pro-empty-icon     { font-size: 2.2rem; margin-bottom: 10px; }
.pro-empty-title    { font-weight: 700; font-size: 1rem; margin: 0 0 8px; color: var(--text-main); }
.pro-empty-text     { font-size: .88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

.slider-controls { display: flex; gap: 6px; flex-shrink: 0; }

.nav-btn {
    background: none;
    color: var(--primary);
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    width: 32px; height: 32px;
    min-height: auto;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
    padding: 0;
}
.nav-btn:hover { background: var(--primary-soft); box-shadow: none; }

/* ── Articoli ─────────────────────────────────────────────────── */

/* Reset eredità da style.css su section/article */
.articles-card section.articles-list {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    animation: none;
    /* Grid responsive: mobile 1, tablet 2, desktop 4 */
    display: grid;
    grid-template-columns: 1fr;          /* mobile default */
    gap: 12px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: none;
    animation: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

.article-card .article-thumb {
    width: 100%;
    height: 110px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--primary-soft);
}
.article-card .article-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.article-card .article-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card .article-content h3 {
    font-size: .82rem;
    font-weight: 600;
    margin: 0 0 5px;
    line-height: 1.35;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .article-excerpt {
    font-size: .74rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.articles-card .article-meta,
.articles-card .article-footer { display: none; }

/* ── Responsive ───────────────────────────────────────────────── */

/* Tablet (≥600px): 2 colonne articoli */
@media (min-width: 600px) {
    .articles-card section.articles-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop medio (≥1024px): 3 colonne articoli */
@media (min-width: 1024px) {
    .articles-card section.articles-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop largo (≥1280px): 4 colonne articoli */
@media (min-width: 1280px) {
    .articles-card section.articles-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .slider-controls { display: none; }

    .pillars-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .pillar-cylinder {
        height: 100px;
    }

    .pillar-name { font-size: 0.6rem; }
}

@media (max-width: 400px) {
    .pro-item-link { flex: 0 0 190px; }
}

/* Elenco professionisti — card cliccabile */
.pro-elenco-card {
    transition: box-shadow .2s, transform .2s;
}

.pro-elenco-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
    transform: translateY(-2px);
}

.pro-elenco-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.pro-elenco-card__link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.pro-elenco-card a:not(.pro-elenco-card__link),
.pro-elenco-card button {
    position: relative;
    z-index: 2;
}