/*
 * Home - Stili dedicati
 * leggimenu Admin
 *
 * File dedicato agli asset della home in vista del redesign completo.
 * Scope: .lm-home-util3 (pannello full-width) + .lm-copy-toast (clipboard).
 * Versionato via costante HOME_CSS in inc/config.php.
 *
 * Linguaggio visivo coerente con estensioni-bar.css (icon-chip, chevron,
 * card border #ebedf2, hover #f7f9fb).
 */


/* =========================================================================
 * UTILITA' V3 — pannello full-width visual (.lm-home-util3)
 * ========================================================================= */

/* ----- Card ----- */
.lm-home-util3 .lm-home-util3__card {
    height: 100%;
    border: 1px solid #ebedf2;
    border-radius: 10px;
    padding: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* griglia: su md le card impilate hanno bisogno di spazio sotto */
@media (max-width: 991.98px) {
    .lm-home-util3 .col-lg-4 {
        margin-bottom: 16px;
    }
}

.lm-home-util3__card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.lm-home-util3__card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #48465b;
}

/* ----- Icon chip ----- */
.lm-home-util3__chip {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.lm-home-util3__chip--sm {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
}
.lm-home-util3__chip--dark    { background: rgba(44, 46, 62, 0.10); color: #2c2e3e; }
.lm-home-util3__chip--success { background: rgba(10, 187, 135, 0.12); color: #0abb87; }
.lm-home-util3__chip--brand  { background: rgba(0, 160, 181, 0.12); color: #00A0B5; }
.lm-home-util3__chip--info   { background: rgba(85, 120, 235, 0.12); color: #5578eb; }
.lm-home-util3__chip--danger { background: rgba(253, 57, 122, 0.12); color: #fd397a; }
.lm-home-util3__chip--muted  { background: #f0f1f5; color: #74788d; }

/* ----- QR Code preview ----- */
.lm-home-util3__qrbox {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f9fb;
    border: 1px solid #ebedf2;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.lm-home-util3__qrimg {
    width: 190px;
    height: 190px;
    max-width: 100%;
    display: block;
    border-radius: 6px;
    background: #fff;
}
.lm-home-util3__qr-formats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

/* ----- Bottoni ----- */
.lm-home-util3__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    box-sizing: border-box;
}
.lm-home-util3__btn code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.86rem;
    line-height: 1.2;
}
.lm-home-util3__btn--qr {
    background: #fff;
    border-color: #c7e9ee;
    color: #00A0B5;
    width: auto;
    margin-top: 0;
}
.lm-home-util3__btn--qr:hover {
    background: #00A0B5;
    border-color: #00A0B5;
    color: #fff;
    text-decoration: none;
}
.lm-home-util3__btn--qr:hover code { color: #fff; }
.lm-home-util3__btn--ghost {
    background: rgba(10, 187, 135, 0.10);
    color: #0abb87;
}
.lm-home-util3__btn--ghost:hover {
    background: #0abb87;
    color: #fff;
    text-decoration: none;
}
.lm-home-util3__btn--print {
    background: rgba(243, 156, 18, 0.14);
    color: #d98c00;
}
.lm-home-util3__btn--print:hover {
    background: #f39c12;
    color: #fff;
    text-decoration: none;
}
.lm-home-util3__btn--preview {
    background: #2c2e3e;
    color: #fff;
    width: 100%;
    margin-top: 14px;
    margin-bottom: 4px;
    padding: 15px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(44, 46, 62, 0.28);
}
.lm-home-util3__btn--preview i {
    font-size: 1.2rem;
}
.lm-home-util3__btn--preview:hover {
    background: #1b1c27;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(44, 46, 62, 0.36);
}

/* azioni QR (Prova / Stampa) affiancate */
.lm-home-util3__qr-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
.lm-home-util3__qr-actions .lm-home-util3__btn {
    margin-top: 0;
}

/* ----- Bottoni condivisione social ----- */
.lm-home-util3__share {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
}
/* Solo su schermi molto larghi (>= 1920px): bottoni share affiancati a 2 colonne */
@media (min-width: 1920px) {
    .lm-home-util3__share {
        grid-template-columns: 1fr 1fr;
    }
}
.lm-home-util3__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    transition: filter 0.15s ease, transform 0.12s ease;
}
.lm-home-util3__share-btn:hover {
    color: #fff;
    text-decoration: none;
    filter: brightness(0.93);
    transform: translateY(-1px);
}
.lm-home-util3__share-btn--whatsapp  { background: #25D366; }
.lm-home-util3__share-btn--telegram  { background: #0088cc; }
.lm-home-util3__share-btn--facebook  { background: #3b5998; }
.lm-home-util3__share-btn--email     { background: #595d6e; }

/* ----- Righe (PDF) ----- */
.lm-home-util3__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #ebedf2;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
    text-decoration: none;
    color: #2c2e3e;
    transition: background 0.15s ease, border-color 0.15s ease;
}
a.lm-home-util3__row:hover {
    background: #f7f9fb;
    border-color: #d9dde6;
    text-decoration: none;
    color: #2c2e3e;
}
.lm-home-util3__row--static { cursor: default; }
.lm-home-util3__row-text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.lm-home-util3__row-text small {
    font-weight: 400;
    font-size: 0.76rem;
    color: #a2a5b9;
}
.lm-home-util3__flag {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    object-fit: cover;
}
.lm-home-util3__row-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
}
.lm-home-util3__act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: #f0f1f5;
    color: #595d6e;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}
.lm-home-util3__act:hover {
    background: #00A0B5;
    color: #fff;
    text-decoration: none;
}
.lm-home-util3__chevron {
    flex: 0 0 auto;
    color: #c4c7d4;
    font-size: 0.9rem;
}
.lm-home-util3__chevron--toggle { transition: transform 0.2s ease; }
.lm-home-util3 [aria-expanded="true"] .lm-home-util3__chevron--toggle { transform: rotate(180deg); }
.lm-home-util3__collapse { margin-bottom: 8px; }
.lm-home-util3__collapse .lm-home-util3__row { background: #fbfcfd; }

/* ----- Condividi ----- */
.lm-home-util3__copy {
    margin-bottom: 10px;
}
.lm-home-util3__hint {
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #a2a5b9;
}
.lm-home-util3__hint a { color: #00A0B5; }

/* ----- Modale Stampa QR Code (MALI FACTORY) ----- */
.lm-home-util3-modal__media {
    margin-bottom: 16px;
}
.lm-home-util3-modal__media img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}
.lm-home-util3-modal__badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(243, 156, 18, 0.14);
    color: #d98c00;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}
.lm-home-util3-modal__content h4 {
    font-weight: 600;
    color: #48465b;
    margin-bottom: 10px;
}
.lm-home-util3-modal__content p {
    color: #595d6e;
    line-height: 1.5;
}
.lm-home-util3-modal__list {
    list-style: none;
    padding: 0;
    margin: 14px 0;
}
.lm-home-util3-modal__list li {
    padding: 4px 0;
    color: #48465b;
}
.lm-home-util3-modal__list li i {
    margin-right: 8px;
}
.lm-home-util3-modal__hint {
    font-size: 0.84rem;
    color: #a2a5b9 !important;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .lm-home-util3__qr-formats,
    .lm-home-util3__qr-actions {
        grid-template-columns: 1fr;
    }
}


/* ===== Mini-toast contestuale "Link copiato" (clipboard) ===== */
.lm-copy-toast {
    position: absolute;
    z-index: 10000;
    background: #0abb87;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(10, 187, 135, 0.35);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.lm-copy-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.lm-copy-toast i {
    margin-right: 6px;
}
