/* =========================================================================
   Yann Theme - Contact Widget Styles (BEM Naming Convention)
   Block: contact-widget
   Color Scheme: Black/White with Gold Accents (#d4af37)
   Mobile First Approach
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Block & Shared Base Styles
   ------------------------------------------------------------------------- */
.contact-widget {
    z-index: 998;
}

/* Base button reset - Element: __btn */
.contact-widget__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    color: #fff;
    /* Default white icons */
}

.contact-widget__btn:focus {
    outline: none;
}

/* Default Icon Style - Inherit sizing and color */
.contact-widget__btn .icon,
.contact-widget__btn .icon svg,
.contact-widget__btn svg {
    display: block;
    transition: all 0.3s ease;
    fill: currentColor;
}

/* Handle stroke-based icons */
.contact-widget__btn svg[fill="none"] {
    fill: none;
    stroke: currentColor;
}

/* -------------------------------------------------------------------------
   2. Mobile Bottom Bar (Default View) - Element: __mobile-bar
   ------------------------------------------------------------------------- */
.contact-widget__mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Mobile Button Formatting */
.contact-widget__mobile-bar .contact-widget__btn {
    height: 100%;
    width: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-widget__mobile-bar .contact-widget__btn:last-child {
    border-right: none;
}

/* Mobile Icon Size: 24px */
.contact-widget__mobile-bar .contact-widget__btn .icon,
.contact-widget__mobile-bar .contact-widget__btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Active State - Gold accent */
.contact-widget__mobile-bar .contact-widget__btn:active {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
}

/* Hide Desktop Sidebar on Mobile - Element: __desktop-sidebar */
.contact-widget__desktop-sidebar {
    display: none !important;
}

/* -------------------------------------------------------------------------
   3. Contact Modal (Popup) - Element: __modal
   ------------------------------------------------------------------------- */
.contact-widget__modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

/* Modifier: --active */
.contact-widget__modal.active {
    display: block;
}

/* Element: __modal-overlay */
.contact-widget__modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Element: __modal-content */
.contact-widget__modal-content {
    position: absolute;
    bottom: 62px;
    left: 0;
    right: 0;
    background: #1a1a1a;
    /* border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 30px 20px; */
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    border-top: 1px solid #333;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Element: __modal-close */
.contact-widget__modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    transition: color 0.3s;
}

.contact-widget__modal-close:hover {
    color: #d4af37;
    /* Gold hover */
}

/* Hide optional H3 title */
.contact-widget__modal-content h3 {
    display: none;
}

/* Element: __methods-list */
.contact-widget__methods-list {
    list-style: none;
    margin: 0;
    padding: 10px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Element: __method */
.contact-widget__method {
    margin: 0;
}

/* Element: __method-link */
.contact-widget__method-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
    height: 60px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 12px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.contact-widget__method-link:hover,
.contact-widget__method-link:active {
    background: #fff;
    /* White background on hover */
    border-color: #fff;
    color: #000;
}

.contact-widget__method-link:hover svg,
.contact-widget__method-link:active svg {
    color: #d4af37;
    /* Gold icon on hover */
}

/* Standardize Modal Text */
.contact-widget__method-link span {
    font-size: 16px;
    font-weight: 500;
}

/* Modal Icon Size: 20px */
.contact-widget__method-link .icon,
.contact-widget__method-link svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: #fff;
    /* White icons by default */
    max-width: 20px;
    max-height: 20px;
}

/* -------------------------------------------------------------------------
   4. WeChat QR Modal - Modifier: __modal--wechat
   ------------------------------------------------------------------------- */
.contact-widget__modal--wechat {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contact-widget__modal--wechat.active {
    display: flex;
}

/* Modifier: __modal-content--wechat */
.contact-widget__modal-content--wechat {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 360px;
    text-align: center;
    position: relative;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.contact-widget__modal-content--wechat img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #eee;
}

.contact-widget__modal-content--wechat h3 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 18px;
    display: block;
}

.contact-widget__modal-content--wechat p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.contact-widget__modal--wechat .contact-widget__modal-close {
    color: #333;
    top: 5px;
    right: 10px;
}

/* Prevent body scroll */
body.modal-open {
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   5. Desktop Mode (min-width: 768px)
   ------------------------------------------------------------------------- */
@media (min-width: 768px) {

    /* Hide Mobile Bar */
    body .contact-widget__mobile-bar,
    body.yann-theme .contact-widget__mobile-bar {
        display: none !important;
    }

    /* Show Desktop Sidebar - Element: __desktop-sidebar */
    body .contact-widget__desktop-sidebar,
    body.yann-theme .contact-widget__desktop-sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        width: 56px;

        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        z-index: 998;
        padding: 0;
        overflow: visible !important;
    }

    /* Desktop Sidebar Buttons */
    body .contact-widget__desktop-sidebar .contact-widget__btn {
        width: 56px;
        height: 56px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
        overflow: visible;
    }

    body .contact-widget__desktop-sidebar .contact-widget__btn:last-child {
        border-bottom: none;
    }

    /* Desktop Icon Size: 24px */
    body .contact-widget__desktop-sidebar .contact-widget__btn .icon,
    body .contact-widget__desktop-sidebar .contact-widget__btn svg {
        width: 24px;
        height: 24px;
    }

    /* Desktop Hover Effect - Gold accent */
    body .contact-widget__desktop-sidebar .contact-widget__btn:hover {
        background: rgba(212, 175, 55, 0.15);
        color: #d4af37;
    }

    /* ------------------------------------------------------
     Desktop Tooltip (Data Attribute)
     ------------------------------------------------------ */
    .contact-widget__desktop-sidebar .contact-widget__btn[data-tooltip]::before {
        content: attr(data-tooltip);
        position: absolute;
        right: calc(100% + 15px);
        top: 50%;
        transform: translateY(-50%);
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
        padding: 6px 12px;
        border-radius: 4px;
        font-size: 13px;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* Tooltip Arrow */
    .contact-widget__desktop-sidebar .contact-widget__btn[data-tooltip]::after {
        content: '';
        position: absolute;
        right: calc(100% + 9px);
        top: 50%;
        transform: translateY(-50%);
        border-left: 6px solid rgba(30, 30, 30, 0.95);
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
    }

    .contact-widget__desktop-sidebar .contact-widget__btn:hover::before,
    .contact-widget__desktop-sidebar .contact-widget__btn:hover::after {
        opacity: 1;
        visibility: visible;
    }

    /* Modal Centering on Desktop */
    .contact-widget__modal-content {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: 400px;
        max-width: 90vw;
        transform: translate(-50%, -50%);
        border-radius: 12px;
        animation: fadeInCenter 0.3s ease-out;
    }

    @keyframes fadeInCenter {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.95);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
}

/* -------------------------------------------------------------------------
   6. Utilities
   ------------------------------------------------------------------------- */
/* Back to Top Position Fix */
.back-to-top {
    bottom: 80px !important;
}

@media (min-width: 768px) {

    /* Style Back to Top to match Sidebar */
    #scroll-up,
    .scroll-up,
    .back-to-top,
    .kadence-scroll-to-top {
        bottom: 30px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
        color: #fff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        transition: all 0.3s ease !important;
    }

    /* Hover State - Gold accent */
    #scroll-up:hover,
    .scroll-up:hover,
    .back-to-top:hover,
    .kadence-scroll-to-top:hover {
        background: rgba(212, 175, 55, 0.15) !important;
        color: #d4af37 !important;
        transform: translateY(-2px);
    }

    /* Icon Size inside GOTOP */
    #scroll-up svg,
    .scroll-up svg,
    .back-to-top svg,
    .kadence-scroll-to-top svg {
        width: 24px !important;
        height: 24px !important;
        fill: currentColor !important;
    }
}