/* ==========================================================================
   AIO Food Blog - Module 4: Social Share Buttons Styles
   ========================================================================== */

.aio-share-container {
    margin: 32px 0 24px 0;
    clear: both;
    font-family: var(--global-body-font-family, 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
}

.aio-share-container.aio-share-pos-top {
    margin: 16px 0 28px 0;
}

.aio-share-heading {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aio-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Alignments */
.aio-share-align-center .aio-share-buttons {
    justify-content: center;
}
.aio-share-align-center .aio-share-heading {
    justify-content: center;
    text-align: center;
}

.aio-share-align-left .aio-share-buttons {
    justify-content: flex-start;
}
.aio-share-align-left .aio-share-heading {
    justify-content: flex-start;
    text-align: left;
}

.aio-share-align-right .aio-share-buttons {
    justify-content: flex-end;
}
.aio-share-align-right .aio-share-heading {
    justify-content: flex-end;
    text-align: right;
}

.aio-share-align-justified .aio-share-buttons {
    justify-content: space-between;
}
.aio-share-align-justified .aio-share-buttons .aio-share-btn {
    flex: 1 1 auto;
}

/* Share Button Base (Chuẩn giao diện Screenshot_8.png & Screenshot_10.png) */
.aio-share-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    font-weight: 600;
    line-height: 1;
    border: none;
    outline: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
    box-sizing: border-box;
    box-shadow: none;
}

.aio-share-btn:hover {
    opacity: 0.9;
    color: #ffffff !important;
}

.aio-share-btn:active {
    opacity: 1;
}

.aio-share-btn svg {
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.aio-share-label {
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Sizes */
.aio-share-size-small .aio-share-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 12px;
    font-size: 13px;
}
.aio-share-size-small .aio-share-btn.aio-btn-icon-only {
    width: 32px;
    padding: 0;
}
.aio-share-size-small .aio-share-btn svg {
    width: 14px;
    height: 14px;
}

.aio-share-size-medium .aio-share-btn {
    height: 38px;
    min-width: 42px;
    padding: 0 16px;
    font-size: 14px;
}
.aio-share-size-medium .aio-share-btn.aio-btn-icon-only {
    width: 38px;
    padding: 0;
}
.aio-share-size-medium .aio-share-btn svg {
    width: 16px;
    height: 16px;
}

.aio-share-size-large .aio-share-btn {
    height: 46px;
    min-width: 46px;
    padding: 0 20px;
    font-size: 15px;
}
.aio-share-size-large .aio-share-btn.aio-btn-icon-only {
    width: 46px;
    padding: 0;
}
.aio-share-size-large .aio-share-btn svg {
    width: 20px;
    height: 20px;
}

/* Shapes */
.aio-share-shape-rounded .aio-share-btn {
    border-radius: 4px;
}
.aio-share-shape-circle .aio-share-btn {
    border-radius: 28px;
}
.aio-share-shape-circle .aio-share-btn.aio-btn-icon-only {
    border-radius: 50%;
}
.aio-share-shape-square .aio-share-btn {
    border-radius: 0;
}

/* Official Colors (Chuẩn màu Screenshot_8.png & Screenshot_10.png) */
.aio-share-style-official .aio-share-facebook  { background-color: #3b5998 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-twitter   { background-color: #000000 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-pinterest { background-color: #cb2027 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-email     { background-color: #737373 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-sharethis,
.aio-share-style-official .aio-share-share     { background-color: #7cb342 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-whatsapp  { background-color: #25D366 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-copy      { background-color: #0D9488 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-print     { background-color: #475569 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-telegram  { background-color: #0088CC !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-messenger { background-color: #0084FF !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-linkedin  { background-color: #0A66C2 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-reddit    { background-color: #FF4500 !important; color: #ffffff !important; }
.aio-share-style-official .aio-share-sms       { background-color: #EAB308 !important; color: #ffffff !important; }

/* Nút SMS: Mặc định ẩn trên Desktop, chỉ hiển thị trên Điện thoại (Mobile) */
.aio-share-btn.aio-share-sms {
    display: none !important;
}

/* Bảo vệ tuyệt đối nút Pinterest trong Social Share không bị pinit.js ghi đè thành widget */
.aio-share-btn.aio-share-pinterest {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #cb2027 !important;
    color: #ffffff !important;
    box-sizing: border-box !important;
}
.aio-share-size-medium .aio-share-btn.aio-share-pinterest {
    height: 38px !important;
    padding: 0 16px !important;
}
.aio-share-size-small .aio-share-btn.aio-share-pinterest {
    height: 32px !important;
    padding: 0 12px !important;
}
.aio-share-size-large .aio-share-btn.aio-share-pinterest {
    height: 46px !important;
    padding: 0 20px !important;
}
.aio-share-btn.aio-share-pinterest > span[data-pin-log],
.aio-share-btn.aio-share-pinterest > span[class*="PIN_"],
.aio-share-btn.aio-share-pinterest iframe {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}
.aio-share-btn.aio-share-pinterest svg {
    display: inline-block !important;
    fill: #ffffff !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
}

@media (min-width: 681px) {
    .aio-share-btn.aio-share-pinterest .aio-share-label {
        display: inline-block !important;
        color: #ffffff !important;
    }
}

/* Minimal Dark Style */
.aio-share-style-minimal_dark .aio-share-btn {
    background-color: #1e293b;
    color: #ffffff;
}
.aio-share-style-minimal_dark .aio-share-btn:hover {
    background-color: #334155;
}

/* Minimal Light Style */
.aio-share-style-minimal_light .aio-share-btn {
    background-color: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.aio-share-style-minimal_light .aio-share-btn:hover {
    background-color: #ffffff;
    color: #0f172a !important;
    border-color: #cbd5e1;
}

/* ==========================================================================
   Sticky Floating Share Bar (Side Screen)
   ========================================================================== */
.aio-sticky-share-bar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.aio-sticky-share-bar.aio-sticky-left {
    left: 12px;
}

.aio-sticky-share-bar.aio-sticky-right {
    right: 12px;
}

.aio-sticky-share-bar .aio-share-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    box-shadow: none;
}

.aio-sticky-share-bar .aio-share-btn svg {
    width: 18px;
    height: 18px;
}

.aio-sticky-share-bar.aio-shape-circle .aio-share-btn {
    border-radius: 50%;
}

.aio-sticky-share-bar.aio-shape-square .aio-share-btn {
    border-radius: 0;
}

/* Hide on Mobile */
@media (max-width: 768px) {
    .aio-sticky-hide-mobile {
        display: none !important;
    }
}

/* ==========================================================================
   Copy Link Toast Notification
   ========================================================================== */
.aio-share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.aio-share-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ==========================================================================
   Tooltips on Desktop Hover (Di chuột trên máy tính hiển thị tooltip)
   ========================================================================== */
@media (min-width: 681px) {
    .aio-share-btn[data-tooltip]::before {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(4px);
        border: 5px solid transparent;
        border-top-color: #1e293b;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10000;
        margin-bottom: -1px;
    }

    .aio-share-btn[data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(4px);
        margin-bottom: 9px;
        background-color: #1e293b;
        color: #ffffff;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.2;
        padding: 6px 11px;
        border-radius: 6px;
        white-space: nowrap;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.12);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10000;
        letter-spacing: 0.2px;
    }

    .aio-share-btn[data-tooltip]:hover::before,
    .aio-share-btn[data-tooltip]:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==========================================================================
   Mobile Display: Chỉ hiển thị Icon, thu gọn 5 nút vừa vặn 1 hàng (Phones)
   ========================================================================== */
@media (max-width: 680px) {
    .aio-share-container .aio-share-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .aio-share-container .aio-share-btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
        height: 42px !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    /* Ẩn triệt để nhãn chữ trên điện thoại cho tất cả các nút (kể cả Pinterest) */
    .aio-share-container .aio-share-label,
    .aio-share-container .aio-share-btn .aio-share-label,
    .aio-share-btn.aio-share-pinterest .aio-share-label,
    .aio-share-pinterest .aio-share-label {
        display: none !important;
    }

    /* Hiển thị nút SMS trên thiết bị di động (Phones) */
    .aio-share-container .aio-share-btn.aio-share-sms {
        display: inline-flex !important;
    }

    .aio-share-container .aio-share-btn svg {
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
    }

    /* Tắt tooltip trên điện thoại để không bị che khuất khi chạm ngón tay */
    .aio-share-btn::before,
    .aio-share-btn::after {
        display: none !important;
    }
}
