﻿/* =========================================================
   Webmunka (Unfinished Tasks) Dropdown
   ========================================================= */

/* ── Trigger button ── */
#webmunkaDropdown {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
    transition: background 0.18s ease;
}

    #webmunkaDropdown:hover,
    #webmunkaDropdown.active {
        background: rgba(0, 0, 0, 0.07) !important;
    }

    /* ── Icon amber pill ── */
    #webmunkaDropdown .wm-icon {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fef3c7;
        box-shadow: 0 0 0 1.5px #f59e0b, 0 2px 8px rgba(245, 158, 11, 0.25);
        transition: background 0.18s ease, box-shadow 0.18s ease;
    }

        #webmunkaDropdown .wm-icon i {
            font-size: 0.6rem !important;
            color: #d97706;
            transition: color 0.18s ease;
        }

    #webmunkaDropdown:hover .wm-icon {
        background: #fde68a;
        box-shadow: 0 0 0 2px #d97706, 0 3px 12px rgba(217, 119, 6, 0.4);
    }

        #webmunkaDropdown:hover .wm-icon i {
            color: #92400e;
        }

/* ── Dropdown panel ── */
#webmunka-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 280px;
    max-width: 340px;
    max-height: 80vh;
    padding: 0 !important;
    border: none !important;
    border-radius: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.13), 0 0 0 1px rgba(0, 0, 0, 0.06);
    background: #fff;
    overflow: visible;
    z-index: 10001 !important;
    animation: wmDrop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

    #webmunka-menu.show {
        display: block;
    }

@keyframes wmDrop {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(-6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Panel header ── */
.wm-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.wm-header-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111;
    white-space: nowrap;
}

/* ── Scrollable list ── */
.wm-list {
    max-height: calc(80vh - 48px);
    overflow-y: auto;
    overflow-x: visible;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

    .wm-list::-webkit-scrollbar {
        width: 4px;
    }

    .wm-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .wm-list::-webkit-scrollbar-thumb {
        background: #dde3ed;
        border-radius: 4px;
    }

/* ── Individual item row ── */
.wm-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.045);
}

    .wm-item:last-child {
        border-bottom: none;
    }

/* ── Item link ── */
.wm-item-link {
    flex: 1;
    min-width: 0;
    padding: 9px 12px !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    transition: background 0.13s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.04);
}

    .wm-item-link:hover,
    .wm-item-link:active {
        background: #f5f7fb !important;
    }

.wm-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a202c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wm-item-date {
    display: block;
    font-size: 11px;
    color: #8492a6;
    margin-top: 1px;
}

/* ── Ellipsis sub-dropdown trigger ── */
.wm-more-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin-right: 6px;
    border-radius: 7px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5b4;
    transition: background 0.13s, color 0.13s;
    padding: 0 !important;
}

    .wm-more-btn::before,
    .wm-more-btn::after {
        display: none !important;
    }

    .wm-more-btn:hover,
    .wm-more-btn:active {
        background: #f0f3f8 !important;
        color: #4a5568 !important;
    }

/* ── Sub-dropdown panel ── */
[webmunka-item-dropdown] .dropdown-menu {
    min-width: 150px;
    padding: 6px !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    z-index: 10010 !important;
    animation: wmDrop 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

[webmunka-item-dropdown] .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px !important;
    border-radius: 7px !important;
    font-size: 13px;
    font-weight: 500;
    color: #1a202c !important;
    transition: background 0.12s ease;
}

    [webmunka-item-dropdown] .dropdown-item:hover,
    [webmunka-item-dropdown] .dropdown-item:active {
        background: #f5f7fb !important;
    }

    [webmunka-item-dropdown] .dropdown-item .fa-trash {
        color: #e8394b;
    }

/* ── Mobile: full-width bottom sheet (up to 480px) ── */
@media (max-width: 480px) {
    #webmunka-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        min-width: 100vw;
        max-width: 100vw;
        border-radius: 18px 18px 0 0;
        animation: wmSlideUp 0.22s cubic-bezier(0.34, 1.4, 0.64, 1) both;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.06);
    }

    @keyframes wmSlideUp {
        from {
            opacity: 0;
            transform: translateY(24px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .wm-list {
        max-height: 55vh;
    }

    .wm-header {
        position: relative;
        padding-top: 22px !important;
    }

        .wm-header::before {
            content: '';
            display: block;
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            width: 36px;
            height: 4px;
            border-radius: 2px;
            background: rgba(0, 0, 0, 0.12);
        }

    .wm-item-link {
        min-height: 48px;
        padding: 10px 12px !important;
    }

    .wm-more-btn {
        width: 36px;
        height: 36px;
    }
}

/* ── Small tablets (481px to 640px) ── */
@media (min-width: 481px) and (max-width: 640px) {
    #webmunka-menu {
        min-width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}

/* ── Sub-dropdown mobile bottom sheet ── */
@media (max-width: 480px) {
    .wm-submenu-sheet {
        border-radius: 18px 18px 0 0 !important;
        padding: 0 !important;
        overflow: hidden;
        animation: wmSlideUp 0.2s cubic-bezier(0.34, 1.4, 0.64, 1) both !important;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    }

        /* Drag handle */
        .wm-submenu-sheet::before {
            content: '';
            display: block;
            margin: 10px auto 6px;
            width: 36px;
            height: 4px;
            border-radius: 2px;
            background: rgba(0, 0, 0, 0.12);
        }

        .wm-submenu-sheet .dropdown-item {
            min-height: 52px;
            font-size: 15px !important;
            padding: 14px 20px !important;
            border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        }

            .wm-submenu-sheet .dropdown-item:last-child {
                border-bottom: none;
                margin-bottom: 8px;
            }
}
