/* =====================================================
   ZFileo FILE SOURCE
===================================================== */

.z-file-source-wrapper {

    position: relative;

    display: inline-flex;

    align-items: stretch;

    width: max-content;

    top: 10px;

}


/* =====================================================
   EXISTING CHOOSE BUTTON
===================================================== */

.z-file-source-wrapper #chooseBtn {

    position: relative;

    margin: 0;

    border-top-right-radius: 0 !important;

    border-bottom-right-radius: 0 !important;

}


/* =====================================================
   ARROW BUTTON
===================================================== */

.z-file-source-arrow {

    width: 46px;

    min-width: 46px;

    padding: 0;

    margin: 0;

    border: none;

    border-left: 1px solid rgba(
        255,
        255,
        255,
        0.25
    );

    border-radius:
        0 10px 10px 0;

    background: #5b5cf0;

    color: #ffffff;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    transition:
        background 0.25s ease,
        transform 0.25s ease;

}


/* =====================================================
   ARROW HOVER
===================================================== */

.z-file-source-arrow:hover {

    background: #4f50dc;

}


/* =====================================================
   ARROW ICON
===================================================== */

.z-file-source-arrow i {

    font-size: 13px;

    transition:
        transform 0.28s cubic-bezier(
            0.22,
            1,
            0.36,
            1
        );

}


/* =====================================================
   ARROW HOVER / OPEN
===================================================== */

.z-file-source-arrow:hover i,

.z-file-source-wrapper.open
.z-file-source-arrow i {

    transform: rotate(180deg);

}


/* =====================================================
   INVISIBLE HOVER BRIDGE
   Arrow aur dropdown ke beech ka gap
===================================================== */

.z-file-source-wrapper::after {

    content: "";

    position: absolute;

    top: 100%;

    right: 0;

    width: 100%;

    height: 12px;

    background: transparent;

    z-index: 9998;

}


/* =====================================================
   DROPDOWN MENU
===================================================== */

.z-file-source-menu {

    position: absolute;

    top: calc(100% + 8px);

    left: 0;

    right: 0;

    width: 100%;

    min-width: 0;

    padding: 7px;

    box-sizing: border-box;

    background: #5b5cf0;

    border: 1px solid #4f50dc;

    border-radius: 12px;

    box-shadow:
        0 10px 30px rgba(
            0,
            0,
            0,
            0.18
        );

    z-index: 9999;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(-8px);

    pointer-events: none;

    transition:
        opacity 0.28s ease,
        transform 0.28s cubic-bezier(
            0.22,
            1,
            0.36,
            1
        ),
        visibility 0s linear 0.28s;

}


/* =====================================================
   DROPDOWN TOP BRIDGE
===================================================== */

.z-file-source-menu::before {

    content: "";

    position: absolute;

    top: -8px;

    left: 0;

    right: 0;

    height: 8px;

    background: transparent;

}


/* =====================================================
   ARROW HOVER
   Dropdown open
===================================================== */

.z-file-source-arrow:hover
~ .z-file-source-menu {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);

    pointer-events: auto;

}


/* =====================================================
   DROPDOWN HOVER
   Mouse dropdown ke andar hai
===================================================== */

.z-file-source-menu:hover {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);

    pointer-events: auto;

}


/* =====================================================
   ARROW + DROPDOWN HOVER STATE
===================================================== */

.z-file-source-wrapper:has(
    .z-file-source-arrow:hover
)
.z-file-source-menu,

.z-file-source-wrapper:has(
    .z-file-source-menu:hover
)
.z-file-source-menu {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);

    pointer-events: auto;

}


/* =====================================================
   CLICK OPEN
   CLICK KE BAAD HOVER HATNE PAR BHI OPEN RAHE
===================================================== */

.z-file-source-wrapper.open
.z-file-source-menu {

    opacity: 1 !important;

    visibility: visible !important;

    transform:
        translateY(0) !important;

    pointer-events: auto !important;

    transition:
        opacity 0.28s ease,
        transform 0.28s cubic-bezier(
            0.22,
            1,
            0.36,
            1
        ),
        visibility 0s linear 0s !important;

}


/* =====================================================
   MENU ITEM
===================================================== */

.z-file-source-item {

    width: 100%;

    min-height: 44px;

    padding:
        10px 12px;

    box-sizing: border-box;

    border: none;

    border-radius: 8px;

    background: transparent;

    color: #ffffff;

    display: flex;

    align-items: center;

    gap: 11px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease;

}


/* =====================================================
   SEPARATOR
   After From Device
===================================================== */

.z-file-source-item[data-source="device"] {

    border-bottom:
        1px solid rgba(
            255,
            255,
            255,
            0.20
        );

    border-radius:
        8px 8px 0 0;

}


/* =====================================================
   SEPARATOR
   After From Dropbox
===================================================== */

.z-file-source-item[data-source="dropbox"] {

    border-bottom:
        1px solid rgba(
            255,
            255,
            255,
            0.20
        );

    border-radius: 0;

}


/* =====================================================
   LAST ITEM
===================================================== */

.z-file-source-item[data-source="google-drive"] {

    border-radius:
        0 0 8px 8px;

}


/* =====================================================
   MENU ITEM HOVER
===================================================== */

.z-file-source-item:hover {

    background:
        rgba(
            255,
            255,
            255,
            0.16
        );

    color: #ffffff;

}


/* =====================================================
   MENU ICON
===================================================== */

.z-file-source-item i {

    width: 20px;

    font-size: 16px;

    text-align: center;

}


/* =====================================================
   MENU TEXT
===================================================== */

.z-file-source-item span {

    flex: 1;

}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {

    /* -------------------------------------------------
       COMPLETE CHOOSE BUTTON GROUP
       CENTER ALIGN
    ------------------------------------------------- */

    .z-file-source-wrapper {

        width: min(
            355px,
            calc(100% - 20px)
        ) !important;

        max-width: 100% !important;

        margin-left: auto !important;

        margin-right: auto !important;

        display: flex !important;

        align-items: stretch !important;

        justify-content: center !important;

        box-sizing: border-box !important;

    }


    /* -------------------------------------------------
       CHOOSE BUTTON
    ------------------------------------------------- */

    .z-file-source-wrapper #chooseBtn {

        flex: 1 1 auto !important;

        width: auto !important;

        margin: 0 !important;

    }


    /* -------------------------------------------------
       ARROW BUTTON
    ------------------------------------------------- */

    .z-file-source-arrow {

        width: 44px !important;

        min-width: 44px !important;

        flex: 0 0 44px !important;

    }


    /* -------------------------------------------------
       DROPDOWN
       EXACT SAME WIDTH AS COMPLETE BUTTON
    ------------------------------------------------- */

    .z-file-source-menu {

        position: absolute !important;

        top: calc(100% + 8px) !important;

        left: 0 !important;

        right: auto !important;

        width: 100% !important;

        min-width: 0 !important;

        max-width: 100% !important;

        box-sizing: border-box !important;

    }

}