/* ===== GUIDA INTERATTIVA ===== */
/* Zero impatto visivo quando disattivata */

/* Pulsante toggle guida nell'header */
.guide-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color, #334155);
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
.guide-toggle:hover {
    border-color: var(--accent-blue, #3b82f6);
    color: var(--accent-blue, #3b82f6);
    background: rgba(59,130,246,0.1);
}
.guide-toggle.active {
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
    color: #fff;
}

/* Icone help (?) accanto agli elementi */
.guide-help-icon {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue, #3b82f6);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(59,130,246,0.4);
    transition: transform 0.15s;
    font-family: 'Segoe UI', system-ui, sans-serif;
    pointer-events: auto;
}
.guide-help-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 10px rgba(59,130,246,0.6);
}

/* Mostra icone solo quando guida attiva */
body.guide-active .guide-help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popover */
.guide-popover {
    position: fixed;
    max-width: 320px;
    min-width: 220px;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 10000;
    color: var(--text-primary, #f1f5f9);
    animation: guidePopIn 0.15s ease-out;
}

@keyframes guidePopIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.guide-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color, #334155);
}

.guide-popover-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue, #3b82f6);
    margin: 0;
}

.guide-popover-close {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.guide-popover-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #f1f5f9);
}

.guide-popover-body {
    padding: 10px 14px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary, #94a3b8);
}

/* Freccia del popover */
.guide-popover-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-color, #334155);
    transform: rotate(45deg);
}
.guide-popover-arrow.arrow-top {
    bottom: -6px;
    border-top: none;
    border-left: none;
}
.guide-popover-arrow.arrow-bottom {
    top: -6px;
    border-bottom: none;
    border-right: none;
}

/* Overlay scuro dietro popover */
.guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9999;
}

/* Tooltip CSS per elementi piccoli (hover) */
body.guide-active [data-guide-tip] {
    position: relative;
}
body.guide-active [data-guide-tip]::after {
    content: attr(data-guide-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    max-width: 250px;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
body.guide-active [data-guide-tip]:hover::after {
    opacity: 1;
}
