/* ================================================
   Alanews Share Bar – Frontend v1.3
   ================================================ */

.asb-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    margin: 0 0 20px 0;
    background: #ffffff;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    line-height: 1;
    box-sizing: border-box;
}

/* ---- Sinistra ---- */
.asb-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.asb-share-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 7px 4px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    color: #333 !important;
    font-family: 'Inter', sans-serif !important;
    font-style: normal !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none !important;
    text-decoration: none !important;
}
.asb-share-btn svg { font-size: 14px; width: 20px !important; height: 20px !important; transition: transform .15s ease; }
.asb-share-btn:hover {
    background: transparent !important;
    color: #333 !important;
}
.asb-share-btn:hover svg { transform: scale(1.2); }

/* ---- Dropdown ORIZZONTALE icon-only ----
 * Spostato su <body> via JS per sfuggire a overflow:hidden di JNews.
 */
.asb-dropdown {
    display: none;
    position: absolute; /* coords calcolati via JS */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,.13);
    z-index: 9999999 !important;
    padding: 6px 10px;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.asb-dropdown.is-open {
    display: inline-flex !important;
}

/* Ogni item: cerchio con solo l'icona */
.asb-item {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 50%;
    color: #333 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .12s, transform .12s;
    box-sizing: border-box;
    flex-shrink: 0;
}
.asb-item:hover {
    background: #f0f0f0 !important;
    transform: scale(1.15);
    color: #333 !important;
    text-decoration: none !important;
}

/* Nasconde il testo, mostra solo icona */
.asb-item .asb-label {
    display: none !important;
}

/* ---- Destra ---- */
.asb-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.asb-google-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    background: #f1f3f4;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #333 !important;
    font-family: 'Inter', sans-serif !important;
    font-style: normal !important;
    font-size: 14px;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
    line-height: 1;
}
.asb-google-btn:hover {
    background: #e8eaed;
    border-color: #d0d0d0;
    color: #333 !important;
    text-decoration: none !important;
}

/* ---- Info ⓘ ---- */
.asb-info-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.asb-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #111 !important;
    border: none;
    border-radius: 50%;
    color: #fff !important;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background .15s;
}
.asb-info-btn:hover { background: #000 !important; color: #fff !important; }
.asb-info-btn svg { width: 14px; height: 14px; }

.asb-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 240px;
    padding: 10px 14px;
    background: #222;
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    z-index: 9999999;
    pointer-events: none;
}
.asb-tooltip.is-visible { display: block !important; }
.asb-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    border: 6px solid transparent;
    border-top-color: #222;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .asb-bar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
    .asb-left { gap: 10px; min-width: 0; flex: 1 1 auto; }
    .asb-right { gap: 6px; min-width: 0; flex-shrink: 1; }
    .asb-google-btn { font-size: 12px; padding: 6px 10px; gap: 5px; min-width: 0; }
    .asb-google-text { overflow: hidden; text-overflow: ellipsis; }
    .asb-share-btn { padding: 6px 8px; font-size: 13px; }
    .asb-item { width: 32px; height: 32px; }
}

/* Mobile stretto: nascondi label "Aggiungi Alanews su Google", lascia solo icona G */
@media (max-width: 480px) {
    .asb-bar { padding: 8px 10px; gap: 6px; }
    .asb-google-text { display: none; }
    .asb-google-btn { padding: 7px 10px; gap: 0; }
    .asb-google-btn svg { width: 18px; height: 18px; }
    .asb-share-btn { padding: 6px 4px; font-size: 12px; }
    .asb-listen-btn { padding: 6px 4px; font-size: 12px; }
    .asb-listen-btn svg,
    .asb-share-btn svg { width: 18px !important; height: 18px !important; }
}

/* ===== Listen-to-Article pill (P2) ===== */
.asb-listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #333 !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    transition: color .15s;
}
.asb-listen-btn:hover { color: #000 !important; }
.asb-listen-btn.is-active { color: #000 !important; }
.asb-listen-btn svg { width: 20px !important; height: 20px !important; transition: transform .15s ease; }
.asb-listen-btn:hover svg { transform: scale(1.2); }

.asb-listen-panel[hidden] { display: none !important; }
.asb-listen-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 0 0 20px 0;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    flex-wrap: wrap;
}
.asb-listen-panel button {
    background: transparent; border: 0; cursor: pointer; font: inherit;
    color: #111; padding: 4px 8px; border-radius: 6px;
}
.asb-listen-panel button:hover { background: #efefef; }
.asb-listen-panel .asb-l-play {
    width: 36px; height: 36px; border-radius: 50% !important;
    background: #111; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.asb-listen-panel .asb-l-progress { flex: 1 1 200px; min-width: 120px; }
.asb-listen-panel .asb-l-bar { height: 4px; background: #ddd; border-radius: 2px; cursor: pointer; overflow: hidden; }
.asb-listen-panel .asb-l-fill { height: 100%; width: 0; background: #111; border-radius: 2px; }
.asb-listen-panel .asb-l-cur,
.asb-listen-panel .asb-l-tot,
.asb-listen-panel .asb-l-sep { font-variant-numeric: tabular-nums; font-size: 12px; color: #666; }

/* ===== Floating mini-player persistente ===== */
.asb-float-player {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999998;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px 8px 8px;
    background: #111;
    color: #fff;
    border-radius: 40px;
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    max-width: 420px;
    min-width: 320px;
}
.asb-float-player .asb-fp-play {
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: #111;
    border: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.asb-float-player .asb-fp-play:hover { background: #eee; }
.asb-float-player .asb-fp-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
}
.asb-float-player .asb-fp-title {
    color: #fff !important;
    text-decoration: none !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
    font-weight: 600;
    font-size: 13px;
    word-break: break-word;
}
.asb-float-player .asb-fp-title:hover { text-decoration: underline !important; }
.asb-float-player .asb-fp-time {
    color: #bbb;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.3;
    text-align: right;
}
.asb-float-player .asb-fp-close {
    background: transparent; border: 0; color: #bbb;
    font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
    flex-shrink: 0;
    align-self: center;
}
.asb-float-player .asb-fp-close:hover { color: #fff; }
@media (max-width: 600px) {
    .asb-float-player { left: 12px; right: 12px; bottom: 12px; max-width: none; }
    .asb-float-player { min-width: 0; }
}
